cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping help or UDF

Former Member
0 Kudos

Hello Friends,

I need some help in mapping through regular or UDF.

Requirment is I have target field CORD_CODE,

This needs to ge the value based on the segment values of EIEDT44-VSTEL

If VSTEL = CO10 then 1055

If VSTEL = CO11 then 1054

If VSTEL = CO13 then 1057

If VSTEL = CO12 then 1056

Like this.

Can we create UDF for the same or anyt other alternative?

<removed by moderator>

Regards

Ramesh

Edited by: Mike Pokraka on Jul 24, 2008 1:46 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi

use fix values option in mapping.

take VSTEL as source and give fix value function in between source and target

in this fix value give values like

CO10 1055

CO11 1054

CO13 1057

CO12 1056

Former Member
0 Kudos

I have dne the same, I am getting erro like this ...

Cannot produce target element /ns0:MT_GuiaTransport/DELIVERY_RECORDS[2]/MERCK_COORD_CODE. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

Former Member
0 Kudos

Hi,

Check the source and target occurances......

i guess.....the occurances of source is greater than the occurances of the taarget in your case....

Thanks,

Madhu

Former Member
0 Kudos

Hi,

for this error have a look at this thread:

Regards

Patrick

Former Member
0 Kudos

The Source - VSTEL occurance is 0 to 1 and Target - CORD CODE is 1 - 1 ...

So should I chanange any .. I did not develope this, I have got some fixes to be done to this mapping...Tehre are no one in the team who knows XI...

Former Member
0 Kudos

HI,

is any value comming from source after satisfying all the conditions??????

i guess no value is comming from source.....so check for the contect changes......

Thanks,

Madhu

Former Member
0 Kudos

Hi,

at least you will need a default value in case the source does not exist.

You can do it with the standard function mapWithDefault:

source value -> mapWithDefault -> fixValue -> targetValue

Regards

Patrick

Edited by: Patrick Koehnen on Jul 22, 2008 11:14 AM

former_member192892
Active Contributor
0 Kudos

Hello Ramesh,

Just add a mapWithDefault on the source node before doing fixValue mapping. This will prevent the error.

santhosh_kumarv
Active Contributor
0 Kudos

Hi Ramesh,

This error Cannot produce target element /ns0:MT_GuiaTransport/DELIVERY_RECORDS[2]/MERCK_COORD_CODE could be becaus of two reasons

1. Node VSTEL would have not been in the source structure.

2. Value in the node would have been different than the possible values.

Solution:

In addition to this graphical mapping

If VSTEL = CO10 then 1055 else drag and drop another if-then-else and if VSTEL = CO11 then 1054 else drag and drop another if-then-else and if VSTEL = CO13 then 1057 and drop another if-then-else and if VSTEL = CO12 then 1056 .....

1. First check if the node VSTEL exist then check the conditions else map a constant.

2. Add a constant to the else part of the last condition check i.e if VSTEL = CO12 then 1056 else constant.

Thanks

SaNv...

Former Member
0 Kudos

HI Ramesh,

you assign a constant value and check along with that condition.....check it....it works fine....

Thanks,

Madhu

Former Member
0 Kudos

hey your problem is probably to do with your context handling

Former Member
0 Kudos

Just to elaborate:

If your source come like this

a

a

a

with no context change then your target field would also have to be

t

t

t

if you have an element above the t like this

Segment

t

Segment

t

Segment

t

then you will get your error.

So what you need to do it either split by value or change the context of your source node which you can do by right clicking on the source node in your graphical mapping

Edited by: Alex on Jul 22, 2008 11:23 AM

Former Member
0 Kudos

Hi,

you could use standard function FixValues (under Conversions).

Just put it between source and target and double click it on it.

A table will open where you could enter your value pairs.

Regards

Patrick

Former Member
0 Kudos

Hi ramesh,

you can handle it with IF Then Else conditions.....

If VSTEL = CO10 then 1055

If VSTEL = CO11 then 1054

If VSTEL = CO13 then 1057

If VSTEL = CO12 then 1056

If VSTEL = CO10 then 1055 else drag and drop another if-then-else and if VSTEL = CO11 then 1054 else drag and drop another if-then-else and if VSTEL = CO13 then 1057 and drop another if-then-else and if VSTEL = CO12 then 1056 .....

no need to go for UDF....

Thanks,

Madhu

Edited by: Madhu sudhan Reddy on Jul 22, 2008 10:34 AM