<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BAPI_DOCUMENT_CREATE2 : How to link a DIR with network activity in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-how-to-link-a-dir-with-network-activity/m-p/1524277#M240360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved it but I don't know why the new solution works and no the first one : I create the document without objectlinks table and  call function DOCUMENT_ASSIGNMENT_DIRECT just after and it creates the link...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Sep 2006 11:51:10 GMT</pubDate>
    <dc:creator>former_member246786</dc:creator>
    <dc:date>2006-09-01T11:51:10Z</dc:date>
    <item>
      <title>BAPI_DOCUMENT_CREATE2 : How to link a DIR with network activity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-how-to-link-a-dir-with-network-activity/m-p/1524276#M240359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I try to create a DIR and to link it with a network activty. The puprose is to create a dir, deals with dir issue and link add originals to the dir and link it with the aticty 10 (vornr =0010) of a gived network.&lt;/P&gt;&lt;P&gt;I tried to do it using existing transaction : CN22&lt;/P&gt;&lt;P&gt;I follow tehse steps : launch CN22, select the network, select the activity &amp;gt;&amp;gt; menu EXTRA&amp;gt;&amp;gt; create document&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system launch CV01N transaction, I create the document in CV01N , Save  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I see in SE16 , table DRAW :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Document Type = ZCL&lt;/P&gt;&lt;P&gt;Document = myDocNumber&lt;/P&gt;&lt;P&gt;version = 00&lt;/P&gt;&lt;P&gt;part = 000&lt;/P&gt;&lt;P&gt;Object = VORGNET&lt;/P&gt;&lt;P&gt;Object key= SUYCL010010 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where SUYCL01 == Aufnr of the network&lt;/P&gt;&lt;P&gt;0010 = vornr of activty 10 ... so, I conclude that the following code wil do the same :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear ls_doc.&lt;/P&gt;&lt;P&gt;    ls_doc-documentnumber = lw_aufnr.&lt;/P&gt;&lt;P&gt;    ls_doc-documenttype = 'ZCL'.&lt;/P&gt;&lt;P&gt;    ls_doc-documentversion = '00'.&lt;/P&gt;&lt;P&gt;    ls_doc-documentpart = '000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear: li_objectlinks,li_objectlinks[].&lt;/P&gt;&lt;P&gt;    li_objectlinks-objectkey = lw_dockey.&lt;/P&gt;&lt;P&gt;    li_objectlinks-objecttype = lk_dokob_vorgnet.&lt;/P&gt;&lt;P&gt;    APPEND li_objectlinks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        documentdata               = ls_doc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;    DOCUMENTTYPE               = lw_doctype&lt;/P&gt;&lt;P&gt;    DOCUMENTNUMBER             = lw_docnumber&lt;/P&gt;&lt;P&gt;    DOCUMENTPART               = lw_docpart&lt;/P&gt;&lt;P&gt;    DOCUMENTVERSION            = lw_docversion&lt;/P&gt;&lt;P&gt;       return                   = ls_return&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;       objectlinks                = li_objectlinks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF ls_return IS INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;                 EXPORTING&lt;/P&gt;&lt;P&gt;                   WAIT          = 'X'.&lt;/P&gt;&lt;P&gt;                          .&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no problem during my code execution, ls_return is empty, the commit statment works , the dir is created but there is no link between the link and Network activity ... I don't understand why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something I forgot ? Is opbjectkey something else than aufnr+vornr ? Is there specific cases in wich i have to give additional parameters to make links functionnality works?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help cause I really don't understand what is happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Morgan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2006 07:41:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-how-to-link-a-dir-with-network-activity/m-p/1524276#M240359</guid>
      <dc:creator>former_member246786</dc:creator>
      <dc:date>2006-09-01T07:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DOCUMENT_CREATE2 : How to link a DIR with network activity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-how-to-link-a-dir-with-network-activity/m-p/1524277#M240360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved it but I don't know why the new solution works and no the first one : I create the document without objectlinks table and  call function DOCUMENT_ASSIGNMENT_DIRECT just after and it creates the link...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2006 11:51:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-how-to-link-a-dir-with-network-activity/m-p/1524277#M240360</guid>
      <dc:creator>former_member246786</dc:creator>
      <dc:date>2006-09-01T11:51:10Z</dc:date>
    </item>
  </channel>
</rss>

