on 03-18-2014 5:23 AM
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......
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thankq So much. I got the Exact output your UDF.
i have another complex mapping doudt.
I ll ask.......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeevitha,
Hope your query has been answered in the below link.
http://scn.sap.com/thread/3521455
Thanks,
Naveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.