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

how to remove leading zero from matrial no

laxman_sankhla3
Participant
0 Likes
5,798

hi

i want to remove leading zero from matrial no

thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
4,048

Hi,

SHIFT MATNR LEFT DELETING LEADING '0'.

Regards

Nicole

hi

i want to remove leading zero from matrial no

thanks.

10 REPLIES 10
Read only

Former Member
4,048

use the coversion exits.

ex:coversion_exit_alpha_input

Read only

Former Member
4,048

Hi,

use the FM "CONVERSION_EXIT_MATN1_OUTPUT" for Material and removing the leading zero's.

for adding the leading zero's you cn use "CONVERSION_EXIT_MATN1_INPUT" FM.

Or you can use

Shift <your variable of field> left deleting leading '0'

rewards if useful,

regards,

nazeer

Read only

Former Member
4,049

Hi,

SHIFT MATNR LEFT DELETING LEADING '0'.

Regards

Nicole

Read only

0 Likes
4,048

Dear sir/madam,

Thank you for your help, i have been trying to create and use FM like Conversion exit alpha output.

here is an example code for your solution, i wrote this to the catalog part of my alv.

LOOP AT gt_sat INTO wa_sat.
SHIFT wa_sat-matnr LEFT DELETING LEADING '0'.
MODIFY gt_sat FROM wa_sat.
ENDLOOP.

Read only

matt
Active Contributor
4,048

zynp

You have chosen the wrong solution. It does not work in all cases. Try the one from nazeer shaik, which will allow you go in both directions.

Read only

former_member182371
Active Contributor
4,048

Hi,

try with fm 'CONVERSION_EXIT_ALPHA_OUTPUT'.

Best regards.

Read only

Former Member
4,048

Hi Laxman,

Use FM <b>CONVERSION_EXIT_MATN1_OUTPUT</b>

Reward points if helpful.

Regards,

Hemant

Read only

former_member188827
Active Contributor
0 Likes
4,048

u can also move material number to a type c variable and den use dis statement..

data zmatnr(15) type c.

move wa-matnr to zmatnr.

shift zmatnr left deleting leading '0'.

Read only

Former Member
4,048

hi

use the conv routine CONVERSION_EXIT_MATN1_OUTPUT

CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'

EXPORTING

input = matnr

IMPORTING

OUTPUT = matnr

.

Regards

Ravish Garg

Reward if useful

Read only

Former Member
4,048

Hi Laxman,

MATNR field has conversion routines, which it contain two F.M one is INPUT and other is OUTPUT. you can check it by yourself, go to field any table select the domain for matnr field and double click on it, it opens the data element screen in that double click on domain name then it opens the domain screen in that you can find the conversion routine under 'output characteristics' column, doble click on it then it dispalys corresponding F.Ms.

'INPUT' F.M used to convert the data into sap format and

'OUTPUT' F.M used to convert the sap into narmal data.

for ur scenario u can use the 'output' F.M which is below one

Use FM : <b> CONVERSION_EXIT_MATN1_OUTPUT</b>

<b>Reward points if helpful.</b>

Regards,

Vijay