Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

String and Internal table

Former Member
0 Kudos

We have a large character string in the memory, e.g. of 5M.

(1) we want to split the character string into an internal table with a field of c(1000), for example.

(2) we want to read the internal table, and concatenate each line into one string.

For STRLEN and CONCATENATE, it always ignores the trailing blanks. However, we don't want to LOSE ANY BLANKS.

thanks,

-Stanley

2 REPLIES 2

Former Member
0 Kudos

I don't think there is any availble function module that does it. You may have to code for it. Also the blanks are a problem. So try something like this, which was actually suggested by Sanjay while responding to another question in this forum

First replace all the blank space with a character that you know for sure, will not be there in your string.

TRANSLATE mystring USING ' @'.

Now do your STRLEN and get your string length.

The you can split your string using the option INTO TABLE. Your itab will have only one field of 1000 length.

Then read the internal table and concatenate them back into the long string.

Finally, you reverse the pattern in the previous TRANSLATE statement to '@ '.

Srinivas

Former Member
0 Kudos

welcome to SDN

it will be more easy to reply if you can paste your coding

also try using SEARCH

regards