cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical mapping, mapping an occurrence from a source field

pi_consultant1
Participant
0 Kudos

Dear friends,

I started this discussion: http://scn.sap.com/message/13698710 but I still have a question, I hope to get an answer here:

My requirement is like this:

I have to pass the second occurrence of a source field and if that field is not present I have to pass another field, beside that I have to pass the value of the second field without the text IBAN...

I have the below mapping and I got almost the result I wanted but Im not there yet, if the field on the second occurrence doesnt exist it passes the value of another field but if the field on the second occurrence is present it doesn't pass the second occurrence but the first one...

Could you help me on this issue?

Kind regards,

John

Accepted Solutions (1)

Accepted Solutions (1)

gagandeep_batra
Active Contributor
0 Kudos

You can try following also....

Regards

Gagan

pi_consultant1
Participant
0 Kudos

Hi Gagandeep,

Thank you for your quick replies

If I see your second solution the result of your mapping is different than my requirements. The result in my case must be First, Second, Third and not First, One, Third...

I tried also the mapping you suggested and I get a result that doesnt solve my problem...

Regards, John

gagandeep_batra
Active Contributor
0 Kudos

Hi,

i am not understand why you require "First, Second, Third"..........

because you said that if 2 occurrence is present then you want to replace the value "BAN" as i give input of 2nd occurance is "BANONE" hence it give output only "ONE"

if you want "First, Second, Third" in a row the i can directly pass it............:)

But in you case i think there is problem with context...........

you have to check with display queue to debug also........

Regards

GAgan

gagandeep_batra
Active Contributor
0 Kudos

and one more thing did you check follwoing also?

pi_consultant1
Participant
0 Kudos

Hi Gagandeep,

As I said in my first post, my requirements is to pass the second occurrence so in my case I have to pass the values 12, 32 and 52...

But I get in the target field the values of the first occurrence: 0007911165, 0413239454 and 0431685258

Other values are correct because the second occurrence isn't present so I pass the value of another field...

Former Member
0 Kudos

HI PI Consultant,

Try this....the '2nd field' here is the other source field you have to map if the 2nd occurrence is not present

Hope this is what is you are looking for...

pi_consultant1
Participant
0 Kudos

Hi Sagarika,

That was the SOLUTION. Thank you very much!

Can I ask you to help me with this mapping as well?

If the second occurrence contains the word MAN (the source field contains more characters than only the word MAN like: MAN-1234 or MAN:1234) than use M otherwise F

I really appreciate it,

Thank you again,

Kind regards,

John

Former Member
0 Kudos

Hi PI consultant,

you need to write a udf to check the existence of 'MAD'

try this,

Let me know if you need any further changes

-sagarika

pi_consultant1
Participant
0 Kudos

Thank you again for the solution of this problem

Answers (1)

Answers (1)

gagandeep_batra
Active Contributor
0 Kudos

Hi Pi,

Your condition at OR function is wrong means it always  give true for you condition because you have added "mapwithdefault" at the start of index function.

remove the "mapwithdefault" in first parameter  "OR" expression and try..........

Regards

Gagan

pi_consultant1
Participant
0 Kudos

Hi Gagandeep,

Unfortunately it doesn't work as you suggested...