Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Mapping, splitting linen in several lines

Hi,

I have the following situation.

The source structure contains a field that can be up to 4000 characters long,

The target structure contains a field than has a length of 132.

These fields have to be mapped with each other but how can I split the field of 4000 characters

into several lines of 132 characters long?

kind regards Maarten

replied

Hi,

while (sourceStr.length()>132)

{

String resultStr=sourceStr.substring(0,132);

sourceStr = sourceStr.substring(132);

(or) sourceStr = sourceStr.substring(132,sourceStr.length());

resultList.addValue(resultStr);

// This is for checking the last characters if it is 10 or 20 or ... then we have to add that also.

if(sourceStr.length() < 132)

resultList.addValue(resultStr);

}

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question