9
I’m trying to expedite processes since several times we need generate reports in Alvs.
The idea is to get the metadata of a structure ( Field Name, Domain, Descriptive ) and thus generate the fieldcat in the ALV creation function and in the sequence manage to fill it.
Ex.:
Through the fields of the structure would fill the skeleton table.
CLEAR gs_s_fcat.
gs_s_fcat-fieldname = fieldname. " Nome do campo da Estrutura
gs_s_fcat-outputlen = size. " O tamanho do conteúdo
gs_s_fcat-tabname = table. " Tabela
gs_s_fcat-coltext = header. " Texto do cabeçalho
gs_s_fcat-col_pos = index. " Índice da coluna
gs_s_fcat-emphasize = style. " Estilo, cores e etc.
APPEND gs_s_fcat TO gt_t_fcat.
Calling the generic table creation.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
i_style_table = 'X'
it_fieldcatalog = gt_t_fcat
IMPORTING
ep_table = gt_generic_table
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
{...} - Fill a field-Symbol with the same structure and use it on the display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = sy-repid
is_layout = gs_layout
it_fieldcat = gt_t_fcat
TABLES
t_outtab = <fs_table>
EXCEPTIONS
program_error = 1
OTHERS = 2.
Ideas?
It will not be easy to find someone who can answer, but the question is interesting. It is likely that you need to bring experts in the subject to the site :)
– Maniero
It’s true @bigown, we need more abapers' :)
– Don
I’ve done something similar. I know there’s a table that stores the fields of the tables and structures but I can’t remember what it was. I found on google DD03L and DD03T, maybe these are.
– Joqus