I have list of 100 views for which I need to check if those views have fields A
and B
. If any of those 100 views uses those two fields, I need to display a message. Any existing function module will help.

- 11,934
- 5
- 22
- 48

- 21
- 1
- 1
-
Theres the CL_ABAP_TYPEDESCR API where you can read DDIC Views and check the field-structure. Maybe that's what you needed – Togo Oct 24 '16 at 10:53
2 Answers
Sujeet,
Function module ISB_TABLE_READ_FIELDS accepts a table or view name and returns a table of fields on the structure. If you don't have this function module, you can write your code to select entries from table DD03L, which is keyed on table name and contains all of the fields on all database table structures.
Once you have the list of fields, the code to implement the logic you want should be trivial.

- 11
- 2
-
1Thanks for the reply, the function module i used is DDIF_VIEW_GET which returns a table containing field names of the views . – Sujeet325 Oct 24 '16 at 04:45
I doubt there is an existing SAP Function Module to do this - I suspect you will have to write some ABAP or do some Excel manipulation.
I would expect that there is a table within SAP which defines views - I'm not sure which though.
If no-one suggests anything else I would use ST05 - "SQL Trace" to see which tables SAP reads when you call SE12 to look at the view you are interested in. You can look at the SELECT statements and see which tables it reads to get the view definition.
I just tried pressing F1 on a field in SE12 for a view to see if there was a mention of a table. The technical info made reference to a structure containing the string "DD27" - I had a look in SE16 for tables with similar names and DD27SV looks like it might help.
Have a look and see what you think - you'd need to query that table in some ABAP or extract to Excel and do equivalent manipulation there.

- 91
- 3