04-03-2007 11:24 AM
Hi Abpers,
I want to make material number field 40 char long. meand if material number is 10 char long then 30 0's are added in it.
e.g.
if matnr = 123456789
then i want to convert it like matnr = 0000000000000000000000000000000123456789.
if matnr = 12345678901234567890 then i want,
matnr = 0000000000000000000012345678901234567890.
pl help me in this
Reward if useful
regards,
Kapil Soni
04-03-2007 11:31 AM
Hi Kapil ,
Use the <b>UNPACK</b> command.
Here is a sample code which does the same
data : v_matnr(40) type c,
v_mat type matnr.
v_mat = '123456789'.
unpack v_mat to v_matnr.
write v_matnr.
Regards
Arun
04-03-2007 11:25 AM
04-03-2007 11:29 AM
Hi Kapil,
Data: Mat_no(40) type c.
Mat_no = matnr. " material Number
Call Function 'CONVERSION_EXIT_ALPHA_INPUT'.
importing
Field = MAT_NO
Exporting
Field = MAT_NO.
Regards
Sudheer
04-03-2007 11:31 AM
Hi Kapil ,
Use the <b>UNPACK</b> command.
Here is a sample code which does the same
data : v_matnr(40) type c,
v_mat type matnr.
v_mat = '123456789'.
unpack v_mat to v_matnr.
write v_matnr.
Regards
Arun
04-03-2007 11:32 AM
hi,
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wf_version
IMPORTING
output = wf_version.
Example:
input = 123
output = 0000000000000...000000000000123
Rgds
Anversha
04-03-2007 11:33 AM
Hi...very simple..
just take..
data: w_numc(40) type n.
w_numc = matnr.
write: w_numc.
04-03-2007 11:35 AM
try the following code:
shift matnr right deleting traling space.
overlay matnr with '0000000000000000000000000000000000000000'.
<b>P.S.</b>: The number of zero's in the overlay statement is 40.
Reward all useful answers.
04-03-2007 11:36 AM
hi
just keep the matnr of type n size 40 and check out, ur porb will be solved.
data: matnr(40) type n.
04-03-2007 11:42 AM