2006 Oct 24 2:41 AM
hello,
if i want to use Dynamic Conditions in select,how can i do? Dynamic Conditions 'where'.
hello,
if i want to use Dynamic Conditions in select,how can i do? Dynamic Conditions 'where'.
2006 Oct 24 2:57 AM
Hi.
PARAMETERS: airline(2) TYPE C,
date TYPE D.
DATA: where_clause TYPE STRING,
connid TYPE sflight-connid.
CONCATENATE 'carrid = ''' airline ''''
' AND fldate = ''' date '''' INTO where_clause.
SELECT connid FROM sflight INTO connid
WHERE (where_clause).
WRITE: / date, airline, connid.
ENDSELECT.
2006 Oct 24 3:12 AM
Hello Hong
You can also use function module <b>RH_DYNAMIC_WHERE_BUILD</b> to automatically generate WHERE clauses consisting of AND conditions. The itab containing the WHERE clauses can, of course, be modified and adjusted.
Regards
Uwe
2006 Oct 25 12:27 PM
Hi,
TABLES: VBAK.
SELECT-OPTIONS S_VBELN FOR VBAK-VBELN.
DATA: lV_STR1(20) TYPE C VALUE 'VBELN IN S_VBELN.'.
DATA: GI_WHERE(72) OCCURS 0 WITH HEADER LINE.
GI_WHERE = LV_STR1.
APPEND GI_WHERE.
DATA GI_VBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.
SELECT VBELN
INTO TABLE GI_VBAK
FROM VBAK
WHERE (gi_where).
Regards
amole
2006 Oct 25 12:30 PM
Hi,
You can build a string of the where clause using the concatenate and then pass that string to select as follows.
SELECT FROM table into table itab where (where_string).
Regards,
Sesh