cancel
Showing results for 
Search instead for 
Did you mean: 

File to IDOC Senario (Message Mapping)

Former Member
0 Kudos

Hi Experts,

I am a fresher.

This is "  File to IDOC Senario  ".

I have Doubt on  this: ( In Message Mapping)

Source field : MSG

Length : 1/264

Taget field : E1EDKT2 - TDLINE

Legth : CHAR/70

Mapping Condition :

Note: TDFORMAT =  ‘=’ (Long Line), until next line of MSG. When new line occurs in MSG, then use TDFORMAT = ‘/’

How to Make the Mapping for this?

Anyone Can help me to get it Quickly.

give your Suggestions and Show some Example Mappings......

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

Below is the generic sol for your problem .Graphical mappings wont workout for your problem while using sub string .

Input -->Input string

Length -->length of TDLINE

MESSAGE_V1,V2,V3,V4....depends on how many TDLINES you expect .Here I have taken 4 .

public void SplitbyLength(String[] Input, String[] Length, ResultList MESSAGE_V1, ResultList MESSAGE_V2, ResultList MESSAGE_V3, ResultList MESSAGE_V4, Container container) throws StreamTransformationException{

int lengthVal = Integer.parseInt(Length[0]);

int InpLenVal ;

for(int i=0;i<Input.length;i++)

{

InpLenVal  =Input[i].length() ;

if (InpLenVal<=lengthVal)

{

MESSAGE_V1.addValue(Input[i].substring(0));

MESSAGE_V2.addValue(ResultList.SUPPRESS); 

MESSAGE_V3.addValue(ResultList.SUPPRESS); 

MESSAGE_V4.addValue(ResultList.SUPPRESS); 

}

else if ((InpLenVal>lengthVal) && (InpLenVal <= (lengthVal*2)))

{

MESSAGE_V1.addValue(Input[i].substring(0,lengthVal));

MESSAGE_V2.addValue(Input[i].substring(lengthVal,InpLenVal));

MESSAGE_V3.addValue(ResultList.SUPPRESS); 

MESSAGE_V4.addValue(ResultList.SUPPRESS); 

}

else if ((InpLenVal>(lengthVal*2)) && (InpLenVal <= (lengthVal*3)))

{

MESSAGE_V1.addValue(Input[i].substring(0,lengthVal));

MESSAGE_V2.addValue(Input[i].substring(lengthVal,(lengthVal*2)));

MESSAGE_V3.addValue(Input[i].substring((lengthVal*2),InpLenVal));

MESSAGE_V4.addValue(ResultList.SUPPRESS); 

}

else if (Input[i].length()>(lengthVal*3)  && (InpLenVal <= (lengthVal*4)))

{

MESSAGE_V1.addValue(Input[i].substring(0,lengthVal));

MESSAGE_V2.addValue(Input[i].substring(lengthVal,(lengthVal*2)));

MESSAGE_V3.addValue(Input[i].substring((lengthVal*2),(lengthVal*3)));

MESSAGE_V4.addValue(Input[i].substring((lengthVal*3),InpLenVal));

}

else if (Input[i].length()>(lengthVal*4) )

{

MESSAGE_V1.addValue(Input[i].substring(0,lengthVal));

MESSAGE_V2.addValue(Input[i].substring(lengthVal,(lengthVal*2)));

MESSAGE_V3.addValue(Input[i].substring((lengthVal*2),(lengthVal*3)));

MESSAGE_V4.addValue(Input[i].substring((lengthVal*3),(lengthVal*4)));

}

}

}

Regards

Venkat

Former Member
0 Kudos

Hi,

I  used this UDF.  But i not able to map it correctly. so please send  some  example mapping snap.

it will helpfulful for me.

Former Member
0 Kudos

Hi ,

Below is the example for your ref.

Here Input -->Input string -->ERR

Length -->length of TDLINE -->constant(50)

MESSAGE_V1,V2,V3,V4....depends on how many TDLINES you expect .Here I have taken 4 .

Regards

Venkat

Answers (2)

Answers (2)

Former Member
0 Kudos


Thankq So much. I got the Exact output your UDF.

i have another complex mapping doudt.

I ll ask.......

former_member184720
Active Contributor
0 Kudos

Hi Jeevitha - For that you need to create a new thread.. As this issue has resolved, please close it by marking Venkat's answer as correct.

Former Member
0 Kudos

k Thankq.

naveen_chichili
Active Contributor
0 Kudos

Hi Jeevitha,

Hope your query has been answered in the below link.

http://scn.sap.com/thread/3521455

Thanks,

Naveen