Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with BAPI_GOODSMVT_CREATE

Former Member
0 Likes
873

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

3 REPLIES 3
Read only

Former Member
0 Likes
646

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

Read only

Former Member
Read only

Former Member
0 Likes
646

HI

Could you please tell us what message u get in return table.

Thanks & regards,

ShreeMohan