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: 

URGENT: About FM BAPI_PO_CHANGE in subcontacting PO

Former Member
0 Kudos

Hi, Experts,

Following code retrun sy-subrc = 0 , but quantity was not changed in subcontracting PO item's component, what is the reason ?

lt_pocomponents LIKE bapimepocomponent OCCURS 0 WITH HEADER LINE,

lt_pocomponentsx LIKE bapimepocomponentx OCCURS 0 WITH HEADER LINE,

lt_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

lt_pocomponents-po_item = '10'.

lt_pocomponents-sched_line = '1'.

lt_pocomponents-material = 'ZC333'.

lt_pocomponents-entry_quantity = 13.

lt_pocomponents-change_id = 'U'.

APPEND lt_pocomponents.

lt_pocomponentsx-po_item = '10'.

lt_pocomponentsx-sched_line = '1'.

lt_pocomponentsx-material = 'X'.

lt_pocomponentsx-entry_quantity = 'X'.

lt_pocomponentsx-change_id = 'X'.

APPEND lt_pocomponentsx.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = '6501001992'

TABLES

return = lt_return

pocomponents = lt_pocomponents

pocomponentsx = lt_pocomponentsx.

IF sy-subrc = 0 .

COMMIT WORK.

ELSE.

ROLLBACK WORK.

ENDIF.

1 REPLY 1

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Jimin!

The return code is nearly all the time equal 0 - the relevant information will be in lt_return. There all messages of the transaction will be gathered. Have a look, if you don't get it running, come back with the messages.

Regards,

Christian