<?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: Problem with BAPI_PO_CHANGE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682376#M620133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone can help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2007 02:38:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-15T02:38:32Z</dc:date>
    <item>
      <title>Problem with BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682373#M620130</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'm using BAPI_PO_CHANGE to delete the PO line item. Below are my codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K_POITEM-PO_ITEM     = P_LINEITEM.&lt;/P&gt;&lt;P&gt;K_POITEM-DELETE_IND  = 'L'.&lt;/P&gt;&lt;P&gt;APPEND K_POITEM TO I_POITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K_POITEMX-PO_ITEM    = P_LINEITEM.&lt;/P&gt;&lt;P&gt;K_POITEMX-PO_ITEMX   = 'X'.&lt;/P&gt;&lt;P&gt;K_POITEMX-DELETE_IND = 'X'.&lt;/P&gt;&lt;P&gt;APPEND K_POITEMX TO I_POITEMX.&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 = P_PO&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      RETURN         = I_PO_RETURN&lt;/P&gt;&lt;P&gt;      POITEM         = I_POITEM&lt;/P&gt;&lt;P&gt;      POITEMX        = I_POITEMX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;  EXPORTING WAIT = C_X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT I_PO_RETURN INTO K_PO_RETURN.&lt;/P&gt;&lt;P&gt;  IF K_PO_RETURN-TYPE EQ C_E.&lt;/P&gt;&lt;P&gt;    V_FAIL = C_X.&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;The problem is, sometime the BAPI is successful, and sometime, in the I_PO_RETURN table, i will have the below errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I    Changing of PO using Enjoy BAPI unsuccessful&lt;/P&gt;&lt;P&gt;2. E   PO header data still faulty&lt;/P&gt;&lt;P&gt;3. E   User ABC already processing Purch. requisition17504750 0010.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line 2 &amp;amp; 3 is an error which cause the BAPI to fail. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I try to run it in debug mode and stepping into it line by line, it succeed. I was thinking some locks are not released before I call the BAPI, but I have checked and found no locking occur before the BAPI even being called. Is the BAPI itself causing the problem? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me with this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 08:38:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682373#M620130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T08:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682374#M620131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using WAIT 5 seconds after COMMT WORK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 08:47:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682374#M620131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T08:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682375#M620132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Atish, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do that? You mean after the BAPI_TRANSACTION_COMMIT? But the return table is already being defined before the BAPI_TRANSACTION_COMMIT. So, putting a WAIT will not change the content of the return table, if I'm not mistaken&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 09:01:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682375#M620132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T09:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682376#M620133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone can help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 02:38:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682376#M620133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T02:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682377#M620134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. There are two listing's of BAPI's available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) BAPI&lt;/P&gt;&lt;P&gt;Transaction BAPI if you have access to the backend. This is a bit flawed as it only lists Function modules that have been defined as BAPI's. I couldn't find your "bapi_poec_create" listed let aloan any others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) WebService browser&lt;/P&gt;&lt;P&gt;&lt;A href="http://&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;/sap/bc/bsp/sap/webservicebrowser/search.html" target="test_blank"&gt;http://&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;/sap/bc/bsp/sap/webservicebrowser/search.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Where &amp;lt;host&amp;gt; = Your SAP WebAS Host name; and &amp;lt;Port&amp;gt; is the active port - In the backend call transaction SMICM if you aren't sure.&lt;/P&gt;&lt;P&gt;This webservicebrowser will list all function modules with the 'RFC' indicator set e.g. that you can call externally. It also lists the WSDL file as it is intended to be used via a SOAP call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unfortunately both options that you are looking for don't exist - the cange and delete functionality. So I guess it will need to be a bespoke development.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just as a by the by in R/3 we don't ussally delete PO's once they have been created, but rather delete the line items. That leaves a PO with no line items which in effect is a deleted PO. If that is the way forward then you only need one bespoke process i.e. CHANGE as this could handle change &amp;amp; delete.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 02:55:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682377#M620134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T02:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682378#M620135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Infact you can do this way..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Call the BAPI to change the Asset Master
      CALL FUNCTION 'BAPI_FIXEDASSET_CHANGE'
           EXPORTING
                companycode = is_final-bukrs
                asset       = is_final-anln1
                subnumber   = is_final-anln2
                leasing     = is_leasing
                leasingx    = is_leasingx
           IMPORTING
                return      = it_return.
* If Asset Master is changed with out any errors
      READ TABLE it_return WITH KEY type = 'E'.
      IF sy-subrc = 0.
        flag = ' '.
      ELSE.
        flag = 'X'.
* Call the COMMIT BAPI
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
             EXPORTING
                  wait = 'X'.
        WAIT UP TO 2 SECONDS.
      ENDIF.

* If the Asset Master is changed with out any errors
      IF flag = 'X'.
        READ TABLE it_output INTO is_output WITH KEY
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  BINARY SEARCH.
        IF sy-subrc = 0.
*          is_output-c_icon  = c_green.
          is_output-leabg_n = is_final-leabg.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          MODIFY it_output FROM is_output
                           TRANSPORTING leabg_n message
                           WHERE bukrs = is_output-bukrs
                             AND anln1 = is_output-anln1
                             AND anln2 = is_output-anln2.
        ENDIF.
      ELSEIF flag = ' '.
        READ TABLE it_output INTO is_output WITH KEY
                                  bukrs = is_final-bukrs
                                  anln1 = is_final-anln1
                                  anln2 = is_final-anln2
                                  BINARY SEARCH.
        IF sy-subrc = 0.
*          is_output-c_icon  = c_red.
          is_output-leabg_n = is_leasing-start_date.
          is_output-message = it_return-message.
* Modify the output internal table with the changed new values
          MODIFY it_output FROM is_output
                           TRANSPORTING leabg_n message
                           WHERE bukrs = is_output-bukrs
                             AND anln1 = is_output-anln1
                             AND anln2 = is_output-anln2.
        ENDIF.
      ENDIF.
    ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 02:58:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682378#M620135</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2007-08-15T02:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682379#M620136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I saw your code and no problem at your coding ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there should be data problem while deleting purchase order&lt;/P&gt;&lt;P&gt;Before deleting ,please lock po number ,and unlock the po once you done ( I guess 3rd erors seems to be lock issue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to do manually in ME22n and see the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 03:31:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-po-change/m-p/2682379#M620136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T03:31:45Z</dc:date>
    </item>
  </channel>
</rss>

