Skip to Content
author's profile photo Former Member
Former Member

String and Internal table

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 19, 2005 at 02:53 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2005 at 02:53 AM

    welcome to SDN

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

    also try using SEARCH

    regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.