Application Development 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: 

Issue in posting multiple goods movement using BAPI_GOODSMVT_CREATE

former_member505773
Active Participant
0 Kudos

Hi All,

i'm currently facing an issue whereby the BAPI_GOODSMVT_CREATE throwing me error M7-021 When i try to post 907Q after 321Q and 415Q.

The weird thing here is, i cant post 907Q in the 1st run of BAPI_GOODSMVT_CREATE, but when i re-run the BAPI_GOODSMVT_CREATE in debug mode (2nd time), it allow me to post 907Q successfully.

Scenario (i'm running wedynpro in debug mode) :

1 - post 321Q - success

2 - post 415Q - success

3 - post 907Q - failed for the 1st time by showing error M7-021. Then i rerun BAPI_GOODSMVT_CREATE and it allow me to post.

I'm calling BAPI_TRANSACTION_COMMIT after each BAPI_GOODSMVT_CREATE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

     EXPORTING

       wait = 'X'.

Does anyone here having similiar issue?

Thanks in advance for all d help.

Regards,

Sham.

4 REPLIES 4

Former Member
0 Kudos

Hi

After posting 415Q and BAPI_TRANSACTION_COMMIT


check the Doc no. in mseg by getting above doc no and if sy-subrc eq 0.


wait for 5 seconds


and then post post 907Q .


Hope this helps.


Regards

Suganya


0 Kudos

Hi Suganya,

thanks for the suggestion.

i've done that but it still giving me same error for the 1st time.

SELECT COUNT(*) FROM MSEG WHERE mblnr = 415_matdoc.

     IF sy-subrc = 0.

     ELSE.

       WAIT UP TO 5 SECONDS.

     ENDIF.

Regards,

Sham.

former_member185587
Participant
0 Kudos

Hi Sham,

As Suganya rightly mentioned the cause might be because of the preceeding data missing for the subsequent process. Hence either enable the WAIT parameter in the function module BAPI_TRANSACTION_COMMIT or use COMMIT WORK AND WAIT statement after posting 415Q.

Regards,

Kiran

0 Kudos

Hi Kiran,

i'm currently using BAPI_TRANSACTION_COMMIT with wait = 'X' after each of the posting.


i've no problem for below posting

post 321Q then post 415Q.


But once after 415Q, then issue happened on posting 907Q.

I also tried to release the buffer and hu after 415Q, but it still giving me same error for 907Q posting in the 1st time.



Regards,

Sham.