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: 

How to add spaces

Former Member
0 Kudos

Hi All,

Please tell me the way to convert MATNR into 18 chars if less than 18.

means

MATNR = 'abcde' to MATNR = 'abcse '.

it is necessary for READ_TEXT with object as 'MVKE' .

<removed_by_moderator>

Thanks & Regards,

Anuj

Edited by: Julius Bussche on Sep 15, 2008 1:51 PM

7 REPLIES 7

GauthamV
Active Contributor
0 Kudos

hi,

use these fm.

CONVERSION_EXIT_ALPHA_INPUT

CONVERSION_EXIT_ALPHA_OUTPUT.

former_member182354
Contributor
0 Kudos

Hi Use Functional module FIAA_FIELDCAT_ADD_SPACE...if matching your requirement...

Raghav

saranwin
Contributor
0 Kudos

Hi,

Use this Function Module ' CONVERSION_EXIT_ALPHA_INPUT ' to convert the Matnr 18 char length from less than 18 char length.

Revert back if you need more details.

Regards,

Saran

Former Member
0 Kudos

Use 'CONVERSION_EXIT_ALPHA_INPUT' to add zeroes to material to make total length material = 18.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = l_matnr

IMPORTING

output = l_matnr.

If material is alphanumeric, there is no need to add zeroes and make it of length 18. It will work as it is.

Regards,

Aparna Gaikwad

Former Member
0 Kudos

Hi,

Please try like this

data : matnr(18) type c value '12345 ',

text(10) type c.

concatenate matnr text into w_string RESPECTING BLANKS..

OR

Use FM

CONVERSION_EXIT_ALPHA_INPUT

CONVERSION_EXIT_ALPHA_OUTPUT.

hope it is helps

0 Kudos

Hi All,

Thanks a lot for the solution.

Regards,

Anuj

Former Member
0 Kudos

Hi,

Use the FMs.

CONVERSION_EXIT_MATN1_INPUT

CONVERSION_EXIT_MATN1_OUTPUT

CONVERSION_EXIT_MATN1_INPUT FM converts the material number to internal format.

Eg.

matnr = 1410 then it converts to internal

matnr = 000000000000001410.

if matnr = R100004 then it converts

matnr = R100004.

Regards,

Raju.