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

SHIFT MATNR

Former Member
0 Likes
1,471

ASSIGN COMPONENT 'MATNR' OF STRUCTURE <dyn_wa> TO <fs1>.

<fs1> = matnr.

I GET

IEQ00000000000003456

HOW I MAKE SHIFT

ONLY

3456

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,204

u can also try

char30 = <fs1>

data = char30+3.

9 REPLIES 9
Read only

Former Member
0 Likes
1,204

ru using select option....

it show that it is value for select option.

just write for display.

<b>field-low.</b>

Read only

Former Member
0 Likes
1,204

Hi LIat,

use the command.

shift variable 3 places.

Read only

Former Member
0 Likes
1,204

hi

try this...

<fs1>-low = matnr.

Regards,

Ramesh.

Read only

Former Member
0 Likes
1,205

u can also try

char30 = <fs1>

data = char30+3.

Read only

0 Likes
1,204

Hi you can use following syntax for that

SHIFT <c> LEFT DELETING LEADING <str>.

regards,

sumit.

Read only

0 Likes
1,204

To get rid of leading zeros on your material numbers, you need to convert to external form. Use the function module CONVERSION_EXIT_MATN1_OUTPUT. If you are assigning correct, I don't see any reason why there should be IEQ on the front of your string.

report zrich_0001.

data: matnr type mara-matnr value '000000000000012345'.


call function 'CONVERSION_EXIT_MATN1_OUTPUT'
     exporting
          input  = matnr
     importing
          output = matnr.


check sy-subrc  = 0.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,204

use this code

data : char(20) value 'IEQ00000000000003456'.

SHIFT char LEFT DELETING LEADING 'IEQ'.

SHIFT char LEFT DELETING LEADING '0'.

write char.

reward if find helpful.

regards,

sumit.

Read only

Former Member
0 Likes
1,204

As you have MATNR in internal format, use the Conversion Exit output to convert it to external format "3456".

Thus:

WRITE <FS1> TO R_MATNR-LOW USING EDIT MASK '==MATN1'.

Or

CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING input = <FS1>
IMPORTING output = R_MATNR-LOW.

Richard posted his reply while I was still typing.

MattG.

Message was edited by: Matthew Gifford

Read only

Former Member
0 Likes
1,204

data: v_matnr like mara-matnr.

v_matnr = s_matnr-low.

call function 'CONVERSION_EXIT_MATN1_OUTPUT'

exporting

input = v_matnr

importing

output = v_matnr.