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

Question of commit work

Former Member
0 Likes
929

This is my program.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

.

.

.

commit work.

.

.

.

CALL TRANSACTION 'KKF2' USING bdcdata MODE 'E' UPDATE 'S'

MESSAGES INTO MESSTAB.

The BAPI and tcode KKF2 will use the same ORDER_ID to do some jobs...but when the program run to the tcode KKF2...It said "*****(me) is modifying ******(ORDER_ID) now"

Why it still said that when I have used commit work?

Even I add:

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

and

CALL FUNCTION 'ENQUE_SLEEP'

The program still said I am modifying the ORDER_ID....

Please help me,thanks .

6 REPLIES 6
Read only

dev_parbutteea
Active Contributor
0 Likes
853

Hi,

use commit like this:

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

importing

wait = 'X'.

Regards,

Sooness

Read only

0 Likes
853

sorry, i meant :

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

exporting

wait = 'X'.

Regards,

Sooness

Read only

0 Likes
853

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' still does not make it work....

I have add all the commit code I know...

Is this error is called with the reason that my bapi is return the error message to the program?For some reason my BAPI can't run right,so it will return the error message.Is the error message returned by bapi call the fail of commit work?

Read only

former_member404244
Active Contributor
0 Likes
853

Hi,

instead of going for MODE 'E' go for MODE 'N' and also check the return structure of the bapi function module..If u have any error messages.When u go for error mode it will stop at that screen where there is error.

Regards,

nagaraj

Read only

former_member404244
Active Contributor
0 Likes
853

Hi,

absolutely if u r getting error message then it won't be committed..plz chek the error message and pass the data correctly.....

Regards,

nagaraj

Read only

Former Member
0 Likes
853

use this code for bapi commit.

use your internal table and field to check wether the database is updated or not ??

SY-SUBRC = 4.

WHILE SY-SUBRC <> 0.

<b> SELECT SINGLE * FROM ADRC WHERE ADDRNUMBER = IT_ADATA-</b> IF SY-SUBRC <> 0.

WAIT UP TO 1 SECONDS .

ENDIF.

ENDWHILE.