cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping logic needed

Former Member
0 Kudos

Hi frnds,

i am doing an idoc-file scneario...below are teh strcuturess

Idoc:

---ZTXT(NOde)

---ZLine1(Subnode) [0:10 occurance]

Name(Attribute)

Value(Attribute)

File:

---TXT(NOde)

--Cost

--rate

--excValue

The Logic is if Name Attribute is equal to "Cost"(name of the field in target) then value should be mapped to "Cost" fieldOr if Name attribute is equal to "rate"(name of the field in target) then the value should be mapped to "rate"

I tried with using "if then" fn but when the Zline1 node is repeated with different its generating only one value on the target side . its not generating multiplpe values..(Ex say if we have values as cost and rate being repeated in Idoc its generating only one field cost in file no value is entered for rate )

Can you help me where i am going wrong..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

 

<ZLine1>  ----->   <TXT> 


<@Name> -------------->                    <@value>--> 
                      <equalsS> ------------------>  <if   then else> -----> <Cost> 
<Constant = cost> ----->                <constant = blank> ---> 

1) Map ZLine to TXT directly

2) Check if value of Name is equal to cost using equalsS Text function.

3) Map the output of equalsS to <if then else> and map the Value attribute to Then input and a constant blank to else input.

4) Map the if then else to Cost.

Similarly do the mapping for Rate.

This must satisfy your requirement.

Regards,

Aravind

Former Member
0 Kudos

Hi arvind,

When ZLINE node repeates containg both cost and rate. only cost is being populated on the target side..rate is not populated/

Former Member
0 Kudos

Hi,

Similar to this



<@Name> -------------->                    <@value>--> 
                      <equalsS> ------------------>  <if   then else> -----> <Cost> 
<Constant = cost> ----->                <constant = blank> --->

Have you done the mapping for Rates as well?



<@Name> -------------->                    <@value>--> 
                      <equalsS> ------------------>  <if   then else> -----> <Rate> 
<Constant = rates> ----->                <constant = blank> --->

Regards,

Aravind

Former Member
0 Kudos

U have to use the same logic on both the target fields...

for example- use this-

U need to keep the context at root node for the source field.

1.compare Name with constant value COST using equals function - output map to if without else - map it to Cost

2. compare Name with constant value RATE using equals function - output map to if without else - map it to RATE

chirag

Former Member
0 Kudos

Thanks Chirag

Answers (2)

Answers (2)

Former Member
0 Kudos

right click on source and change context to higher node- and then apply the logic - compare the value with equals function then use if then else...

chirag

RKothari
Contributor
0 Kudos

Hello,

Can you please provide the occurance of Text , Cost and Value?

Please check Text node occurance ..

IF its multiple than you need to map it with Zline.

IF Cost and Value are having multiple occurance then

you need to make the context of Name and Value attribute in source structure to ZTXT level or

insert remove context function after source fields Name and Value (before IF then Else) in the mapping.

Former Member
0 Kudos

hi Rahul,

TXT is having the same occurance as of of ZLINE 0:10..

where as the occurance for cost and rate fields are 0:1 And these are the fields under TXT Node..

Edited by: prabhas465 on Feb 17, 2011 10:14 AM

RKothari
Contributor
0 Kudos

>>..(Ex say if we have values as cost and rate being repeated in Idoc its generating only one field cost in file no value is entered for rate )

As I understand, in source Idoc the Node ZLine1 will Either contain Name as Cost or Rate not both.

If your mapping for Txt is with ZLine1 segment than in each occurance of Txt either Cost will be populated or Rate value will be populated but not both.

Do you want to populate both(Cost and Rate) values in single TXT node ??

Can you provide the mapping you are using to populate TXT node?