Application Development 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: 

How to find the specific value in Z table without knowing the column name

Former Member
0 Kudos

Hi Experts,

I need your help to fix the following scenario.

Scenario: I have more than 10 table and each table has different column names (column number also different). I need to check specific value is present in the 10 table. Its like a similar kind of find option.

Picture represent:

Ztable_01

Source_ 1Source_2Source_3
1XB
2AC
3VD

Ztable_02

Source_ 1Source_ 2Source_3Source_ 4
BMKN
CYJB
DZLA

For Example: I need to display the table Name if the table contains 'A' in any column. (Note we don't know the column name)

Please help me to fix this.

Note:

    

- I have tried where condition but for the where condition we need to know the column name.

- Just want to display the table name if contains specific value, no further action is required.

1 ACCEPTED SOLUTION

0 Kudos

Hello Siva,

use the dictionary-tables DD02L and DD03L, I think you find what you Need.

Greeting Peter

6 REPLIES 6

0 Kudos

Hello Siva,

use the dictionary-tables DD02L and DD03L, I think you find what you Need.

Greeting Peter

0 Kudos

Hi Peter,

I have checked the given table and I got some idea. But do we have option to find the specific value in table?

0 Kudos

Hi Siva,

If I understood your query correctly then I think you need to write the code as shown below for your given example.

you need to pass the where clause for all field of table since you don't know the field name.

select single * from Ztable_01 where source1  = 'A' or source2 = 'A' or source3 =  'A'.

if ay-subrc = 0.

write 'table name'.

endif.

you need to write the same code for Ztable_02...and so on...

Regards

Chudamani Gavel

0 Kudos

Hi Chudamani,

Thanks for your reply,

I have more than 100 tables and each table has so many columns., that is the reason I asked, do we have option to find the specific value in Z table.

/Siva

0 Kudos

Hi Siva,

Always will remain develop a Z program which creates a dynamic internal table for each Z table and check the values in.

In fact , there is a standar report that dones exactly that, or something very similar: TABLE_SCANNER

I've just discovered it, but in some systems is deprecated.

Hope helps,

regards

0 Kudos

Hi Siva,

I have used the program TABLE_SCANNER named by Enrique.

This program is very useful for your wishes.

Please try it.

Greetings Peter