<?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/1801579#M344066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravikumar,&lt;/P&gt;&lt;P&gt;Make sure that your test_run variable doesn't have value 'X'. or just comment that line and try to execute.&lt;/P&gt;&lt;P&gt;Check this sample code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZTEST_BAPI_PO_CHANGE .
tables: ekpo.

data: tl_ekpo type standard table of ekpo,
      tl_fields type standard table of char21,
      tl_poitem type standard table of bapimepoitem,
      tl_poitemx type standard table of bapimepoitemx,
      tl_return TYPE standard table of bapiret2...


data: wal_ekpo type ekpo,
      wal_poitem type bapimepoitem,
      wal_poitemx type bapimepoitemx.

data: wl_ebeln type ekpo-ebeln,
      wl_eindt type eket-eindt.

data: wl_testrun type bapiflag-bapiflag value 'X',
      wl_maktx type makt-maktx.

field-symbols: &amp;lt;l_ekpo&amp;gt; type ekpo.

  parameters: p_ebeln type ekpo-ebeln.
  call function 'Z_GET_FIELDS_WORKAREA'
    exporting
      work_area       = wal_ekpo
    tables
      t_fields        = tl_fields
            .
wl_ebeln = p_ebeln.

call function 'CONVERSION_EXIT_ALPHA_INPUT'
  exporting
    input         = wl_ebeln
 IMPORTING
   OUTPUT        = wl_ebeln.
          .

  select (tl_fields)
          into table tl_ekpo
          from ekpo
          where ebeln = wl_ebeln.

  read table tl_ekpo assigning &amp;lt;l_ekpo&amp;gt; index 1.
  if sy-subrc ne 0.exit.endif.
  select single eindt
          into wl_eindt
          from eket
          where ebeln = &amp;lt;l_ekpo&amp;gt;-ebeln
          and ebelp = &amp;lt;l_ekpo&amp;gt;-ebelp.

  select single maktx
          into wl_maktx
          from makt
          where matnr = &amp;lt;l_ekpo&amp;gt;-matnr.

*  wal_poitem-po_item = &amp;lt;l_ekpo&amp;gt;-ebelp + 10.
*  wal_poitem- = wl_eindt
  wal_poitem-material = &amp;lt;l_ekpo&amp;gt;-MATNR.
  wal_poitem-short_text = wl_maktx.
*  wal_poitem-ematerial = &amp;lt;l_ekpo&amp;gt;-ematn.
  wal_poitem-QUANTITY = '1'.
  wal_poitem-PO_UNIT = &amp;lt;l_ekpo&amp;gt;-meins.
  wal_poitem-net_price = 6.
  wal_poitem-PRICE_UNIT = &amp;lt;l_ekpo&amp;gt;-PEINH.
  wal_poitem-ACCTASSCAT = &amp;lt;l_ekpo&amp;gt;-knttp.
  wal_poitem-ORDERPR_UN = &amp;lt;l_ekpo&amp;gt;-BPRME.
  wal_poitem-MATL_GROUP = &amp;lt;l_ekpo&amp;gt;-matkl.
  wal_poitem-plant = &amp;lt;l_ekpo&amp;gt;-werks.
  wal_poitem-stge_loc = &amp;lt;l_ekpo&amp;gt;-lgort.
  wal_poitem-TRACKINGNO = &amp;lt;l_ekpo&amp;gt;-bednr.
  wal_poitem-INFO_REC = &amp;lt;l_ekpo&amp;gt;-infnr.
  append wal_poitem to tl_poitem.

*    wal_poitemx-po_itemx = 'X'.
   wal_poitemx-material = 'X'.
*  wal_poitemx-ematerial = &amp;lt;l_ekpo&amp;gt;-ematn.
    wal_poitemx-quantity = 'X'.
    wal_poitemx-po_unit = 'X'.
    wal_poitemx-net_price = 'X'.
    wal_poitemx-price_unit = 'X'.
    wal_poitem-ACCTASSCAT = 'X'.
    wal_poitemx-short_text = 'X'.
    wal_poitemx-orderpr_un = 'X'.
    wal_poitemx-matl_group = 'X'.
    wal_poitemx-plant = 'X'.
    wal_poitemx-stge_loc = 'X'.
    wal_poitemx-trackingno = 'X'.
    wal_poitemx-info_rec = 'X'.
    append wal_poitemx to tl_poitemx.


 call function 'BAPI_PO_CHANGE'
   exporting
     purchaseorder                = &amp;lt;l_ekpo&amp;gt;-ebeln
*     TESTRUN                      = wl_testrun
   TABLES
     RETURN                       = tl_return
     POITEM                       = tl_poitem
     POITEMX                      = tl_poitemx
            .
    read table tl_return with key type = 'S' transporting no fields.
    if sy-subrc eq 0.
    call function 'BAPI_TRANSACTION_COMMIT'.
    endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Dec 2006 06:06:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-29T06:06:17Z</dc:date>
    <item>
      <title>BAPI_PO_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/1801576#M344063</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 have been used the fun module 'BAPI_PO_CHANGE' for PO item Change.&lt;/P&gt;&lt;P&gt;But it is not updating the PO item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have alook on this code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR po_item_inx.&lt;/P&gt;&lt;P&gt;po_item_inx-po_item = order_info-item_no.&lt;/P&gt;&lt;P&gt;po_item_inx-po_itemx = 'X'.&lt;/P&gt;&lt;P&gt;po_item_inx-quantity = 'X'.&lt;/P&gt;&lt;P&gt;APPEND po_item_inx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR po_item_in.&lt;/P&gt;&lt;P&gt;po_item_in-po_item = order_info-item_no.&lt;/P&gt;&lt;P&gt;po_item_in-quantity = temp_final_qty.&lt;/P&gt;&lt;P&gt;APPEND po_item_in.&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 = po_doc_no&lt;/P&gt;&lt;P&gt;    testrun       = test_run&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    return        = t_return&lt;/P&gt;&lt;P&gt;    poitem        = po_item_in&lt;/P&gt;&lt;P&gt;    poitemx       = po_item_inx.&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;  IMPORTING&lt;/P&gt;&lt;P&gt;    return = c_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        ravikumar s&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 03:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/1801576#M344063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-29T03:50:12Z</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/1801577#M344064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post your code...??? It can help identifying the problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 03:56:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/1801577#M344064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-29T03:56:30Z</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/1801578#M344065</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; Use BAPI_TRANSACTION_COMMIT after the PO change BAPI , &lt;/P&gt;&lt;P&gt;When you dry run BAPI from SE37 it will not Change PO , &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Please mark useful answers&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 04:07:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/1801578#M344065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-29T04:07:28Z</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/1801579#M344066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravikumar,&lt;/P&gt;&lt;P&gt;Make sure that your test_run variable doesn't have value 'X'. or just comment that line and try to execute.&lt;/P&gt;&lt;P&gt;Check this sample code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZTEST_BAPI_PO_CHANGE .
tables: ekpo.

data: tl_ekpo type standard table of ekpo,
      tl_fields type standard table of char21,
      tl_poitem type standard table of bapimepoitem,
      tl_poitemx type standard table of bapimepoitemx,
      tl_return TYPE standard table of bapiret2...


data: wal_ekpo type ekpo,
      wal_poitem type bapimepoitem,
      wal_poitemx type bapimepoitemx.

data: wl_ebeln type ekpo-ebeln,
      wl_eindt type eket-eindt.

data: wl_testrun type bapiflag-bapiflag value 'X',
      wl_maktx type makt-maktx.

field-symbols: &amp;lt;l_ekpo&amp;gt; type ekpo.

  parameters: p_ebeln type ekpo-ebeln.
  call function 'Z_GET_FIELDS_WORKAREA'
    exporting
      work_area       = wal_ekpo
    tables
      t_fields        = tl_fields
            .
wl_ebeln = p_ebeln.

call function 'CONVERSION_EXIT_ALPHA_INPUT'
  exporting
    input         = wl_ebeln
 IMPORTING
   OUTPUT        = wl_ebeln.
          .

  select (tl_fields)
          into table tl_ekpo
          from ekpo
          where ebeln = wl_ebeln.

  read table tl_ekpo assigning &amp;lt;l_ekpo&amp;gt; index 1.
  if sy-subrc ne 0.exit.endif.
  select single eindt
          into wl_eindt
          from eket
          where ebeln = &amp;lt;l_ekpo&amp;gt;-ebeln
          and ebelp = &amp;lt;l_ekpo&amp;gt;-ebelp.

  select single maktx
          into wl_maktx
          from makt
          where matnr = &amp;lt;l_ekpo&amp;gt;-matnr.

*  wal_poitem-po_item = &amp;lt;l_ekpo&amp;gt;-ebelp + 10.
*  wal_poitem- = wl_eindt
  wal_poitem-material = &amp;lt;l_ekpo&amp;gt;-MATNR.
  wal_poitem-short_text = wl_maktx.
*  wal_poitem-ematerial = &amp;lt;l_ekpo&amp;gt;-ematn.
  wal_poitem-QUANTITY = '1'.
  wal_poitem-PO_UNIT = &amp;lt;l_ekpo&amp;gt;-meins.
  wal_poitem-net_price = 6.
  wal_poitem-PRICE_UNIT = &amp;lt;l_ekpo&amp;gt;-PEINH.
  wal_poitem-ACCTASSCAT = &amp;lt;l_ekpo&amp;gt;-knttp.
  wal_poitem-ORDERPR_UN = &amp;lt;l_ekpo&amp;gt;-BPRME.
  wal_poitem-MATL_GROUP = &amp;lt;l_ekpo&amp;gt;-matkl.
  wal_poitem-plant = &amp;lt;l_ekpo&amp;gt;-werks.
  wal_poitem-stge_loc = &amp;lt;l_ekpo&amp;gt;-lgort.
  wal_poitem-TRACKINGNO = &amp;lt;l_ekpo&amp;gt;-bednr.
  wal_poitem-INFO_REC = &amp;lt;l_ekpo&amp;gt;-infnr.
  append wal_poitem to tl_poitem.

*    wal_poitemx-po_itemx = 'X'.
   wal_poitemx-material = 'X'.
*  wal_poitemx-ematerial = &amp;lt;l_ekpo&amp;gt;-ematn.
    wal_poitemx-quantity = 'X'.
    wal_poitemx-po_unit = 'X'.
    wal_poitemx-net_price = 'X'.
    wal_poitemx-price_unit = 'X'.
    wal_poitem-ACCTASSCAT = 'X'.
    wal_poitemx-short_text = 'X'.
    wal_poitemx-orderpr_un = 'X'.
    wal_poitemx-matl_group = 'X'.
    wal_poitemx-plant = 'X'.
    wal_poitemx-stge_loc = 'X'.
    wal_poitemx-trackingno = 'X'.
    wal_poitemx-info_rec = 'X'.
    append wal_poitemx to tl_poitemx.


 call function 'BAPI_PO_CHANGE'
   exporting
     purchaseorder                = &amp;lt;l_ekpo&amp;gt;-ebeln
*     TESTRUN                      = wl_testrun
   TABLES
     RETURN                       = tl_return
     POITEM                       = tl_poitem
     POITEMX                      = tl_poitemx
            .
    read table tl_return with key type = 'S' transporting no fields.
    if sy-subrc eq 0.
    call function 'BAPI_TRANSACTION_COMMIT'.
    endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 06:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-change/m-p/1801579#M344066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-29T06:06:17Z</dc:date>
    </item>
  </channel>
</rss>

