cancel
Showing results for 
Search instead for 
Did you mean: 

1:N mapping in XI

Former Member
0 Kudos

Hi Experts,

I need your suggestion in the following scenario regarding the mapping.

We have a file to idoc scenario from third party system to SAP via XI in which one text is coming contains more than 70 chars, but as length in the idoc (sap side) is restricted to 70 chars only, the text is getting truncated and updated in sap.

I hope, if we can add some logic in the mapping to generate multiple segments of 70 chars each if the text length is more thn 70 chars, then we can achieve this.

Can any one of you suggest in detail how to achieve this in mapping, probably with 1:N ? Any documents would be appreciated.

Thanks in Advance,

Jitender

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks Gourav. I have included the logic in UDF and it seems splitting the string fine.

Right now source field is mapped to TDLINE in E1EDPT2 so

Do we need to change this mapping also?

How the multiple segements will be generated?

Thanks in Advance

Jitender

Former Member
0 Kudos

Hi,

How the multiple segements will be generated?

Use RemoveContext function for both child node(where u used the UDF) and parent node. u can able to generate multiple segments

Regards,

Rohit

Reward points if helpful.

Former Member
0 Kudos

For generating multiple E1EDPT2 segment you can do mapping like

source --> UDF --> E1EDPT2

and for TDLINE

source --> UDF --> SplitbyContext --> TDLINE

Gaurav Jain

**Reward point if its helpful

Former Member
0 Kudos

Thanks Gourav,

It is workin perfectly fine according to the requirement.

I have written a UDF and included both for child as well as for parent.

Points are rewarded.

Once again thanks,

Jitender

former_member58757
Participant
0 Kudos

This message was moderated.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rohit,

Can you please explain in detail on how to generate the segment E1EDPT2 many times dynamically if the string lengh is more than 70 chars.

Points would be re warded.

Thanks in advance,

Jitender

Former Member
0 Kudos

Jitender,

you can use below mention UDF

public void Split(String[] var1, ResultList result, Container container){

String input = "";

input = var1[0];

while( input.length() > 70 ){

result.addValue(input.substring(0,70));

input = input.substring(70);

}

result.addValue(input);

}

Gaurav Jain

Edited by: Gaurav Jain on May 22, 2008 10:42 AM

Former Member
0 Kudos

Hi,

1) U have to use UDF to get this.

2) In UDF split total text in 70-70 char. for this check text length using if condition.

3) Use RemoveContext node function to map this field and its parent node.

Regards,

Rohit

Reward points if helpful.