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: 

Transform characters to matnr type

Former Member
0 Kudos

Hi everyone,

I have a csv file input that contains matnr field which just have n characters ( ex.: 1000956) and i would like to transform this field into matnr type ( 18 characters => 000000000001000956) which is used in table.

Thank you for you answers.

Best regards.

Mathew.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can define a variable of type matnr and assign the value to it directly

OR

You can use the CONVERSION_EXIT_MATN1_INPUT

Function Module to convert it to internal format.

Regards,

Pramod

3 REPLIES 3

Former Member
0 Kudos

Hi,

You can define a variable of type matnr and assign the value to it directly

OR

You can use the CONVERSION_EXIT_MATN1_INPUT

Function Module to convert it to internal format.

Regards,

Pramod

rainer_hbenthal
Active Contributor
0 Kudos

shift textvar right deleting trailing spaces.
matnr = textvar.
overlay matnr with '000000000000000000'.

Former Member
0 Kudos

Hi,

try this:

DATA: matnr like mara-matnr.

*

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = '12345678'

IMPORTING

OUTPUT = matnr.

Regards, Dieter