‎2009 Jul 29 5:25 PM
Hi experts,
I am developing a program whereby I have to create GR from PO and post these documents. I have been able to use the BAPI_GOODSMVT_CREATE to create the GR. However I am facing an issue. After the BAPI_GOODSMVT_CREATE, I call the FM - BAPI_TRANSACTION_COMMIT to commit the BAPI, but it isn't working.
The bapi is only creating the GR and it isn't posting it. also, I have tried to use COMMIT WORK AND WAIT statement, but this too is not really posting the document. The only solution I have been able to find is to use WAIT UP TO 10 SECONDS. In terms of performance tough, this isn't the best solution.
I was wondering if anyone knows how I can force the commit to the BAPI or if there is another alternative to create and post GR from PO.
Thanks for your precious help.
Shabir
‎2009 Jul 29 8:17 PM
Hi,
try this way..Hope this will work and worked for us..
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = t_goodsmvt_header
goodsmvt_code = t_goodsmvt_code
IMPORTING
goodsmvt_headret = w_docret
materialdocument = w_docno
TABLES
goodsmvt_item = t_goodsmvt_item
goodsmvt_serialnumber = t_goodsmvt_slno
return = t_goodsmvt_ret.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'W'
IMPORTING
return = wa_return2.
Prabhudas
‎2009 Jul 30 7:50 AM
‎2009 Jul 30 7:56 AM
HI
Could you please tell us what message u get in return table.
Thanks & regards,
ShreeMohan