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

Transform characters to matnr type

Former Member
0 Likes
1,737

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

Former Member
0 Likes
1,631

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

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.

3 REPLIES 3
Read only

Former Member
0 Likes
1,632

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

Read only

rainer_hbenthal
Active Contributor
0 Likes
1,631

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

Former Member
0 Likes
1,631

Hi,

try this:

DATA: matnr like mara-matnr.

*

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = '12345678'

IMPORTING

OUTPUT = matnr.

Regards, Dieter