2008 Aug 13 11:46 AM
Hello experts,
I have this statement:
LOOP AT i_sorg WHERE q = quality
AND s = size
AND v = variant.
....
....
APPEND i_result.
ENDLOOP.
However for the size I need to give the user to enter wild cards "*"as well as ?. If the size contains "" the loop doesn't find the record. If I translate the "" in to "%" it doesn't run either so what should I do that the WHERE statement find the record.
Thanks
2008 Aug 13 12:16 PM
Hi,
Try this...
Data: vSize(10).
IF size = ''.
vSize = '*'.
ENDIF.
LOOP AT i_sorg WHERE q = quality AND s CP vSize AND v = variant.
....
....
APPEND i_result.
ENDLOOP.
Hope it helps.
Murthy
2008 Aug 13 11:48 AM
use the LIKE operator instead of "=" combined with the wild cards "%" and "_".
Thomas
Edit: operator CP with "*" and "+" should work as well.
Edited by: Thomas Zloch on Aug 13, 2008 12:51 PM
2008 Aug 13 11:49 AM
2008 Aug 13 11:50 AM
Hi,
Inside loop put check for the charecter '*' using FIND and use sy-subrc for your action.
Sudheer. A
2008 Aug 13 11:52 AM
Hi,
Inside loop check fop the charecter '*' using FIND and then if sy-subrc = 0 then do your action.
Sudheer. A
2008 Aug 13 11:53 AM
2008 Aug 13 12:16 PM
Hi,
Try this...
Data: vSize(10).
IF size = ''.
vSize = '*'.
ENDIF.
LOOP AT i_sorg WHERE q = quality AND s CP vSize AND v = variant.
....
....
APPEND i_result.
ENDLOOP.
Hope it helps.
Murthy