cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping

Former Member
0 Kudos

Hi,

I was doing mapping for the below validation and I got strucked,so can any one help to achieve this.

Sourcefield-value

Target Field-FIELD

Conditions

1)If value=

AB=FIELD=2

CH=FIELD=3

MN=FIELD=4

YJ=FIELD=5

IJ=FIELD=6

Accepted Solutions (1)

Accepted Solutions (1)

former_member91687
Active Contributor
0 Kudos

Hi,

You can write a UDF with an if condition to check if the value is AB or CH etc, for example

if (field1.equals("AB"))

And then write the corresponding output you want to, either 2 or 3 or whatever you require. If the structure which you want to get is more complex, you can do the same in Java Mapping. Refer to these blogs by Prasad to help you with Java Mapping

<a href="/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i Mapping-Part 1</a>

<a href="/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii Mapping-Part 2</a>

Regards,

Chandra

Former Member
0 Kudos

I think you didn't understand my question completely,Let me explain once again.

In my source Element name is VendorName.

In My Target Element name is VendorNumber.

I have to map a source Element VendorName to VendorNumber with some conditions.

When I give Input as VendorName=CH then Target Element VendorNumber would display as 2(VendorNumber=2)...like that VendorName=EF then VendorNumber=3

Can you write a sample program and reply me...

Note:Please take more than two values

1)VendorName=CH----VedndorNumber=2

2)VendorName=EF----VedndorNumber=3

3)VendorName=EF----VedndorNumber=4

former_member206604
Active Contributor
0 Kudos

Hi,

There is no need for a UDF, you can either use FixValues or Value Mapping. These functionalities are available specially for this kind of requirements.

FixValues

http://help.sap.com/saphelp_nw04/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/content.htm

Check out this link a very good document explaining mapping functionality and Value Mapping as well.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb...

Regards,

Prakash

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can carry out this mapping by writing a simple user defined function in graphical mapping.

Could you please be more clear as to where you are facing a problem?

Regards,

Smitha.

Former Member
0 Kudos

Smitha could you explain me with Java Function.I couldn't achieve this using userdefined function.

Here once again i am repeating my problem.

If my source field value is=AB then target field(name of the target field) value will be printed as 2...same like Value=CH then field would be 3..