<?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_ret2 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255217#M1214005</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are passing bapiret2 to the function module without any data! You would first need to read the proper record from bapiret2 internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shahram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Feb 2009 16:50:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-23T16:50:10Z</dc:date>
    <item>
      <title>bapi_ret2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255214#M1214002</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;          CALL FUNCTION 'BAPI_PO_CHANGE'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;              purchaseorder = lv_ekpo_ebeln&lt;/P&gt;&lt;P&gt;            TABLES&lt;/P&gt;&lt;P&gt;              return        = lt_returns&lt;/P&gt;&lt;P&gt;              poitem        = lt_items&lt;/P&gt;&lt;P&gt;              poitemx       = lt_itemxs.&lt;/P&gt;&lt;P&gt;In the above Function module lt_returns is internal table in this iam getting 3 error messages and coming to below function module              CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. &lt;/P&gt;&lt;P&gt;here iam getting only 1 error message .&lt;/P&gt;&lt;P&gt;here is the code which they have mentioned.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'            &lt;/P&gt;&lt;P&gt;CLEAR ls_ekpo_item_to_process.&lt;/P&gt;&lt;P&gt;            LOOP AT lt_ekpo_items_to_process INTO ls_ekpo_item_to_process.&lt;/P&gt;&lt;P&gt;              ls_ekpo_item_to_process-txz01 = c_failed_message_2.&lt;/P&gt;&lt;P&gt;              APPEND ls_ekpo_item_to_process TO lt_processed_ekpo_items.&lt;/P&gt;&lt;P&gt;              CLEAR ls_ekpo_item_to_process.&lt;/P&gt;&lt;P&gt;            ENDLOOP.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and i have wriiten the code as in CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'&lt;/P&gt;&lt;P&gt; CLEAR ls_ekpo_item_to_process.&lt;/P&gt;&lt;P&gt;              Data : w_msg type string.&lt;/P&gt;&lt;P&gt;              Data : bapiret2 type BAPIRET2 occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              LOOP AT lt_ekpo_items_to_process INTO ls_ekpo_item_to_process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                CALL FUNCTION 'FORMAT_MESSAGE'&lt;/P&gt;&lt;P&gt;                 EXPORTING&lt;/P&gt;&lt;P&gt;                   ID              = bapiret2-ID&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                  LANG            = '-D'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                   NO              = bapiret2-number&lt;/P&gt;&lt;P&gt;                   V1              = bapiret2-MESSAGE_V1&lt;/P&gt;&lt;P&gt;                   V2              = bapiret2-MESSAGE_V2&lt;/P&gt;&lt;P&gt;                   V3              = bapiret2-MESSAGE_V3&lt;/P&gt;&lt;P&gt;                   V4              = bapiret2-MESSAGE_V4&lt;/P&gt;&lt;P&gt;                 IMPORTING&lt;/P&gt;&lt;P&gt;                   MSG             = w_msg.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                  NOT_FOUND       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                  OTHERS          = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                  write : w_msg.&lt;/P&gt;&lt;P&gt;here it is going to dump can any one correct the syntax that where i have done the fault.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 12:13:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255214#M1214002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T12:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_ret2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255215#M1214003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simple example...&lt;/P&gt;&lt;P&gt;This one is setting a deletion indicator for 1 PO-number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: po_num         TYPE ebeln,
      po_header      TYPE bapimepoheader,
      po_headerx     TYPE bapimepoheaderx,
      t_bapi_poitem  TYPE bapimepoitem_tp,
      t_bapi_poitemx TYPE bapimepoitemx_tp,
      va_poitem      TYPE bapimepoitem,
      va_poitemx     TYPE bapimepoitemx,
      lt_return      TYPE STANDARD TABLE OF bapiret2.


      va_return      TYPE bapiret2.

* Fill BAPI-structures
po_num = '4500376192'.

* Header
po_header-po_number   = po_num.
po_header-delete_ind  = 'L'.
po_header-doc_type    = 'F'.
etc. 
etc.

* HeaderX (the one you change)
po_headerx-po_number  = po_num.
po_headerx-delete_ind = 'L'.
po_headerx-doc_type   = 'F'.


* add Item(s)
va_poitem-.... = ...
va_poitem-.... = ...
APPEND va_poitem TO  ta_poitem.

* add Item(X) (The one(s) U change
va_poitemx-.... = ...
va_poitemx-.... = ...
APPEND va_poitemx TO  ta_poitemx.

* Call BAPI
CALL FUNCTION 'BAPI_PO_CHANGE'
  EXPORTING
    purchaseorder = po_num
    poheader      = po_header
    poheaderx     = po_headerx
  TABLES
    return        = lt_return
    poitem        = ta_poitem
    poitemx       = ta_poitemx.


* Check errors
READ TABLE lt_return INTO va_return WITH KEY type = 'E'.

* No errors
IF sy-subrc NE 0.

* Commit
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait   = 'X'
    IMPORTING
      return = va_return.

ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Postema on Feb 23, 2009 3:03 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Postema on Feb 23, 2009 3:10 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Postema on Feb 23, 2009 3:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 14:02:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255215#M1214003</guid>
      <dc:creator>rob_postema</dc:creator>
      <dc:date>2009-02-23T14:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_ret2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255216#M1214004</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;  After using   'BAPI_PO_CHANGE'&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    check IF sy-subrc  0.  "no errors&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Then  Commit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krishna..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 14:08:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255216#M1214004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T14:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_ret2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255217#M1214005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are passing bapiret2 to the function module without any data! You would first need to read the proper record from bapiret2 internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shahram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 16:50:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255217#M1214005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T16:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_ret2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255218#M1214006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chalapathi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can You mention the dump please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And As Kartik Tarla said to you in your previous post &lt;STRONG&gt;Emailid and firstname&lt;/STRONG&gt; do that atleast in the weekends.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Dileep .C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 02:45:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255218#M1214006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T02:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: bapi_ret2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255219#M1214007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;aa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2009 07:31:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-ret2/m-p/5255219#M1214007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-20T07:31:32Z</dc:date>
    </item>
  </channel>
</rss>

