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: 

removal of leading zeros for material no. in report

Former Member
0 Kudos

hi

my issue is that i have to remove leading zeros for material number when displaying in alv grid.iam getting output.but leading have to truncated automatically.

eg: 000000000000000102

the ouput should be 102.

please do provide solution for this or any function module.thanks in advance.

10 REPLIES 10

gopi_narendra
Active Contributor
0 Kudos

use the fm :CONVERSION_EXIT_MATN1_OUTPUT

its a conversion exit for MATNR

Regards

Gopi

Former Member
0 Kudos

hi

use this function module

CONVERSION_EXIT_ALPHA_OUTPUT- converts any number with zeroes right into a simple integer

Former Member
0 Kudos

to supress zeroes , use FM CONVERSION_EXIT_ALPHA_OUTPUT

try with this

regrds

karthik

rainer_hbenthal
Active Contributor
0 Kudos

if wa_fcat is your prefix for the fieldcatalog, just add

wa_fcat-no_zero = 'X'.

to the settings of that field in the fieldcatalog.

Former Member
0 Kudos

Hi sanjana

You can delete the leading zero by using the shift operator as follows:

SHIFT <field-name> LEFT DELETING LEADING 0.

You can also use the Conversion exit for MATNR for this purpose.

CONVERSION_EXIT_MATN1_OUTPUT

THanks,

Vijay

<b>PLZ reward points if helpful</b>

Former Member
0 Kudos

Hi Sanjana,

You can try this function module CONVERSION_EXIT_ALPHA_OUTPUT. INPUT parameter is your material no. and OUTPUT is your result after truncate the leading zero infront.

Hope this help.

Thankyou.

Cheers.

Former Member
0 Kudos

Hi

You can use

shift Matnr left deleting leading ' 0 '.

Reward if useful.

Regards

Shibin

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Use pack statement.

pack v_matnr to v_matnr.

Former Member
0 Kudos

Hi,

Use FM <b>CONVERSION_EXIT_MATN1_OUTPUT</b>

OR

<b>SHIFT itab-matnr LEFT DELETING LEADING '0'</b>

Thanks,

Sriram Ponna.

Former Member
0 Kudos

Hi Sanjana,

while populating the internal table use the conversion exit available for MATNR. this will remove the leading zeros.

oter possible way, declare the internaltable by referring the data element MATNR, i hope if you do this, it will delete the leading zeros automaticallt.

or if you declare the internal table field as charecter type, use the ALPLA_CONVERSION_EXIT_INPUT ot OUTPUT function module to remove the leading zeros.

Reward the points if it is helpful..