Skip to Content
avatar image
Former Member

ABAP Error :How to remove spaces from the string.

Hi ,

For example :

string S1 = ' 8 000 000 '.

I want to remove the spaces from the string to get the output of the string as : 8000000.

Please help me in this

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 17, 2008 at 05:35 AM

    Kiran,

    Use

    CONDENSE s1 NO-GAPS.

    Regards

    RR

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 16, 2008 at 02:34 PM

    Hi Kiran,

    You can try something like this:

    DATA S1 TYPE string VALUE '8 000 000'.
    REPLACE ALL OCCURRENCES OF REGEX '[ ]+' IN S1 WITH ``.
    

    Kind regards,

    Bruno

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 21, 2015 at 10:56 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded