cancel
Showing results for 
Search instead for 
Did you mean: 

Increment the Value on the Target side

Former Member
0 Kudos

Hi

I am working on Proxy to SOAP Scenario in PI 7.1 and I have an unbounded structure on the sender side (Business Partner) which I will be receiving multiple records at a time and have the Unbounded Structure on the receiver side which I have mapped directly.

Here is the issue

Based on the no of Records on the Sender side I need to increment the value and assign it to Data element which is on the receiver side

For Instance

If have Business Partners as 4 on the sender side, I need to assign as ClaimsParty-001, ClaimsParty-002, ClaimsParty-003 and ClaimsParty-004 to one the data eleement on the receiver side, i.e Incrementing the value on the receiver side,

Experts Please let me know how can I do this

Thanks

PR

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks

former_member200962
Active Contributor
0 Kudos

how did you managed to solve the problem??

Former Member
0 Kudos

You can add variable in your MM and achieve this.

Have a look at the following blog.

/people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable

Instead of Count() use index or counter. This feature is available from 7.1

keep us updated

Venkat.

Edited by: Venkat Anusuri on Jun 13, 2009 12:42 AM

Former Member
0 Kudos

Hi,

Map like below..

constant(00)--------------------------concat---ClaimsParty
  Business Partners--index(1,1,context)---

Regards,

Prakasu.M

former_member200962
Active Contributor
0 Kudos
If have Business Partners as 4 on the sender side, I need to assign as ClaimsParty-001, 
ClaimsParty-002, ClaimsParty-003 and ClaimsParty-004 to one the data eleement on the receiver side, 
i.e Incrementing the value on the receiver side,

Even i am having the same requirement and I am able to achieve 001, 002, 003 etc using a Index Function ...do not opt for Count / Counter ....they fail when you have a Context change....

However there is a catch here once the count becomes 009 the next number in sequence will be 0010....so you need to take precaution to make the number as 010.....

Regards,

Abhishek.

Former Member
0 Kudos

Abhishek

Please let me how can I use the Index Function

Thanks

PR

former_member200962
Active Contributor
0 Kudos
Please let me how can I use the Index Function

Proceed as below:

Source ---> Index
                           ---------->less(arithmetic) ----> IfWithElse
                Constant(10)

Input for Then part of the above IfWithElse:

Constant(00)
                     ---------->Concat ------>Then
Source ----> Index

Input for the Else part of the above IfWithElse (executed when count becomes more than 9):

Constant(0)
                     -----> Concat ----> Else
Source----> Index

Index function should be:

Initial, Increment value = 1

Reset Index ---> Set to Do not Reset Index to Initial Value.

Check it and let me know for an issue

Regards,

Abhishek.

Former Member
0 Kudos

Abhishek

I mapped as per your reply however node is not creating at the runtime

Thanks

PR

former_member200962
Active Contributor
0 Kudos
I mapped as per your reply however node is not creating at the runtime

If you are using 7.0 then use the logic as mentioned in the WIKI attachment given below:

SDN ---> WIKI -


> SAP NetWeaver ---> Process Integration ---> Attachments ---> Search attachment with Comment as IndexLogic to see how the mapping is to be done (Index Function settings mentioned in same diagram) and also check attachment with comment as IndexTest to see what result i get after applying the logic....

I have successfully tested the result upto 12 nodes....please check and let me know....same logic has to be applied for PI7.1....the only thing that differs is the setting of Index Function....

Regards,

Abhishek.

Former Member
0 Kudos

You can do this using a UDF.

use count - Statistics function to get the record count on the source & based on this value, add appripraite number of values to the Queue of the Target data element.

for(int i=1;i<=count; i++){

result.addValue("ClaimsParty-"+i)

}

You might also need to add context changes as per the target structure.

-SM