Skip to Content
0

Can we add a delay before triggering a IDOC in PI 7.4 dual Stack ?

Aug 16, 2017 at 09:14 AM

77

avatar image

Here we have a scenario where PI is getting one XML and PI have to split it into 2 Idocs(MBGMCR & ORDERS05).

The requirement is MBGMCR should reach ECC first and then ORDERS. Basically Inventory(MBGMCR) should be posted first and then for the same inventory Order(ORDERS05) should be generated.

We have configured ICO for this and check box of maintaining order at runtime is checked.

So by this MBGMCR is getting posted in ECC first and then ORDERS05 is posted, but the time difference between MBGMCR and ORDERS is in milliseconds. Now as enhancement is used for MBGMCR, it is taking some time to process and before MBGMCR is processed ORDERS05 is arriving and getting processed.

So because of this ORDERS05 is failing in ECC as the system doesn't have Inventory generated yet for that Order.

So I wanted to add some delay before triggering ORDERS05 so that ECC gets some time to process MBGMCR. Is there any way where we by which we can solve this?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Manoj K Aug 16, 2017 at 09:25 AM
0

Hi Dhariya,

I believe you have configured 2 OM one to generate MBGMCR and one for ORDERS05

so if you want the OM of ORDERS05 to wait for certain time then you can add sleep via UDF in that mapping just add this to root node.

public String timeDelay(String var1, Container container) throws StreamTransformationException{
{try
{ Thread.sleep(30000);//Millisec}
catch (InterruptedException ie)
{}
return var1;
}}

Br,

Manoj

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Manoj,

Thanks a lot. I used this UDF and now we are getting results as expected.

Thank you for your ans.

Regards,

Dhairya.

0
Former Member

I would like to point out that while this will work in most cases, the method is not fail safe, i.e. it will not guarantee that your IDocs will be processed in the right sequence. You'll have to look into serialization or build a custom check in the inbound process for your order IDoc if you want to be certain.

1

The only case of failure is if for some reason i.e mapping or connection the "ORDERS" IDOC would not be posted but the next trigger of the file which needs "MBGMCR" and one for "ORDERS05" will be posted . Then later if you resend the failed one ORDERS this will be posted but however i wont see any issue here because the pair of posting MBGMCR and ORDERS05 will contribute to inventory generation . so as far as MBGMCR is posted first and then respective ORDERS05 which is already handled by "Maintain order at run time " there wont be any issue.

0