2006 Oct 24 7:10 PM
Hey Guys,
I want to create the dynamic where clause.
DATA: GI_WHERE(72) OCCURS 0 WITH HEADER LINE.
SELECT *
INTO TABLE GI_VBAK
FROM VBAK
WHERE (GI_WHERE).
In that where clause contain ranges.
for eg.
GI_WHERE = 'VBELN IN S_VBELN'.
2006 Oct 25 8:40 AM
Hi,
You can do this by building a String of what you want to put in the where clause.
Ex:
DATA: where_string type string.
concatenate where_string 'VBELN IN S_VBELN' into where_string separated by space.
Use it like this
SELECT * FROM table_name into table it_tab where ( where_string ).
Best Regards,
Sesh
2006 Oct 25 12:02 PM
Hi,
follow below logic.
data lv_str type string value 'GI_WHERE'.
lv_str1 type string value 'VBELN IN S_VBELN'.
DATA: GI_WHERE(72) OCCURS 0 WITH HEADER LINE.
CONCATENATE lv_str ' = '''lv_str1'''' '.'
INTO gi_where.
APPEND gi_where.
SELECT *
INTO TABLE GI_VBAK
FROM VBAK
WHERE (GI_WHERE).
Regards
amole
2006 Oct 27 9:37 AM
Hi,
you can't use the "in" within a dynamic clause.
Please refer to ABAP-keyword documentation of dynamic logical condition.
Regards
Olaf