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

Field value Where Used list program

sanjana_lingras
Active Participant
0 Likes
1,508


Hi Experts,

We want to implement utility for where used list for field value.

E.g. VKORG is the field and has value "US10" then program should give result with list of tables which have VKORG = "US10" value.

Any idea how can this be implemented?

Regards,

Sanjana

2 REPLIES 2
Read only

Former Member
0 Likes
538

Hi Sanjana,

So in selection screen you will give field name and its value.

Use table DD03L to find all the tables which has specified field in it.[In to one internal table]

then do selection query on all tables[Do loop on table and for each table select query with where clause with value given in selection]

If value found; then collect those tables into one final internal table.

Thanks,

Dharmishta

Read only

Former Member
0 Likes
538

Hi Sanjana,

Something like this (code snippet has several small bugs):

TABLES: dd03l.

PARAMETERS: p_field(30),

             p_value(30).

START-OF-SELECTION.

   DATA: lr_tab TYPE REF TO data.

   DATA: l_where TYPE string.

   FIELD-SYMBOLS: <ls_data> TYPE any,

                  <lt_data> TYPE ANY TABLE.

   SELECT * FROM dd03l WHERE fieldname = p_field. "and is a table...

     CONCATENATE dd03l-fieldname '= ''' p_value '''' INTO l_where. "there is a small error here

     CLEAR lr_tab.

     CREATE DATA lr_tab TYPE TABLE OF dd03l-tabname.

     ASSIGN lr_tab->* TO <lt_data>.

     SELECT * FROM (dd03l-tabname) INTO TABLE <lt_data> WHERE (l_where).

     LOOP AT <lt_data> ASSIGNING <ls_data>.

       WRITE: / dd03l-tabname. "and maybe key fields from <ls_data>

     ENDLOOP.

   ENDSELECT.