08-12-2015 4:02 PM
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.
08-13-2015 5:43 PM
Hi Maxim,
BAPI have those restrictions:
With this function module, it is not possible to:
Regards,
08-13-2015 5:43 PM
Hi Maxim,
BAPI have those restrictions:
With this function module, it is not possible to:
Regards,
08-14-2015 8:22 AM
Thx, David.
I've solved the problem by deleting component (change_id = 'D') in 1st iteration and re-creating comp + serial in 2nd.
Maybe it checks new serial with old batch? ))
And stops performimg as they dont match each other.
Anyway, now its works