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: 

Convert material number

Former Member
0 Kudos

Hi,

Is there any SAP pre-defined function module to convert material number,

example: from 000000000000000085 to 85

example: from 000000000000000087 to 87

?

Thanks.

Tee

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Lee,

Use Conversion_exit_alpha_output to remove the zeros from the number.

Please search your query before posting the question..as there are lot of posts on the same

Thanks & Regards

Syed

7 REPLIES 7

Former Member
0 Kudos

Hi Lee,

Use Conversion_exit_alpha_output to remove the zeros from the number.

Please search your query before posting the question..as there are lot of posts on the same

Thanks & Regards

Syed

marcelo_ramos
Active Contributor
0 Kudos

Hi Tee,

Welcome to SDN Forums !

You must use the correct or most appropriate forum, so this thread will be moved from ABAP Objects to ABAP, General.

Please see the Forum Rules of Engagement before posting.

Also read this thread Welcome and Rules of Engagement.

Greetings,

Marcelo Ramos

0 Kudos

Hi,

You can use the function module CONVERSION_EXIT_MATN1_OUTPUT of the function group OMCV.

Pass the material number in 00000085 format to the exporting parameter INPUT, and receive the output in format 85 in the Importing parameter OUTPUT.

DATA: f_matnr type matnr value '0000085'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

input = f_matnr

IMPORTING

output = f_matnr.

Best Regards,

Suresh

Edited by: Suresh S on Mar 17, 2009 2:41 PM

former_member156446
Active Contributor
0 Kudos
CONVERSION_EXIT_MATN1_INPUT    Function Module for Material Number Conversion (INPUT)
CONVERSION_EXIT_MATN1_OUTPUT   Function Module for Material Number Conversion (OUTPUT)

faisal_altaf2
Active Contributor
0 Kudos

Hi,

Welcome to SDN

Please Search Before posting.

Test the following Sample code it will solve out your problem,

DATA: m(10) VALUE '0000000012'.

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

WRITE: m.

Best Regards,

Faisal

Former Member
0 Kudos

if you want SAP to store them as 85 instead of 000000000000085, you can set it in cutomizing under

lexographic settings.

where you can do a setting which will not add leading zero's while creating material itself.

Former Member
0 Kudos

Thanks guys for the solution.