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

XString to string conversion

Hi All,

I want to display contents of XString to String from a text file which has got generated from a excel file having multiple worksheets. I am using CL_ABAP_CONV_IN_CE class to convert the xstring to string. While converting to the string format lots of hashes '#' [not fix in number sometimes 1 or 2 or may be 13] are getting added to the result string variable. I have tried to remove these hashes with the help of REPLACE function, but ABAP code is not able to recognise those hashes. Is there any way to control remove these hashes? or Is there any other solution to convert the XString to the string?

Pl. reply to this at an earliest.

Thanks in advance,

Regards - Navneet

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 17, 2004 at 06:17 PM

    Hi Navneet,

    In SAP, the unprintable characters are displayed as '#'s on the screen. This doesn't mean that the variable at that position contains a '#'. It could have been any unprintable character (typically, Ascii < 32 or > 127).

    From what you have stated, I guess you are trying to read an 'excel' file directly as a text file into XString. This will NOT work. You have convert the excel file to a flat text file, either manually or using some tool (or function modules) - say a tab or comma delimited flat file.

    If you really do want to remove those '#'s in your program, instead of Replace, try positional operations (after evaluating if the ascii value is < 32 or > 127).


    Venky Varadadesigan.

    SAP NetWeaver consulting.

    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.