Skip to Content
0
Aug 12, 2015 at 03:02 PM

BAPI_PO_CHANGE - add serial

152 Views

Hello!

I'm trying to add a serial number to position in order.

Using BAPI_PO_CHANGE.

(Order is created and has single position without serial number. Component structure has 1 line with batch filled)

I'm filling mt_serialnumber from a scratch:

<fs_serialnumber>-po_item = '00010'.

<fs_serialnumber>-sched_line = '1'.

<fs_serialnumber>-serialno = '919191'.

<fs_serialnumberx>-po_item = '00010'.

<fs_serialnumberx>-sched_line = '1'.

<fs_serialnumberx>-po_itemx = 'X'.

<fs_serialnumberx>-sched_linex = 'X'.

<fs_serialnumberx>-serialno = 'X'.


I get mt_item, mt_comp structures from FM BAPI_GETDETAILS1.

+ add some new data:

<fs_itemx>-po_itemx = 'X'.

<fs_comp>-batch = 'P0000010'. "new batch according serial

<fs_compx>-batch = 'X'.

and starting BAPI:

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = mv_ebeln

poheader = ms_header

poheaderx = ms_headerx

TABLES

return = lt_return

poitem = mt_item

poitemx = mt_itemx

pocomponents = mt_comp

pocomponentsx = mt_compx

serialnumber = mt_serialnumber

serialnumberx = mt_serialnumberx.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.


But no update 😔

lt_return has no errors (S and couple minor W)


Maybe I only able to CHANGE data with this BAPI, not adding new lines? Hm.

Any clues?


Best regards,

Maxim.