Skip to Content

In one of my projects, I had a requirement in which IDOCs are to be sent to external 3rd party application, via SAP PI. This external 3rd party application is a cloud system in which these IDOCs are received through a web service. Two IDOCs are to be sent at the same time, but we want the second IDOC to arrive 30seconds after the first one. The option is for PI to delay the second message for 30seconds before proecessing it. Before this time, the wait step in ccBPM would have been an option.

However, as part of the architectural landscape that accommodates java only scenarios, the use of ccBPM is being phased out in integration scenarios, since ccBPM is not available in Java Only installations. Finding alternatives on how to delay message processing in SAP PI is the focus of this write-up. This piece explains how to delay a message in PI during the implementation of graphical message mapping. The steps required are described below;

     1) Create a UDF: The UDF to be created has a single input with a java method show in the screen below; the time delay as shown below is 30,000 (30,000milliseconds=30seconds) and the java method to catch any exception. You can set your own time delay duration for the message in your UDF.

/wp-content/uploads/2013/05/image002_211609.jpg

     2) Use the UDF in the mapping: To use the UDF in the mapping, it should be mapped to the top most element in the root node of the target message in the message mapping. This is shown below;

timedelay blog.jpg

With the mapping and the use of the UDF in the screenshot above, the message will be delayed for 30seconds before it is mapped and passed to the target node, while the first message would have been delivered and processed in the target system before the arrival of the second message.

To report this post you need to login first.

9 Comments

You must be Logged on to comment or reply to a post.

    1. Abidemi Olatunbosun Post author

      Hi Sarada,

      As you can see, the UDF has just only one input, that will be the topmost element of the rootnode from the source message. You can define a dummy input for this, just as what you could see in the blog (string a).

      Regards,

      Abidemi

      (0) 
  1. Sarada Singaraju

    Hi Abidemi,

    My requirement is to post  two idocs to ECC with the delay time of 60 Sec in between them, but with this logic applied too, both the idocs are posting in ECC at same time.

    Thanks

    Sarada

    (0) 
  2. Daniel Graversen

    Hi 

    Nice idea.

    I was considering to do something like the same. A issue you could end up with it that all your mapping treads will be used. So you would have a few mappings that are in waiting mode for 30 seconds.

    Daniel

    (0) 
  3. Madhurima Chinni

    Hi Abidemi

    As the delay is at the mapping level, the delay happens for every request.Please let me know how you managed to post the second Idoc after 30sec of time of first Idoc. Even I had the same challenge and looking for the solution.

    Thanks in Advance

    Madhurima

    (0) 
  4. P R

    Hi Abidemi,

    like this only i’m also facing one problem..it is,

    i’m getting one binari file and one IDOC file,first i need to process binary and have to wait for 2 or 3 seconds and thenhave to process IDOC, and finally i need to get one file only in the target system.

    can u suggest the best way?

    (0) 

Leave a Reply