Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Obligatory parameters for BAPI_PO_CHANGE

Former Member
0 Kudos

Hello, which parameters are obligatory when using BAPI_PO_CHANGE?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Antish,

Only Purchase order is manadatory.

What is your requirement?

Regards,

Anil Salekar

5 REPLIES 5

former_member212005
Active Contributor
0 Kudos

PURCHASEORDER: Purchase Document Number is obligatory...

What is your actual requirement?

0 Kudos

Change company code and purchasing org.

0 Kudos

Suppose if you are updating the deletion indicator of the function module...here is the sample code for it


  DATA: lt_poitem    LIKE bapimepoitem  OCCURS 0 WITH HEADER LINE.
  DATA: lt_poitemx   LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.

* po Line
  lt_poitem-po_item    = p_ebelp.
  lt_poitem-delete_ind = p_delind.
  APPEND lt_poitem.
* po Line
  lt_poitemx-po_item    = p_ebelp.
  lt_poitemx-delete_ind = 'X'.
  APPEND lt_poitemx.

  CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
      purchaseorder                = p_ebeln
   TABLES
     return                       = return
     poitem                       = lt_poitem
     poitemx                      = lt_poitemx .

0 Kudos

You can use it in below format..



  DATA: lt_poheader  TYPE STANDARD TABLE OF BAPIMEPOHEADER.
  DATA: lt_headerx   TYPE STANDARD TABLE OF  BAPIMEPOHEADERX .

* po header
  ls_poheader-po_number      = p_ebelp.
  ls_poheader-comp_code = 'your_value'.
 ls_poheader-purch_org = 'your_value'.
  APPEND   ls_poheader to lt_poheader.



* po header x
  ls_poheaderx-po_number    = p_ebelp.
  ls_poheaderx-comp_code = 'X'.
 ls_poheaderx-purch_org = 'X'.
  APPEND  ls_poiheaderx TO lt_poheaderx.

  CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
      purchaseorder                = p_ebeln
      POHEADER                     = lt_poheader
     POHEADERX                    = lt_poheaderx
   TABLES
     return                       = return
           .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
 EXPORTING
   WAIT          = 'X'.

Try it out..

Former Member
0 Kudos

Hi Antish,

Only Purchase order is manadatory.

What is your requirement?

Regards,

Anil Salekar