03-02-2009 9:27 AM
Hi,
can anybody tell me, How to use where clause for dynamic table.
say I have dynamic selection screen with some select option fields on it, and I have to use that for filter the data in the dynamic table.. (It's table having archiving data-> and for archiving , as there is no data stored in tables, this table will contain the data from archive file and there is data pointer which points the data into internal table-> so it's dynamic. and I want to filter the data from this table using fields on dynamic seletion screen. Is there any way to do this?
Regards,
Mrunal
03-02-2009 9:59 AM
Hi,
you can dynamically construct your WHERE condition into string and then just call it. Check out ABAP documentation for dynamic where condition. It's well described there.
Cheers
03-03-2009 6:10 AM
03-03-2009 6:20 AM
Check below code from SAP help for dynamic where clause . Look for help on SELECT statement , you will get n no. of ex.
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.
03-03-2009 6:24 AM
04-10-2009 6:38 AM