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

How to replace special characters in Purchase order item text in ECC 6.0

Hi All,

Now i am working in ECC environment.

I am unable to replace the special characters in the PO short text for example take the following text.

Job#Burst Fire 3930-00092#Heater Control

here i want to replace # symbol with space.

i used replace all occurences, find , transfer, overlay keywords to replace thta special characte but it is not replacing that character.

i used replace_string FM also.it is also not working.

please help me out in this. points will be rewarded.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Jun 17, 2008 at 06:55 PM

    Try to use

    REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN txt WITH ' '.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 07:00 PM

    Hi,

    Another option is to use TRANSLATE.

    Thanks

    Vikranth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 08:05 PM

    This may be the reason that it is not actually a # (hash) character but a special ascii character. These appear when users press a tab or some other key while entering short text.

    Program may not identify this as a actual # but some other char. To verify this, i would suggest you to past the same text in some Textpad or Edit plus text editors. You may see the actual character.

    You may have to manually remove these characters here and run your program.

    You can also go to ME23N and display this PO text. You may not find # but something else.

    My solution may not be relevant to yours but i came across this situation

    Thanks,

    SKJ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 08:07 PM

    yah i tried that also by pasting the same text in text pad and word pad it is showing as a # only

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 17, 2008 at 08:44 PM

    Hi praweena,

    @rs gave a usful hint. The thing is that # means any non-printable character. In debug mode, switch to hex display ro find out what it is.

    You may try othe attributes of class cl_abap_char_utilities, cr_lf is possible but I think it may be horizontal_tab .. or what ever.

    Regards,

    Clemens

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 05:20 PM

    Hi clemen ,

    Some wat ur answer is working but it is not replacing all occurences of the # symbols in the text.

    for example take the following text

    Job#Burst Fire 3930-00092#Heater Control

    here in two places we have # symbol it is replacing at one place i.e

    Job#Burst Fire 3930-00092 Heater Control

    so could u plese provide me some other solution.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Praveena,

      what replacement(s) did you try?

      Please

      replace all occurrences of

      CL_ABAP_CHAR_UTILITIES=>newline
      CL_ABAP_CHAR_UTILITIES=>cr_lf
      CL_ABAP_CHAR_UTILITIES=>form_feed
      CL_ABAP_CHAR_UTILITIES=>horizontal_tab
      CL_ABAP_CHAR_UTILITIES=>vertical_tab
      CL_ABAP_CHAR_UTILITIES=>backspace
      CL_ABAP_CHAR_UTILITIES=>minchar 
      CL_ABAP_CHAR_UTILITIES=>maxchar
      

      minchar is HEX u201900u2018 in non-Unicode systems, U+0000 in Unicode systems

      maxchar is HEX Xu2018FFu2018 in non-Unicode systems, U+FFFD in Unicode systems

      If it still does not help, check the remaining # characters in debugger, switching to hex mode: Then you may see what it is.

      Regards,

      Clemens

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.