cancel
Showing results for 
Search instead for 
Did you mean: 

XI mapping TEXT

Former Member
0 Kudos

I need to map text from an IDOC (DESADV01) to EDIFACT IFTMIN message in XI

I am using the graphical mapping editor

I have the following in the idoc segment E1EDKT3 -> TDID = 9028

E1EDKT4 -> TDLINE (This is Line1)

E1EDKT4 -> TDLINE (This is Line2)

E1EDKT4 -> TDLINE (This is Line3)

E1EDKT4 -> TDLINE (This is Line4)

Each TDLINE needs to mapped to the segment NAD -> C_C058 -> D_3124, D_3124_2, D_3124_3, D_3124_4

Result should be

This is Line1 -> D_3124

This is Line2 -> D_3124_2

This is Line3 -> D_3124_3

Can you tell me how I can achieve this?

Thanks

Mark

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mark,

Function Category: Statistics --> index

R = Index i of Xi. In the function properties, you specify the following: the initial value of i, the increment, and whether the index value is to be reinitialized at the beginning of every new context, or whether it is to have the same value for the entire source structure.

See:

http://help.sap.com/saphelp_NW04/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm

Regards Mario

Answers (3)

Answers (3)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

You could use the copyValue function:

TDLINE --> copyValue(0) --> D_3124

TDLINE --> copyValue(1) --> D_3124_2

TDLINE --> copyValue(2) --> D_3124_3

TDLINE --> copyValue(3) --> D_3124_4

Hope this helps

Former Member
0 Kudos

Hi Akshay

Thanks for your response, unfortunately you cannot do this as TDLINE is the Source message.

Regards

Mark

Former Member
0 Kudos

Hello,

Use copyValue from Constants function and pass the idex accordingly starting from 0 to your target fields.

for example:

tdline - > copyvalue(0)->first

tdline -> copyvalue(1)-> second

Regards,

Sreenivas.

Former Member
0 Kudos

Guys

Thank you for your responses,

getting closer, however, not quite there yet...The Copy Value needs to be given an index ( this index cannot be a constant value as you may have several lines of text from a different ID at this level. These lines canl be SUPPRESSED however you need to know what index the relevant text is on and increment this index accordingly.

So I guess I need a UDF which will read the resultlist and pick up the first value not suppressed and copy this across - then this index value will need to be incremented and stored to be used for the second line etc.

Can you give me an example of how to do this?

Thanks

Mark

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

This can be done without using UDF, just use the function removeContext example:

Suppose the queue for your lines is:

A, CC(Context Change), B, SUPPRESS, C, SUPPRESS, D

When you use removeContext, the output would now be:

A,B,C,D

You can then use the copyValue technique as referenced in the responses above. Then, as for the children nodes, you can use the ifWithoutElse function to only pass the values from the lines that were not suppressed. Just make sure you do it in an argument like this:

Parent Node --> mapWithDefault:SUPPRESS --> equalsS:SUPPRESS --> not --> 1. ifWithoutElse

Child Node --> mapWithDefault:SUPPRESS --> 2. ifWithoutElse

Former Member
0 Kudos

Hi dspboys

I can get the Parent node using the map default example you gave but I cannot get the child node right.

Can you elaborate?

Thanks

mark

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

What I meant by that was that the number 1. corresponds to the input 1 of the ifThenElse function, then the number 2. corresponds to the input 2 of the ifThenElse function.

Did I answer interpret the question correctly?

Regards,

Former Member
0 Kudos

Hi dspboys,

Thankyou for your reply,

I have made use of your suggestion, i had to add some other bits but used in conjunction with your solution it works.

Many Thanks for your assistance...points have been awarded

Regards

Mark

Former Member
0 Kudos

Hi,

Right Click on your TDLINE Node and say 'Duplicate Subtree' for 4 times.

Then set the context accordingly...and Map it directly tothe required target node.

save and execute mappings and execute.

This should work....with some points

Regards,

Akshay.