cancel
Showing results for 
Search instead for 
Did you mean: 

Reading comma separated values in Value Mapping

sherin_jose4
Participant
0 Kudos

Hi everyone,

I have a small requirement using value mapping.

My source value should be in comma separated values and the corresponding target values also will be in the same format like shown in the attachment.

Now, in my Design i would get Input as India for which 0001 should be passed and when my input is Germany then 005 should be passed. Can anyone help me with the UDF code to achieve this functionality. We have more number of fields to be entered in the value mapping, hence i thought this approach would save a lot of space in the value mapping objects.

Your help would be appreciated.

Thanks,

Sherin Jose P

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>We have more number of fields to be entered in the value mapping, hence i thought this approach would save a lot of space in the value mapping objects.

There are couple of ways to do this.  Value mapping is just for less number of key values but requires more maintanence if the code values vs country changes more frequently.  I would rather put it in a flat file and do file lookup using UDF or put it in the table and do the jdbc lookup during mapping.

This way you don't change the objects when the values get changed. You just handle it in table or flat file.

I'm sure you know about designing jdbc lookup. If you want to know details about file lookup using UDF , the below approach is an another way to do this.

https://wiki.sdn.sap.com/wiki/display/XI/File+Lookup+in+UDF

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>My source value should be in comma separated values and the corresponding target values also will

OMG.... crazy design please don't do it like this

do it the proper way - one value - one code....

who will you be able to maintain this strange solution ? how will you know that 004 is japan ?

it's not practical and I hope you will change it and use the value mapping in a proper way

if you want to use something else use a RFC table lookup or JDBC lookup (graphical)

but do it correctly and not like this

Thank you,

Regards,

Michal Krawczyk

sherin_jose4
Participant
0 Kudos

Thanks for your suggestion Michal.

Yeah, i know its kind of a crazy design, but just thought that this might reduce the number of objects used. If this is not the recommended way, then i will go with the conventional way itself.

MichalKrawczyk
Active Contributor
0 Kudos

>>>>then i will go with the conventional way itself

that's the spirit

good luck,

Regards,

Michal Krawczyk