cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping in SAP PI

Former Member
0 Kudos


Hi Experts,

I have recently started to work on SAP PI. So I'm relatively new to sap pi. I have to design a mapping. The condition is as follows

X is the  field in source structure------>  If ‘N’ then taregt field(Y) = ‘A’ else Target field(Y) = ‘B’  also note that X field is not always be populated .

How can I accomplish this? Please help.

Thanks

Regards,

Ravi

Accepted Solutions (0)

Answers (9)

Answers (9)

Former Member
0 Kudos

Hi Ravi,

You can use boolean function. And you can assign default value for e.g. Some pattern "@" so you can check value and assign to 'X' and 'Y' and if default pattern matches then clear it and assign to respective Target field.

Regards,

Gaurav Patwari

Former Member
0 Kudos

hello ravi,

 

input--->mapwithdefault

than compare with N and pass  this value to if else.

If true then A

else B

Former Member
0 Kudos

Hi Ravi,

As above said you can easily handle your situation using fix values/if else fns ,but the point you need to make sure is how to handle when input field value is not populated(xml tag with no value in it ,without xml tag).

Ask for the below cases when the input field value not populated.

1)Do I need to take any default value when no input value comes?

2)Do I need to ignore the case where no input value comes ?

Based on the answer to above questions you can easily fulfill your req using graphical fns.

Regards

Venkat

monikandan_p
Active Participant
0 Kudos

Hi ,

       In my point of you it will work when the source field is mandatory,

Best Regards,

Monikandan

former_member184681
Active Contributor
0 Kudos

Hi,

Since your source field might be missing, go for the following mapping:

source -> fixValues( N -> A, if key not found then use default, default = B ) -> target

This already covers all the possible cases (source = N then target = A, source <> N then target = B, source doesn't exist then target = B).

Regards,

Greg

Muniyappan
Active Contributor
0 Kudos

Hi Grzegorz Glowacki,

I guess this is going to work when the target field is mandatory.

Regards,

Muniyappan.

former_member184681
Active Contributor
0 Kudos

You might be right, I'm not able to check it out in the system at the moment. But if so, you can always use mapWithDefault before FixValues.

Regards,

Greg

Muniyappan
Active Contributor
0 Kudos

Hi,

Hope this is what you are expecting.

Regards,

Muniyappan.

monikandan_p
Active Participant
0 Kudos

Hi Ravi,

  

Best Regards,

Monikandan

iaki_vila
Active Contributor
0 Kudos

Hi Ravi,

You can use the standard boolean function  if. (Standard Functions - Enterprise Services Repository - SAP Library). If X is not populated, do you want to execute the mapping as well?

Regards.

Muniyappan
Active Contributor
0 Kudos

Hi Ravi,

Use map with default function to populated some values. use this after x field.

if not working can you paste here your mapping and input and output structure?

Regards,

Muniyappan.