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

LOIPRO triggered twice on COR2 save

tabraiz_khan
Participant
0 Kudos
1,220

Hi,

I am trying to trigger the IDOC LOIPRO whenever the user creates(COR1) a process order or changes certain fields(COR2) in a process order.

I was using exit EXIT_SAPLCOZV_001 for this purpose until now. But I started noticing, whenever I change a value through COR2, for example, total quantity, two IDOCs are triggered - usually one with the old quantity value and the second with the new quantity.

I tried using the BADI WORKORDER_UPDATE as suggested in the below link:

http://scn.sap.com/message/8574200

It still seems to be triggering it twice. I tried adding a delay to wait until the update happens, that doesn't work either.

I am submitting to program RCCLORD and returning in the above cases. Is there any way to just get one IDOC triggered everytime I make a change and save through COR2? Will calling CLOI_MASTERIDOC_CREATE_LOIPRO directly help solve the issue? Has anyone come across this issue before?

Any help would be much appreciated.

Thanks in advance,

Tabraiz.

5 REPLIES 5
Read only

tabraiz_khan
Participant
0 Kudos
963

Any ideas anyone?

Read only

0 Kudos
963

You can Try:

1. Create 1 FM which will have import paramters required for your SUBMIT.

2. In that FM submit to RCCLORD.

3. Call this FM in Background Task in BADI WORKORDER_UPDATE.

So your FM should get executed when V1 updates are finished.

Regards

Vinit

Read only

0 Kudos
963

Hi,

Thanks for the reply. My earlier solution and the above too seemed to work. The problem is solved.

Thanks,

Tabraiz

Read only

0 Kudos
963

Tabraiz,

what solution you used finally ?

is it triggering two idocs or 1 idoc ?

did you use BADI : WORKORDER_UPDATE and submitting program:  RCCLORD to trigger outbound idoc LOIPRO ?

Appreciate your earliest reply.

Thanks,

Mahesh

Read only

0 Kudos
963

Hi Mate,

The solution to call it in IN_UPDATE did work. It is called in update task and was the appropriate place to submit to RCCLORD. It was triggering two IDOCs for a different reason which is valid too. If you're creating LOIPRO at process order save, u can use this solution.

Tabraiz.