Using TYPE and LIKE while defining a local structure.
I was debugging an ALV report, the output internal table had fields with mixed definitions. Some fields were defined as LIKE and some under TYPE (BUKRS LIKE ....; LIFNR TYPE... ). The data was flowing correctly into the output internal table, but the ' REUSE_ALV_FIELDCATALOG_MERGE' is not recognizing the fields that are defined with a TYPE statement. As a result these fields were not getting displayed in the ALV output. I have changed all the definitions to LIKE and everything is working fine and all the fields are getting displayed correctly.
So my question is - We cannot use mixed definitions while defining an internal structure? If there are mixed defenitions fieldcatalog_merge will recognize only LIKE?
The question might be silly, but I want to gain some knowledge on this. Thank you for sharing your knowledge.
Please check the FM REUSE_ALV_FIELDCATALOG_MERGE documentation and you will know what you need.
Create field catalog from dictionary structure or internal table
Supports the creation of the field catalog for the ALV function modules based
either on a structure or table defined in the ABAP Data Dictionary, or a
The program-internal table must either be in a TOP Include or its Include
must be specified explicitly in the interface.
The variant based on a program-internal table should only be used for rapid
prototyping since the following restrictions apply:
- Performance is affected since the code of the table definition must always
be read and interpreted at runtime.
- Dictionary references are only considered if the keywords LIKE or INCLUDE
STRUCTURE (not TYPE) are used.
If the field catalog contains more than 90 fields, the first 90 fields are
output in the list by default whereas the remaining fields are only available in
the field selection.
If the field catalog is passed with values, they are merged with the
'automatically' found information.
Hope this helps.