Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using Check table after dynamic selection

Former Member
0 Likes
544

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

3 REPLIES 3
Read only

Former Member
0 Likes
492

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
492

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

Read only

Former Member
0 Likes
492

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)