I have run into a problem which makes me think I will have to either make a copy of a SAP standard program instead of modifying it, or suffer a large performance penalty, and I strongly dislike it...
The program (RIPLKO10 for transaction IA09) displays data using ALV. The requirement here is to provide an alternative transaction where the data structure has been extended with (quite a few) additional fields from several structures.
Obviously, I don't want to create a program copy since this will incur additional maintenance costs. I also would prefer not extending the data structure for the ordinary transaction since this will introduce a performance penalty.
I have modified the program's data structure and appended a field which is a dynamic (TYPE REF TO DATA) structure. If the Z-transaction is executed this field is created (it is a structure with fields + substructures), and data retrieved for it. This all works fine now.
However, there is little use in data which can not be displayed to the user, and this is where I have run into a problem. I am not able to create a field catalog which displays the data from the dynamic structure. I have tried using several different field names. When looking at the data table in the debugger the dynamic field can be accessed directly by referencing e.g. OBJECT_TAB[1]-ZDATA->PLKO-KTEXT.
I have tried using ZDATA->PLKO-KTEXT as field name in the field catalog, and I have tried using ZDATA-PLKO-KTEXT as field name. None of them work.
If I add the structure non-dynamically (TYPE zdata) there is no problem, by including an entry in the field catalog with reference to field ZDATA-PLKO-KTEXT the additional field's value is displayed.
Any ideas (apart from the obvious which is just adding the structure statically and suffer the penalty)?