2008 Aug 22 8:53 PM
Hi,
I have around 5 fields which has to be checked in an Internal table. It is an AND condition.
I developed the logic to build the dynamic where clause by checking each of the 5 variables.
In one of the cases the where clause looks as below.
Lt_where_clause = ' AND PRODUCT_TYPE CP LV_PRODUCT_TYPE
AND PRODUCT_ID CP LV_PRODUCT_ID
AND CATEGORY_ID CP LV_CATEGORY_ID
AND PRODUCT_TEXT CP LV_PRODUCT_TEXT.'
Now I want to send this to
LOOP AT LT_PRODUCTS WHERE lt_where_clause.
...
ENDLOOP.
System doesnt allow me have a dynamic where clause. Does anyone have an idea how can the internal table be checked with dynamic where clause.
thanks,
Ashwin
2008 Aug 22 9:02 PM
2008 Aug 24 8:18 PM
Try this..
1)Build your code.
2)Use GENERATE SUBROUTINE POOL statement to generate the code at runtime.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |