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

Convert material number

Former Member
0 Likes
12,478

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
Read only

Former Member
0 Likes
6,321

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

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

7 REPLIES 7
Read only

Former Member
0 Likes
6,322

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

Read only

marcelo_ramos1
SAP Mentor
SAP Mentor
0 Likes
6,321

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

Read only

0 Likes
6,321

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

Read only

former_member156446
Active Contributor
0 Likes
6,321
CONVERSION_EXIT_MATN1_INPUT    Function Module for Material Number Conversion (INPUT)
CONVERSION_EXIT_MATN1_OUTPUT   Function Module for Material Number Conversion (OUTPUT)
Read only

faisalatsap
Active Contributor
0 Likes
6,321

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

Read only

Former Member
0 Likes
6,321

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.

Read only

Former Member
0 Likes
6,321

Thanks guys for the solution.