Application Development and Automation 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: 
Read only

Leading Zeros Problem

Former Member
0 Likes
1,145

Hi all,

I'm using this statement:

CONCATENATE matdescr pa_matnr 'from' vendorname pa_lifnr

INTO v_head SEPARATED BY space.

TRANSLATE v_head TO UPPER CASE.

but the problem is that I'm getting the matnr with zeros '000000000000055501' and the lifnr as ' 0000300205'.

Is there a way I can show the material no. and vendor without leading zeros. I tried to use NO-ZEROS but did not work.

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
980

For these kind of problems use the conversion exit routines. You can find them by going to the data type of the material (or whatever for that matter), than double click on domain. In one of the tabs of the domain you will find at the bottom the field EXIT (or conversion, not sure). Double click this field and you will be navigated to the conversion FM (input and output conversion routines). Use these for deleting and adding zeros.

5 REPLIES 5
Read only

Former Member
0 Likes
980

HI,

see this code.


data:abc(10) value '0000123'.
WRITE:/ abc.
SHIFT abc LEFT DELETING LEADING '0'.
write:/ abc.

rgds,

bharat.

Read only

Former Member
0 Likes
980

Hi Shaheen

Use FM 'CONVERSION_EXIT_ALPHA_OUTPUT'

This FM will remove leading zeroes,

Rewards if useful

Regards,

Talwinder

Read only

Former Member
0 Likes
980

Hi Shaheen,

You can use the FM " Conversion_exit_alpha_output".

This will truncate the leading zeros.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

input = pa_matnr

IMPORTING

output = pa_matnr.

Use this for concatenation.

Regards,

Chitra

Read only

Sm1tje
Active Contributor
0 Likes
981

For these kind of problems use the conversion exit routines. You can find them by going to the data type of the material (or whatever for that matter), than double click on domain. In one of the tabs of the domain you will find at the bottom the field EXIT (or conversion, not sure). Double click this field and you will be navigated to the conversion FM (input and output conversion routines). Use these for deleting and adding zeros.

Read only

Former Member
0 Likes
980

Hi,

Use this FM,

CONVERSION_EXIT_CCMAT_INPUT Function Module for Material Number Conversion (INPUT)

CONVERSION_EXIT_CCMAT_OUTPUT Function Module for Material Number Conversion (OUTPUT)

Regards,

sathish