2007 Apr 18 3:50 PM
Hello experts,
I have a dynamic SELECT with different fields in the WHERE-clause. But in some tables on which the SELECT operates, the field mentioned in the WHERE-clause is not part of it and a DUMP is the result.
So is there a way to check, if all fields of the WHERE-clause are part of the table, before execute the SELECT-statement?
thx
2007 Apr 18 3:55 PM
Sure, you can come up with some logic and check the field names using the table DD03L. This table will give you the field names for the database table.
Regards,
Rich HEilman
2007 Apr 18 3:55 PM
2007 Apr 18 3:58 PM
Or you could use the RTTS services to retreive the names of the fields of a table.
report zrich_0001 .
type-pools: abap.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_descr type ref to cl_abap_structdescr.
selection-screen begin of block b1 with frame title text .
parameters: p_table(30) type c.
selection-screen end of block b1.
* Get the structure of the table.
ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_descr->components[].
loop at idetails into xdetails.
write:/ xdetails-name.
endloop.
Regards,
Rich Heilman
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |