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

COMMIT WORK

Former Member
0 Likes
921

Hi all,

I have a dialog program which uses a BDC.

This batch input calls another code which contains a BDC.

At the end I check the subrc and if it is 0 I do COMMIT WORK AND WAIT.

The problem is that after the COMMIT the session end and returns to the calling BDC but part of the code was after the COMMIT was skipped.

How can I overcome this?

Hagit

9 REPLIES 9
Read only

vinod_vemuru2
Active Contributor
0 Likes
876

Hi,

Instead of explicit options pass ctu_params.

wa_ctuparams-dismode = 'N'
wa_ctuparams-updmode = 'S'
wa_ctuparams-rawcommit = 'X'   "Important. This allows the called transaction to continue even after the commit.
"Check F1 help on this.

CALL TRANSACTION ...
USING i_bdcdata
OPTIONS FROM wa_ctuparams.

Thanks,

Vinod.

Read only

0 Likes
876

Hi Vinod,

Thanks, this works.

But what do I do when I use BAPI?

Is there a solution for this too?

Thanks,

Hagit

Read only

0 Likes
876

Hi,

Are you using Z-BAPI? 99% of the standard BAPIs doesn't have the implicit COMMIT for this reason. By the way what is the BAPI you are using?

In case of Z-bapi, don't COMMIT in BAPI. Call the COMMIT outside BAPI.

Thanks,

Vinod.

Read only

0 Likes
876

Hi,

I'm using BAPI_GOODSMVT_CREATE.

After the BAPI I wrote The COMMIT but I need to perform another batch input which is not executed due to this command.

Hagit

Read only

0 Likes
876

Hi again,

any ideas?

I tried to remove the COMMIT command after the BAPI but the created documents are not save in the DB and I cannot continue to the next transaction.

Hagit

Read only

0 Likes
876

Hi

Try to use FM BAPI_TRANSACTION_COMMIT after your BAPI.

Also be sure that no 'X' in TESTRUN field when you call BAPI.

Also ,in return,what do you recieve?

Best Regards

Yossi Rozenberg

Read only

0 Likes
876

Hi Yossi,

I already tried to use this FM but got the same results.

Immediately after the COMMIT the program returns to the calling BDC.

Thanks,

Hagit

Read only

0 Likes
876

Hi,

Passing RAWCOMMIT = 'X' hold good even in this case also. Are you facing any issue with this solution? If yes, please explain the problem in detail.

Thanks,

Vinod.

Read only

0 Likes
876

HI,

what do I do when I use BAPI?

Can you make it clear .