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

How to remove leading zeros

I have a field 'Bill No.' of Character(10) type in my dialog program. Once I input and save value e.g. '1' in this it gets saved as 1 but in the internal table it gets stored as '0000000001'. Pls let me know how to remove these leading zeros: perhaps I'll have to use LTRIM but I am not sure.

deepak.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2007 at 07:49 AM

    Hi

    Use the fm CONVERSION_EXIT_ALPHA_OUTPUT.

    DATA: P(10) VALUE '0000000001'.
    
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
         EXPORTING
              INPUT  = P
         IMPORTING
              OUTPUT = P.
    
    WRITE P.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2007 at 07:50 AM

    in internal table for perticular field change data type num to char . tah n it will work.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 01, 2007 at 09:13 AM

    Hi!,

    Usually we remove the zeros by the following ;

    shift <field_name> left deleting leading zeros.

    regards

    Purnima.

    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.