Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove leading zeros

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi!,

Usually we remove the zeros by the following ;

shift <field_name> left deleting leading zeros.

regards

Purnima.