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

Using COMMIT WORK with CALL TRANSACTION in a batch input.

Former Member
0 Likes
1,652

Hi Everybody

I'm doing a Batch Input of transaction ME21 to upload purchasing orders from a legacy system. I'm using the CALL TRANSACTION variant with MODE 'P' to avoid create a batch input session.

The Batch Input works fine and all the records are created. The problem is that I execute some code after the Batch Input processing to update some of the PO items that transaction ME21 leaves incomplete. If I execute the program in debugging mode the PO are created properly and the code I execute later update all the records correctly. But if I execute the program without the debugging, the code after the batch input does NOT update the PO records.

I added the COMMIT WORK AND WAIT after every modify command of the code but still nothing. I really don't have any idea why is this happening.

Can anyone help me with this?

Thanks

Orlando

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
646

Hi,

Instead of mode P use mode N and use UPDATE A.

Call Transaction 'ME21' mode 'n' update 'a'.

Regards,

Amit

3 REPLIES 3
Read only

amit_khare
Active Contributor
0 Likes
647

Hi,

Instead of mode P use mode N and use UPDATE A.

Call Transaction 'ME21' mode 'n' update 'a'.

Regards,

Amit

Read only

0 Likes
646

Amit I changed the code as you told me to:

      CALL TRANSACTION 'ME21'  USING BDCTAB
                    MODE   'N'
                    UPDATE 'A'
                    MESSAGES INTO MESSTAB.
 

but still does not update the records after the batch input.

Thanks,

Orlando

Read only

0 Likes
646

Hello Orlando

Please refer to the ABAP documentation for "CALL TRANSACTION":

CALL TRANSACTION 'ME21'  USING BDCTAB
                    MODE   'N'
                    UPDATE 'A'  " asynchronous !!!
                    MESSAGES INTO MESSTAB.

CALL TRANSACTION 'ME21'  USING BDCTAB
                    MODE   'N'
                    UPDATE 'S'  " synchronous -> like COMMIT WORK AND WAIT
                    MESSAGES INTO MESSTAB.

Regards

Uwe