<?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_PO_CHANGE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/4703748#M1105213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Begin by test BAPI_PO_CHANGE with a header and one item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is correct, you test with other parameters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Nov 2008 12:55:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-04T12:55:19Z</dc:date>
    <item>
      <title>BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/4703747#M1105212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ABAPers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to update the PO using BAPI_PO_CHANGE. the code is as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM run_bapi .&lt;/P&gt;&lt;P&gt;    CLEAR : ipoheader, ipoheader[], ipoheaderx, ipoheaderx[],ipoitem,ipoitem[].&lt;/P&gt;&lt;P&gt;    CLEAR : ipoitemx,ipoitemx[],ipocond, ipocond[],ipocondx, ipocondx[],ireturn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT itab.&lt;/P&gt;&lt;P&gt;    DATA : vebelp LIKE ekpo-ebelp.&lt;/P&gt;&lt;P&gt;    DATA : vkposn TYPE kposn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR : vebelp, vkposn .&lt;/P&gt;&lt;P&gt;    CLEAR : ipoheader,ipoheaderx, ipoitem,ipoitemx,ipocond,ipocondx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ipoheader-po_number = itab-ebeln.&lt;/P&gt;&lt;P&gt;    ipoheader-our_ref = '1'.&lt;/P&gt;&lt;P&gt;    ipoheader-ref_1   = '1'.&lt;/P&gt;&lt;P&gt;    APPEND ipoheader.&lt;/P&gt;&lt;P&gt;    ipoheaderx-po_number = 'X'.&lt;/P&gt;&lt;P&gt;    ipoheaderx-our_ref = 'X'.&lt;/P&gt;&lt;P&gt;    ipoheaderx-ref_1   = 'X'.&lt;/P&gt;&lt;P&gt;    APPEND ipoheaderx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHILE vebelp &amp;lt; itab-ebelp.&lt;/P&gt;&lt;P&gt;      vebelp = vebelp + 10.&lt;/P&gt;&lt;P&gt;      vkposn = vkposn + 10.&lt;/P&gt;&lt;P&gt;      READ TABLE itab2 WITH KEY ebeln = itab-ebeln ebelp = vebelp.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          ipoitem-po_item    = itab2-ebelp.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         ipoitem-conf_ctrl  = '0001'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          ipoitem-val_type   = itab2-bwtar.&lt;/P&gt;&lt;P&gt;          IF itab2-bwtar = 'BOUGHT OUT'.&lt;/P&gt;&lt;P&gt;             ipoitem-calctype   = 'B'.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;             ipoitem-calctype   = 'A'.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;          APPEND ipoitem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          ipoitemx-po_item   = itab2-ebelp.&lt;/P&gt;&lt;P&gt;          ipoitemx-po_itemx   = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         ipoitemx-conf_ctrl = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          ipoitemx-val_type  = 'X'.&lt;/P&gt;&lt;P&gt;          ipoitemx-calctype  = 'X'.&lt;/P&gt;&lt;P&gt;          APPEND ipoitemx.&lt;/P&gt;&lt;P&gt;          IF itab2-bwtar = 'BOUGHT OUT'.&lt;/P&gt;&lt;P&gt;             ipocond-itm_number = itab2-ebelp.&lt;/P&gt;&lt;P&gt;             ipocond-cond_type  = 'ZEXP'.&lt;/P&gt;&lt;P&gt;             ipocond-cond_value = 0.&lt;/P&gt;&lt;P&gt;             ipocond-calctypcon = 'B'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            ipocond-change_id  = 'U'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             APPEND ipocond.&lt;/P&gt;&lt;P&gt;             ipocondx-itm_number  = itab2-ebelp.&lt;/P&gt;&lt;P&gt;             ipocondx-itm_numberx = 'X'.&lt;/P&gt;&lt;P&gt;             ipocondx-cond_type   = 'X'.&lt;/P&gt;&lt;P&gt;             ipocondx-cond_value  = 'X'.&lt;/P&gt;&lt;P&gt;             ipocondx-calctypcon  = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            ipocondx-change_id   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             APPEND ipocondx.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;             ipocond-itm_number   = itab2-ebelp.&lt;/P&gt;&lt;P&gt;             ipocond-calctypcon   = 'A'.&lt;/P&gt;&lt;P&gt;             APPEND ipocond.&lt;/P&gt;&lt;P&gt;             ipocondx-itm_number  = itab2-ebelp.&lt;/P&gt;&lt;P&gt;             ipocondx-itm_numberx = 'X'.&lt;/P&gt;&lt;P&gt;             ipocondx-calctypcon  = 'X'.&lt;/P&gt;&lt;P&gt;             APPEND ipocondx.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;          CLEAR: ipoitem,ipoitemx.&lt;/P&gt;&lt;P&gt;          CLEAR: ipocond,ipocondx.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    CLEAR : itab2.&lt;/P&gt;&lt;P&gt;    ENDWHILE.&lt;/P&gt;&lt;P&gt; CLEAR: itab, itab2.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&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                = ipoheader-po_number&lt;/P&gt;&lt;P&gt;          poheader                     = ipoheader&lt;/P&gt;&lt;P&gt;          poheaderx                    = ipoheaderx&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;         return                       = ireturn&lt;/P&gt;&lt;P&gt;         poitem                       = ipoitem&lt;/P&gt;&lt;P&gt;         poitemx                      = ipoitemx&lt;/P&gt;&lt;P&gt;         pocond                       = ipocond&lt;/P&gt;&lt;P&gt;         pocondx                      = ipocondx&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;       SORT ireturn BY type.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       READ TABLE ireturn WITH KEY type = 'E' BINARY SEARCH TRANSPORTING no field.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       IF sy-subrc = 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          itab-flag    = 'E'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          itab-err_msg = 'Valuation Type not updated.'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       ELSE.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          itab-flag    = 'S'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          itab-err_msg = 'Valuation Type updated successfully.'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   MODIFY itab TRANSPORTING flag err_msg.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CLEAR: itab, itab2.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*BREAK-POINT.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;&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;ENDFORM.                    " RUN_BAPI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I execute the above code, system put the Lock entry for PO and it got hanged. it show successfull of po change but not changes happens in PO Data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl help. &lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rrsuthar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 10:38:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/4703747#M1105212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T10:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/4703748#M1105213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Begin by test BAPI_PO_CHANGE with a header and one item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is correct, you test with other parameters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 12:55:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/4703748#M1105213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T12:55:19Z</dc:date>
    </item>
  </channel>
</rss>

