12-16-2008 9:58 PM
Hi,
I am building an ALV field catalog by referencing a Data Dictionary structure that I have defined. However, some of the fields do not use data elements - instead they are "built-in types" (i.e. where you enter the data type, length, and description directly instead of specifying a data element). Is there any way to get the field catalog to automatically use the direct field description of these fields? I am looking for a dynamic solution here that automatically leverages the field descriptions maintained directly in my structure.
I realize one solution is to call one of the data dictionary functions to read in the definition of my structure and then I could set the column heading according to the information I get back, but I was hoping instead that there was a setting or field I could use in the field catalog to simply tell it to use the field description as directly maintained in data dictionary for the column heading.
<<text removed>>
Thanks,
Lee
Edited by: Matt on Dec 17, 2008 8:38 PM - removed text perilously close to offering points
12-16-2008 10:08 PM
Hi Lee,
You can use FM REUSE_ALV_FIELDCATALOG_MERGE
First, you need to have a structure to get its attributes directly to the fieldcatalog
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = '<name of the structure>'
CHANGING
ct_fieldcat = i_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Thanks,
M
12-16-2008 10:22 PM
Ok, I thought that was obvious... I should have been clearer and stated that I am using 'REUSE_ALV_FIELDCATALOG_MERGE'; however, for those fields in the structure that are defined using "built-in types" I have not found a way to get the manually entered field descriptions automatically used as column headers. Of course, for the other fields that reference data elements in my structure the field labels are used as column headers.