<?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: regarding bapi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727891#M633126</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved by own&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Sep 2007 06:49:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-03T06:49:25Z</dc:date>
    <item>
      <title>regarding bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727888#M633123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              here in my scenario what i want that whenever i pass two material number it will give one document number ..ok ...but after writing this code it is giving two document number these two documnet number containing two material ...no doubt ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i want that after executing this bapi will give only one document number containing these two material number ..here the codes is..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BAPI header data.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;GM_HEADER-PSTNG_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;GM_HEADER-DOC_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Goods receipt for production order&lt;/P&gt;&lt;P&gt;GM_CODE-GM_CODE = '03'. " MB1A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Write '261' movement to table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR GM_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE '700000000226' TO GM_ITEM-ORDERID.&lt;/P&gt;&lt;P&gt;MOVE '261' TO GM_ITEM-MOVE_TYPE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE '000000003000000172' TO GM_ITEM-MATERIAL.&lt;/P&gt;&lt;P&gt;MOVE '.1' TO GM_ITEM-ENTRY_QNT.&lt;/P&gt;&lt;P&gt;MOVE '6000' TO GM_ITEM-PLANT.&lt;/P&gt;&lt;P&gt;MOVE 'WFC1' TO GM_ITEM-STGE_LOC.&lt;/P&gt;&lt;P&gt;MOVE '1000006662' TO GM_ITEM-BATCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND GM_ITEM.&lt;/P&gt;&lt;P&gt;clear GM_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE '700000000226' TO GM_ITEM-ORDERID.&lt;/P&gt;&lt;P&gt;MOVE '261' TO GM_ITEM-MOVE_TYPE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE '000000003000000170' TO GM_ITEM-MATERIAL.&lt;/P&gt;&lt;P&gt;MOVE '.1' TO GM_ITEM-ENTRY_QNT.&lt;/P&gt;&lt;P&gt;MOVE '6000' TO GM_ITEM-PLANT.&lt;/P&gt;&lt;P&gt;MOVE 'WFC1' TO GM_ITEM-STGE_LOC.&lt;/P&gt;&lt;P&gt;MOVE '1000007730' TO GM_ITEM-BATCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND GM_ITEM.&lt;/P&gt;&lt;P&gt;clear GM_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at gm_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call goods movement BAPI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BAPI_GOODSMVT_CREATE'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    GOODSMVT_HEADER  = GM_HEADER&lt;/P&gt;&lt;P&gt;    GOODSMVT_CODE    = gm_code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    GOODSMVT_HEADRET = GM_HEADRET&lt;/P&gt;&lt;P&gt;    MATERIALDOCUMENT = GM_RETMTD&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    GOODSMVT_ITEM    = GM_ITEM&lt;/P&gt;&lt;P&gt;    RETURN           = GM_RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*IF NOT GM_RETMTD IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; COMMIT WORK AND WAIT.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CALL FUNCTION 'DEQUEUE_ALL'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; COMMIT WORK AND WAIT.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CALL FUNCTION 'DEQUEUE_ALL'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*ENDIF.&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;WRITE:/ GM_RETMTD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 06:19:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727888#M633123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T06:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: regarding bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727889#M633124</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;you are calling the bapi for every line of your table. so, here your table contains 2 entries , it will therefore create two documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to do the loop, &lt;/P&gt;&lt;P&gt;then read next record of table&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt;  0.&lt;/P&gt;&lt;P&gt;call bapi&lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 06:36:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727889#M633124</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-09-03T06:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: regarding bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727890#M633125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI soonese plz explain it clearly.......i vud be grateful to you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 06:40:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727890#M633125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T06:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: regarding bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727891#M633126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved by own&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 06:49:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727891#M633126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T06:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: regarding bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727892#M633127</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;What i meant is that (here you are hard coding it) you  are appending  the header data twice. so, two documents will be created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you  needed to do is append header info only once but with any number of materials!! i.e:&lt;/P&gt;&lt;P&gt;Either &lt;/P&gt;&lt;P&gt;remove the following statement , it will work:&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at gm_item.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 06:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-bapi/m-p/2727892#M633127</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-09-03T06:55:49Z</dc:date>
    </item>
  </channel>
</rss>

