Skip to Content

SAP CP-IS [ SAP HCI ] Looping Process Call in detail

Introduction:

You might have come across the scenario where you want to set the retry for SOAP adapter or you want to loop some set of steps till some condition is met,so here is the solution for that is  “Looping Process Call”.

More about Looping Process Call:

If you are having programming language experience ( at least basics ) its very easy to correlate with concept of While(Condition) {  perform some action } loop.

while ( condition )
{

 Process Steps in Local Integration Process

}

Instead of some code here we have Location Integration Sub Process .The sub process will run as long as the loop condition is fulfilled.

Looping Process Call can be added to Integration Process by pulling Process Call step from Palette and then selecting Switch to Looping Process.

Lets take few scenarios where we can leverage above steps

Scenario 1: 

Process the Compound Employee Data in batches using Looping Process.

1.Timer Event: To schedule the interface deployment.

2.Content Modifier: To have some data and some headers.

3.Looping Process Call: Call the Local Integration Process till Condition specified is true.

<1> Name of the Local Integration Process that needs to be called.

<2> Expression Type [ XML based or non XML based (Header Property )]

<3> SAP defined property which will tell whether Query has more records or not.

         Format: ${property.SAP_SuccessFactorsHasMoreRecords.<RECEIVER_SYS_NAME>.

                                      <RECEIVER_CHANNEL_NAME>}

<4>Max No of iterations to be mentioned to avoid infinite loops.

4.External Call: Call to SuccessFactors systems which will give Receiver System Name                                                 and Channel Name.

5. Message Mapping: Message Mapping to convert from Compound Employee Structure to                                                    Custom Structure.

6. Converter: To convert from XML to CSV format.

7. Channel: SFTP Channel to send the converted data to SFTP server.

Advantage of using Looping Process in above Scenario:

If you take an example of SuccessFactors system having employee data more 25 to 30K ,post your query step if converter and message mapping will receive all data together causing heap memory issue.If you use Looping process data will be sent to mapping and further step chunk by chunk( based on Page size mentioned in SF Channel ) without  putting complete load of data into Mapping Step and converter in one shot.

Scenario 2:

To set the manual retry in SOAP channel.

<1> Expression Type: Set the Expression Type as XML

<2> Condition Expression: Enter the condition till the condition becomes false.In our case                       local integration process to be called whenever we receive the Error Response from                           SOAP call inside the Local Integration process.

<3>Max No of iterations: Enter value for how many times call to be retried in the case of                           SOAP call failure.In our case we need to set the retry value of 5 times in case of SOAP                       call failure to target system.

Scenario 3:

Scenario where you have a  Adhoc Report scheduled in SuccessFactors using SAP HCI and you need to pull the data only after the Job is finished and you need to loop the process till JobStatus is running.

<1> Condition Expression: Local Integration Process Call will be looped till jobstatus is                                  running.

Conclusion:

Very useful step to handle requirements where we need to perform some task in looping manner.

References:

[1] Looping Process:

SAP HELP- Looping Process Call

Regards,

Sriprasad Shivaram Bhat

21 Comments
You must be Logged on to comment or reply to a post.
  • Hi Sriprasad,

    Great blog as always! So in your example, the data from SF will be sent to the SFTP server for every iteration until ${property.SAP_SuccessFactorsHasMoreRecords} is false, right?

      • Hello Sripradad,

        Does it mean it will only send to the SFTP once? Will the messages from SF in the local integration process aggregate until it’s false?

      • Hi Sriprasad,

         

        I am trying the scenario 1 you explained. In my SF channel I am using page option to pull 5 records at time and looping count i have given as 2 in the looping process call but only the 5 records are passed to next step (guess the 5 records from 2nd loop ).  Its not accumulating to 10 records  then passing to next step. is this expected? do I have to use a gather step after Loop process call? Could you please help me out

         

        Regards,

        Balaji

  • A very well articulated and explained usage of Looping process, will be helpful for anyone to gain further perspective in the functionalities offered by SAP. Thanks Sri for the wonderful blog.

  • This blog is valid for SuccessFactor OData and Generic OData but the format of the property defined in Looping Integration Process is:

    ${property.<ReceiverName>.<ChannelName>.hasMoreRecords} contains ‘true’

      • Can I use looping process call when an error message is returned? How can I form a condition expression with that? Currently what I’m doing is this: /error[code = ‘COE_ENTITY_NOT_FOUND’]. It does not loop when this is the returned message.

  • Hi Sri, i have an xml file which has multiple records. I need to call a REST service for each record. How could I achieve it using Looping Process.

    I am recieving the xml file from an external source via HTTPS Post.

    Thanks in advance

    Athar

  • Hi Sriprasad,

    I have a requirement where i want to join all the message obtained in batch processing, say after my interface specific mapping. Since all the messages in batches are coming one by one, how to combine/join them together?

  • Hi Sriprasad Shivaram Bhat ,

    Thanks for the wonderful Blog!!

    Could you confirm if we need to collate all the data and process together.

    Since we need to post the collated data into SFTP server as a Single file.

    Is it possible to gather and send it across . Pls confirm?

    Since in case of any issues during ‘n’th iteration only partial data been sent to Target system.

    ASHUTOSH KUMAR  Mark Bernabe   – Could you share your inputs too?

    Best Regards,
    Suresh S