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

formating problem

Hi All,

I have a char field with content 1,000.00 and I need to convert into 1000.00 format.

Any help in accomplishing the task with minimal code is appreciated.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 04, 2007 at 10:58 PM

    Execute this code.

    data: i_amt(10).   "<<CHAR field
    
    TYPES: BEGIN OF ITAB_TYPE,
            WORD(20),
          END   OF ITAB_TYPE.
    
    data: wa_itab type itab_type.
    
    DATA: ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH
                    NON-UNIQUE DEFAULT KEY INITIAL SIZE 5.
    
    SPLIT '10,000.00' AT ',' INTO TABLE ITAB.
    
    
    loop at itab into wa_itab..
    *write: / wa_itab.
    concatenate i_amt wa_itab-word into i_amt.
    endloop.
    
    write: / i_amt.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 12:16 AM

    DATA: t_char(10) TYPE c VALUE '1,000.00'.

    data: t_char2(10) type c.

    t_char2 = t_char.

    replace all occurrences of ',' in t_char2 with ''.

    write:/ t_char2.

    WRITE:/ t_char.

    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.