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: 

leading zeroes

Former Member
0 Kudos
200

Hi experts

I declared belnr as follows.

BELNR LIKE BSEG-BELNR,

then I give the input 6201393

when i debut its value become : IEQ0006201393

how to reduce leading zeroes.

thanks in advance.

Regards

Rajaram

10 REPLIES 10

Former Member
0 Kudos
169

hi,

Use the below FM.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = wf_version
            IMPORTING
              output = wf_version.

Example:

input = 00000000000123

output = 123

Rgds

Reshma

Former Member
0 Kudos
169

by using conversion_exit FMs u can remove.

regards

Peram

Former Member
0 Kudos
169

Hi,

You try with call function 'CONVERSION_EXIT_ALPHA_INPUT'

Regards

Former Member
0 Kudos
169

HI

Use the appropriate Conversion exit for this data type.

it will be defined in the domain of this data element.

CONVERSION_EXIT_ALPHA_INPUT

CONVERSION_EXIT_ALPHA_OUTPUT

Regards

Ravish Garg

<b>*reward if useful</b>

Former Member
0 Kudos
169

Hi,

u would actually declared itas:

select-option : BELNR LIKE BSEG-BELNR.

means it is a select option.

u can get its low and high vlaue using this :

belnr-low " low value
belnr-hign " high value 
"and NOT simply
belnr

Jogdand M B

0 Kudos
169

sorry i can't understand,

actually i have selection stmt as follows

SELECT-OPTIONS: zbel FOR bseg-belnr OBLIGATORY.

how to solve yar

Regards

Rajaram

0 Kudos
169

HI

Try this code:


data: output(20) type c.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
  EXPORTING
    input         = '0000003256'
 IMPORTING
   OUTPUT        = OUTPUT.
write 😕 output.

Regards

Ravish Garg

<b>*reward if useful</b>

0 Kudos
169

Can you explain why do you want to remove the leading zeros? What is the purpose?

Former Member
0 Kudos
169

Hi,

u would actually declared itas:

select-option : BELNR LIKE BSEG-BELNR.

means it is a select option.

u can get its low and high vlaue using this :

belnr-low " low value

belnr-hign " high value

"and NOT simply

belnr

and then use FM,

CONVER_EXIT_ALPHA_OUTPUT

Jogdand M B

Message was edited by:

Jogdand M B

Former Member
0 Kudos
169

Use <b>CONVERSION_EXIT_ALPHA_OUTPUT</b> function module

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

input = belnr

IMPORTING

output = belnr.