‎2006 Aug 03 1:40 PM
if move_type_wa-matnr CO '0123456789'.
unpack move_type_wa-matnr to move_type_wa-matnr.
endif.
What is wrong with this code?
Value of matnr is all numbers and it fails the camparision operator. SY-FDPOS is 5 when i debug the program but it skips the unpacking or matter of fact any statement with in the if statement.
Thanks in advance.
Eda
‎2006 Aug 03 1:41 PM
Try
if move_type_wa-matnr CO '0123456789 '.
unpack move_type_wa-matnr to move_type_wa-matnr.
endif.
*add the space character in '0123456789 ' .
Regards,
ravi
‎2006 Aug 03 1:41 PM
Try
if move_type_wa-matnr CO '0123456789 '.
unpack move_type_wa-matnr to move_type_wa-matnr.
endif.
*add the space character in '0123456789 ' .
Regards,
ravi
‎2006 Aug 03 1:42 PM
use <b>condense move_type_wa-matnr</b> before the IF statement
as the length of MATNR is 18 i guess , so there may be spaces , condese and check out
‎2006 Aug 03 1:44 PM
Hi,
May be if your field if of type MATNR it contains also space character (" ") before numbers.
So the comparison should be CO ' 0123456789".
Just a guess...
Regards
Sylvain
‎2006 Aug 03 1:44 PM
hi KE,
Check whether the move_type_wa-matnr has the same value with which you are comparing and moreover always remember that Contains only (co) [ case sensitive ]
( this any how maynot be the problem ) here .,..
Regards,
Santosh
‎2006 Aug 03 1:47 PM
Hi Eda,
I think IF statement with CO is correct but I am expecting the MATNR may contain alphabet character O instead of zero or you placed alphabet character O instead of zero in CO string.
Thanks,
Vinay