<?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_goodsmvt_create in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649128#M288564</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you try to make the changes and if you run into problems, ask for more help at that time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Oct 2006 21:58:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-25T21:58:55Z</dc:date>
    <item>
      <title>bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649121#M288557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i created a functional module the purpose of this is to send an email to the distribution list when ever there is an error in processing the item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;every thing is working fine but a PO can have a number of items so in my program if the first item is error it is not processing the second item. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so can any one help me with logic how to process all the items in the PO if there is an error in some of the items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*" IMPORTING&lt;/P&gt;&lt;P&gt;*" VALUE(GOODSMVT_HEADER) LIKE BAPI2017_GM_HEAD_01 STRUCTURE&lt;/P&gt;&lt;P&gt;*" BAPI2017_GM_HEAD_01&lt;/P&gt;&lt;P&gt;*" VALUE(GOODSMVT_CODE) LIKE BAPI2017_GM_CODE STRUCTURE&lt;/P&gt;&lt;P&gt;*" BAPI2017_GM_CODE&lt;/P&gt;&lt;P&gt;*" VALUE(TESTRUN) LIKE BAPI2017_GM_GEN-TESTRUN DEFAULT SPACE&lt;/P&gt;&lt;P&gt;*" EXPORTING&lt;/P&gt;&lt;P&gt;*" VALUE(GOODSMVT_HEADRET) LIKE BAPI2017_GM_HEAD_RET STRUCTURE&lt;/P&gt;&lt;P&gt;*" BAPI2017_GM_HEAD_RET&lt;/P&gt;&lt;P&gt;*" VALUE(MATERIALDOCUMENT) TYPE BAPI2017_GM_HEAD_RET-MAT_DOC&lt;/P&gt;&lt;P&gt;*" VALUE(MATDOCUMENTYEAR) TYPE BAPI2017_GM_HEAD_RET-DOC_YEAR&lt;/P&gt;&lt;P&gt;*" TABLES&lt;/P&gt;&lt;P&gt;*" GOODSMVT_ITEM STRUCTURE BAPI2017_GM_ITEM_CREATE&lt;/P&gt;&lt;P&gt;*" GOODSMVT_SERIALNUMBER STRUCTURE BAPI2017_GM_SERIALNUMBER&lt;/P&gt;&lt;P&gt;*" OPTIONAL&lt;/P&gt;&lt;P&gt;*" RETURN STRUCTURE BAPIRET2&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ET PLANT AND STORAGE LOC TO THE INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE goodsmvt_item LINES w_no_lines.&lt;/P&gt;&lt;P&gt;IF w_no_lines &amp;gt; 0.&lt;/P&gt;&lt;P&gt;SELECT ebeln ebelp werks lgort&lt;/P&gt;&lt;P&gt;FROM ekpo&lt;/P&gt;&lt;P&gt;INTO TABLE t_ekpo FOR ALL ENTRIES IN goodsmvt_item&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;ebeln = goodsmvt_item-po_number AND&lt;/P&gt;&lt;P&gt;ebelp = goodsmvt_item-po_item.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GET THE VENDOR NUMBER.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR w_lifnr.&lt;/P&gt;&lt;P&gt;SELECT SINGLE lifnr INTO w_lifnr&lt;/P&gt;&lt;P&gt;FROM ekko&lt;/P&gt;&lt;P&gt;WHERE ebeln = goodsmvt_item-po_number.&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;MODIFY THE ITEMS TABLE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT goodsmvt_item.&lt;/P&gt;&lt;P&gt;CLEAR t_ekpo.&lt;/P&gt;&lt;P&gt;READ TABLE t_ekpo WITH KEY ebeln = goodsmvt_item-po_number&lt;/P&gt;&lt;P&gt;ebelp = goodsmvt_item-po_item.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;goodsmvt_item-plant = t_ekpo-werks.&lt;/P&gt;&lt;P&gt;goodsmvt_item-stge_loc = t_ekpo-lgort.&lt;/P&gt;&lt;P&gt;MODIFY goodsmvt_item TRANSPORTING plant stge_loc.&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;endloop.&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;Execute Goods Receipt for PO&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 = goodsmvt_header&lt;/P&gt;&lt;P&gt;goodsmvt_code = '01' "from table t158g for mb01&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TESTRUN = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;goodsmvt_headret = goodsmvt_headret&lt;/P&gt;&lt;P&gt;materialdocument = materialdocument&lt;/P&gt;&lt;P&gt;matdocumentyear = matdocumentyear&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;goodsmvt_item = goodsmvt_item&lt;/P&gt;&lt;P&gt;goodsmvt_serialnumber = goodsmvt_serialnumber&lt;/P&gt;&lt;P&gt;return = t_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CHECK WHETHER MAT DOC NO IS CREATED.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF materialdocument = space.&lt;/P&gt;&lt;P&gt;CLEAR w_lv_fname.&lt;/P&gt;&lt;P&gt;w_lv_fname = goodsmvt_item-entry_qnt.&lt;/P&gt;&lt;P&gt;SHIFT w_lv_fname LEFT DELETING LEADING space.&lt;/P&gt;&lt;P&gt;CLEAR w_temp_flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MOVE THE ERROR MESSAGE TO THE INTERNAL TABLE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT t_return WHERE type = 'E'.&lt;/P&gt;&lt;P&gt;IF w_temp_flag NE t_return-row.&lt;/P&gt;&lt;P&gt;READ TABLE goodsmvt_item INDEX w_temp_flag.&lt;/P&gt;&lt;P&gt;CONCATENATE 'The following errors were detected when posting GR For'&lt;/P&gt;&lt;P&gt;'PO NO' goodsmvt_item-po_number&lt;/P&gt;&lt;P&gt;'PLANT' goodsmvt_item-plant&lt;/P&gt;&lt;P&gt;'STORAGE LOC' goodsmvt_item-stge_loc&lt;/P&gt;&lt;P&gt;'MATERIAL' goodsmvt_item-material&lt;/P&gt;&lt;P&gt;'MOVEMENT TYPE' goodsmvt_item-move_type&lt;/P&gt;&lt;P&gt;'QUANTITY' w_lv_fname&lt;/P&gt;&lt;P&gt;'SERIAL NO' goodsmvt_serialnumber-serialno&lt;/P&gt;&lt;P&gt;'PO ITEM NO' goodsmvt_item-po_item&lt;/P&gt;&lt;P&gt;INTO t_msg SEPARATED BY space.&lt;/P&gt;&lt;P&gt;APPEND t_msg.&lt;/P&gt;&lt;P&gt;w_temp_flag = t_return-row.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;MOVE t_return TO t_msg.&lt;/P&gt;&lt;P&gt;APPEND t_msg.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EMAIL SUBJECT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;w_subject = .gr fail'.&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;CHECK THE NAME OF THE SAP SYSTEM.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF sy-sysid = 'PRD'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get vendor-specific distribution list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'Z_GET_DISTRIBUTION'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;application = c_application&lt;/P&gt;&lt;P&gt;application_group = w_lifnr&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;address_list = w_address_list.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get test user group distribution list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'Z_GET_DISTRIBUTION'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;application = c_application&lt;/P&gt;&lt;P&gt;application_group = c_test&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;address_list = w_address_list.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SEND EMAIL TO THE DISTRIBUTION LIST.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'Z_UNIX_MAIL'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ux_receivers = w_address_list&lt;/P&gt;&lt;P&gt;ux_subject = w_subject&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UX_FROM =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;ux_lines = t_msg.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;COMMIT WORK AND WAIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 20:46:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649121#M288557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T20:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649122#M288558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well this is the the way SAP transactions and BAPIS work. I think it will just stop at the first error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would take longer, but you could send each item separately to the BAPI with TESTRUN checked. If any fail then send all that failed to the e-mail routine; otherwise, run the full bapi with all of the items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this is a duplicate post on the data transfer forum, would you please close one or the other of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 21:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649122#M288558</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T21:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649123#M288559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey rob thank you very much for the reply &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; can you send me the code for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 21:40:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649123#M288559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T21:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649124#M288560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You just use the code you have for each line item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this will just pick up the first error for each item (or the header).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if there is an error in the header, all line items would fail, so in this case you probably wouldn't want to test the rest of the items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 21:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649124#M288560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T21:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649125#M288561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks rob &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  can u send me the code how would i send each item seperatley to bapi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 21:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649125#M288561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T21:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649126#M288562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I don't have the code, but like I say, it would be very easy for you to adapt the code you have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 21:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649126#M288562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T21:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649127#M288563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; can you make changes in my code and send me please.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 21:56:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649127#M288563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T21:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649128#M288564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you try to make the changes and if you run into problems, ask for more help at that time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 21:58:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649128#M288564</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T21:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_goodsmvt_create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649129#M288565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok thank you for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 22:01:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1649129#M288565</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T22:01:43Z</dc:date>
    </item>
  </channel>
</rss>

