‎2010 Oct 08 1:38 PM
Hi Friends,
DB A006 is described dynamically using concatinate.
Concatinate 'var1' 'var2' into var3 --> result = A006
1.
I want to describe var3 using the method cl_abap_typedescr=>describe_by_data
Q:
Is this possible. If yes, please how??
2.
I then want to access the compoment field of var3. Example A003-KSCHA
Q:
Is this possible. If yes, please how??
3.
If point 2 above is successful, I want to access the Check table of A003-KSCHA (T681A)
Q:
Is this possible. If yes, please how??
Ys,
Blacky
‎2010 Oct 11 5:46 AM
Hi,
If A006 is a table name then you can find the it's field information using fm DDIF_FIELDINFO_GET, you also get the check table name for every field from the o/p of the function module.
Regards,
Amitava
‎2010 Oct 11 8:05 AM
Hello,
Answer to all your question is YES! Check the code below for the details:
PARAMETERS: p_table TYPE tabname OBLIGATORY.
DATA: lcl_struc TYPE REF TO cl_abap_structdescr,
it_ddic_detail TYPE ddfields,
wa_ddic_detail TYPE dfies.
lcl_struc ?= cl_abap_typedescr=>describe_by_name( p_table ).
* Check if the structure is DDIC
CHECK lcl_struc->is_ddic_type( ) = 'X'.
it_ddic_detail = lcl_struc->get_ddic_field_list( ).
READ TABLE it_ddic_detail INTO wa_ddic_detail
WITH KEY fieldname = 'KSCHL'.
CHECK sy-subrc = 0.
WRITE: 'Check table for KSCHL:', 30 wa_ddic_detail-checktable.BR,
Suhas
‎2010 Oct 12 1:45 PM
Thank u all for your suggestion, but i have solved this problem myself.
How?
1. I selected all fields of database DD03L Dynamically...
Select * from dd03l into table itab where tabname = my_dynamic_table_value
2. Loop over ITAB into WA_ITAB
§. Dynamic selection of CHECKTABLE...
DATA: line(72) TYPE c,
list LIKE TABLE OF line .
Select (gs_filedname_of_check_table) into table LIST from (my_dynamic_checktable_value)