06-15-2017 5:03 AM
Hello All,
For some Process i have to auto create Sale Order(SO) Delivery (DEL) PGI (pgi) and Invoice(INV) through some program.
In both above cases i have checked SM12 and also i did LOGOUT and Login again but this didnot help. Also if the same delivery no(which is currently being processed), i put in VF01 manually and SAVE, it gets created. It didnot give any error message while doing it manually.
Please give some advice. Rewards will be given.
Below are the BAPIS being used:
So -> BAPI_SALESDOCU_CREATEFROMDATA
DEL -> BAPI_OUTB_DELIVERY_CREATE_SLS
PGI -> WS_DELIVERY_UPDATE (with serial nos)
INV -> BAPI_BILLINGDOC_CREATEMULTIPLE
06-15-2017 1:01 PM
did you tried wait condition at each step, to let the system do that work..
Thanks
Anand
06-15-2017 9:10 PM
Some saving is done in background and is still active by the time your next BAPI is called. When doing it manually you're not quite as fast as the computer, and therefore it works because the update is complete by the time you push the next button.
Use BAPI_TRANSACTION_COMMIT with the WAIT flag set after each BAPI, and do a COMMIT WORK AND WAIT after the non-BAPI function module WS_DELIVERY_UPDATE.