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 about executing standard Function Module

Former Member
0 Likes
665

Hi all,

I'm having a problem with executing a function module. The FM is CO_RI_CONFIRMATION_CREATE which is used for order confirmation create. I'm using OO in my program and the call to this FM is being written in a method.

My requirement is I need to confirm 3 orders consequtively, so what I did is I called this method (which contain my FM) 3 consequtive time. The problem is when I execute my program, the first order will always be successfully confirmed, and the 2nd order will always fail. However when I keep repeating it, it will then eventually success.

The funny thing is, when I try to debug and step in to the code and execute it line by line, all 3 orders are successfully confirmed.

Why is the 2nd order fails to confirm when the program is being executed normally? I looks like the first process of confirming the order is not actually completed at the background. I did try to include COMMIT WORK AND WAIT, but still it's not working.

Any kind of help is very much appreciated.

5 REPLIES 5
Read only

Former Member
0 Likes
603

Hi,

after update insert the following code

CALL FUNCTION 'RZL_SLEEP'.

this will work fine

Read only

Former Member
0 Likes
603

Hi Mil,

do you try to set the paramater: WAIT_ON_COMMIT of this FM?

Regards, Dieter

Read only

0 Likes
603

Hi Deiter,

Yes, your idea works! I didn't even noticed that there's such parameter for this FM. By the way, I even try BAPI_TRANSACTION_COMMIT with WAIT = X and it still didn't work. Funny.

Read only

0 Likes
603

Hi Mil,

good that it works.

What about rewards points to them they help you.

Regards, Dieter

Read only

Former Member
0 Likes
603

use BAPI_TRANSACTION_COMMIT AND GIVE wait parameter as 'X'.

u'r problem will definitely be solved.

don't forget to reward

Sameer