Skip to Content
author's profile photo Former Member
Former Member

BAPI_PO_Change

Hello everyone,

I am trying to use BAPI_PO_Change in an enhancement of tcode MB01, the field in the po line item is changed and logged and could be found in the Tcode ME22n->MENU->Environment-> ITEM CHANGES. But the PO is not changed, hence the field change is not seen when viewed in ME22n because the database is not commited or updated.

The BAPI return message is also success and says PO is changed, but PO is not changed.

How can i change and update the PO.....

Thanks,

Uma.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2012 at 07:06 AM

    Hi Uma,

    Normally this should not happen. Just make sure while calling the BAPI, TESTRUN is empty.

    And also try to use COMMIT WORK after calling BAPI.

    Regards,

    Amit Mittal.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 08, 2012 at 06:56 PM

    Hi Uma,

    Fisrt try to get the details of PO that you want to change by using BAPI BAPI_PO_GETDETAIL1 , there you will get POSCHEDULE table . Then update this table with the data that you need to update and build the table POSCHEDULEX with PO_ITEMX and the field that you need to udate with 'X' an use in BAPI BAPI_PO_CHANGE . Then use BAPI_TRANSACTION_COMMIT.

    We used same solution to update the scheduled delivery line items in PO

    Please let me know if you need any further information

    Regards,

    Snehal Patil

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Snehal,

      Thanks for your reply...As the issue is mainly of handling the PO & GR through MB01 via IDOC, i decided to fix the same in the Inbound FM of idoc...So wrote enhancement as below : and is working fine.

      ENHANCEMENT 5 ZWE19_MARK_ELIKZ. "active version

      data l_ebeln type ekko-ebeln.

      data l_ebelp type ekpo-ebelp.

      data wa_hdr type E1MBXYH.

      data wa_itm type E1MBXYI.

      clear : wa_hdr, wa_itm, l_ebeln, l_ebelp.

      if sy-tcode = 'WE19' .

      loop at idoc_data.

      CASE idoc_data-segnam.

      WHEN 'E1MBXYH'.

      wa_hdr = idoc_data-sdata.

      WHEN 'E1MBXYI'.

      wa_itm = idoc_data-sdata.

      if wa_hdr-XBLNR is not initial and wa_hdr-tcode = 'MB01' and wa_itm-ebeln is not initial .

      select single ebeln from ekko into l_ebeln where ebeln = wa_itm-ebeln and bsart = 'ZNB'.

      if sy-subrc = 0.

      wa_itm-elikz = 'X'.

      idoc_data-sdata = wa_itm.

      modify idoc_data .

      endif.

      endif.

      ENDCASE.

      endloop.

      endif.

      ENDENHANCEMENT.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.