cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple TDLINE generation in PI

Former Member
0 Kudos

Hi experts,ed through

Non SAP system is sending long text description and PI has to split multiple TDLINE each of max size 70 char.These we have  achieved through java udf.

TDFORMAT field is set to constant "=".The issue in SAP Idoc header text is if the 70 th/140/210 th char is space,2 words are combined together without space.How to fix this issue in PI?

Regards,

Karthiga

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member191435
Contributor
0 Kudos

in place of UDF you can use substring node function...

Please send your mapping screen shot...and let me know your exact mapping ..

Thanks,

Sreenivas

Former Member
0 Kudos

Hi sreenivas,

Source filed length is nt static one and its dynamic.Please help me in writing the java udf for splitting the string.line lenght should be max of 70 char/<=70 and line should end with proper word and it should nt split the words in between.

Regards,

Karthiga

former_member191435
Contributor
0 Kudos

can you please let me know with sample example.. what is your actual requirement...

Thanks,

Sreenivas

Former Member
0 Kudos

Hi,

Please find the UDF and code snippets for the same requirement.

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

Hope this helps!

Thanks,

Sudhansu

Former Member
0 Kudos

Hi,

Non SAP system will be sending the description of length 280 or lesser char.We have to map this description in PI to TDLINE field.TDLINE can accomadate only 70 char.so PI has to generate 4 E1EDPT2 segment and 4 TDLINE.I can able to split the string to 4 substring by below udf.

int size = Integer.parseInt(splitsize[0]);
for(int j=0; j < inputstring.length; j++)
{
if(inputstring[j].equals(""))
result.addValue("");
else
{
for (int i = 0; i < inputstring[j].length(); i += size)
{

   int end = i + size > inputstring[j].length() ? inputstring[j].length() : i + size;
   result.addValue(inputstring[j].substring(i, end));
}
}
}

SAP ECC finally merging all the TDLINE.Issue is when 70th/140th char is space,the 69th and 71th char are getting merged without space.

so ECC ask us to check whether the space exist at end of first/sec/third line and move that space to beginning of line.This is one option.

Other option when PI is splitting the string to 70 char,it should nt break the words inbetween.Rather PI should split closed space char available .meaning 70 or <70 char in one TDLINE.

Regards,

Karthiga

former_member191435
Contributor
0 Kudos

hi,

You can do one thing... You can take one concat function    add your output to 1st input of concat and constant with 10 spaces for 2nd input of concat......   after that use substring 0,70   then you will get the desired output....

Thanks,

Sreenivas.

Former Member
0 Kudos

you just need to adjust the length. in the UDF you have add one more else if and define the length.. for your case it should be

if (len >0 && Len < 70 ) {

result.addValue(....)

} elseif(len >0 && len < 140 ) {

result.addValue(....)

result.addValue(....)

}else if (len >0&& len <210) {

result.addValue(....)

result.addValue(....)

result.addValue(....)

}else if (len >0 && len <280) {

result.addValue(....)

result.addValue(....)

result.addValue(....)

result.addValue(....)

}

Refer Hareesh Gampacomments .......

Former Member
0 Kudos

Hi,

Are you using the "trim" function by any chance. Please try by removing it.

Thanks,

Sudhansu

Former Member
0 Kudos

hi sudhansu,

I am using below udf for splitting the string to 70 char.TDFORMAT is set to constant "=".

nt size = Integer.parseInt(splitsize[0]);
for(int j=0; j < inputstring.length; j++)
{
if(inputstring[j].equals(""))
result.addValue("");
else
{
for (int i = 0; i < inputstring[j].length(); i += size)
{

   int end = i + size > inputstring[j].length() ? inputstring[j].length() : i + size;
   result.addValue(inputstring[j].substring(i, end));
}
}
}

the issue here is when 70th/140th char is space in input string,2 words are getting concatinated in SAP header text.How to fix it..