11-21-2007 12:16 PM
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.
11-21-2007 6:05 PM
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