‎2007 Nov 23 6:02 AM
HI gurus!
in my program , i have matnr code of 18 char and which is in selection option of the program.But i want matnr only starting with 5 which is 14th char in the code and matnr code enter in the select option.
so i tried
WHERE a~vkbur IN area AND
b~matnr in mat AND
b~matnr = '_____________5____' and
b~matnr = '%5____' and
Regards,
Rahul
‎2007 Nov 23 6:05 AM
make the selection parameter as 5 char field.. instead of matnr
AT SELECTIO-SCREEN OUTPUT event check if the value of this selection opion starts with 5.. if yes then proceed further and shift this 5char value in actual matnr...
if the value does not start with 5 then give error and STOP. this will not let the user go ahead till user enters matnr starting with 5.
‎2007 Nov 23 6:07 AM
hi you can get MATNR starting with 5 using b~matnr eq '5%'. but you cannot get matnr starting with 5 and where 5 is the 14th character using SELECT statement.
first you get MATNR's starting with 5 and then use logic to find out whether it's 14th character or not...
if matnr+14(1) eq '5'....like that
‎2007 Nov 23 6:50 AM
WHERE a~vkbur IN area AND
bmatnr in mat AND substr(bmatnr,13,1) = '5'
‎2007 Nov 23 7:06 AM
‎2007 Nov 23 8:01 AM
Try
WHERE a~vkbur IN area AND
bmatnr in mat AND bmatnr+13(1) EQ '5'
‎2007 Nov 23 8:33 AM
try this..it will work definitely...
b~matnr like '_%5____'
Message was edited by:
Muthurajan Ramkumar