‎2007 Aug 14 5:34 PM
Hi Gurus,
I have material number 47890858250, but I have defined my material number field to be 18 characters. Moreover I need to extract 6-10 characters of that material number, so in this case it should return 04789 from the material number 0000000047890858250
but it is returning 58250, and to avoid this I have written following code but then also I am getting the same wrong number
move it_temp_item-prodid to v_prodid_hier2.
if v_prodid_hier2+0(1) = '0'.
shift v_prodid_hier2 left deleting leading 0.
move it_temp_item-prodid(18) to v_prodid_hier2.
shift v_prodid_hier2 right deleting trailing space.
overlay v_prodid_hier2 with '000000000000000000'.
it_temp_item-v_matnr = v_prodid_hier2+6(5).
else.
move it_temp_item-prodid(18) to v_prodid_hier2.
it_temp_item-v_matnr = v_prodid_hier2+6(5).
can you help me out.
Thanks
Rajeev Gupta
‎2007 Aug 14 5:47 PM
HI,
Pass the material number to
Conversion_exit_alpha_input
exporting
input = v_matnr
importing
output = v_matnr.
v_required = v_matnr+6(5).
Thanks
Mahesh
‎2007 Aug 14 5:38 PM
Hi
Pass the value 47890858250 to the fun module
CONVERSION_EXIT_ALPHA_OUTPUT
you will get all 18 char field
then you can do the offsetting for the required data
v_field = matnr+6(5) will give the 04789
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Aug 14 5:44 PM
Thanks for the reply but can you be more specific...I mean can you explain with an example..
Thanks
Rajeev
‎2007 Aug 14 5:47 PM
HI,
Pass the material number to
Conversion_exit_alpha_input
exporting
input = v_matnr
importing
output = v_matnr.
v_required = v_matnr+6(5).
Thanks
Mahesh
‎2007 Aug 14 5:59 PM
Thanks for the reply,
I passed my material no. in the function module, but then also it showing me the same.
my material no. field is - v_matnr
and my material no. is 45300888550
and I want to it to be 000000045300888550
Thanks
Rajeev Gupta
‎2007 Aug 14 6:03 PM
Hi Rajeev,
Define
DATA v_matnr TYPE mara-matnr.
Now use
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
.....= v_matnr
IMPORTING
....= v_matnr
Regards,
Atish
‎2007 Aug 14 6:05 PM
Check the below program :
data : v_matnr(18) type c.
data : v_required(5) type c.
start-of-selection.
v_matnr = '45300888550'.
Conversion_exit_alpha_input
exporting
input = v_matnr
importing
output = v_matnr.
v_required = v_matnr+6(5).
write:/ v_matnr,v_required.
Thanks
Seshu