0
votes

I've got lt_result table as result of function module, just a usual internal table with 50+ columns.

So, I have to send that to ALV display, how to properly use that table as a source for REUSE_ALV_FIELDCATALOG_MERGE?

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
 EXPORTING
   I_PROGRAM_NAME               = sy-repid
   I_INTERNAL_TABNAME           = 'LT_RESULT'

This way it compiles, but won't get any fieldnames from that table. The same, when I try to use structure.

How do i get field names from given table to lt_fieldcat[] with shortest way possible?

3
Is using the (well-documented) SALV classes an option?vwegert
Uhm. Doesn't knew about it. But it helped, thanks.AlexanderK

3 Answers

2
votes

The shortest way possible is using SALV classes:

data: gr_table  type ref to cl_salv_table.

call method cl_salv_table=>factory
  IMPORTING
    R_SALV_TABLE = gr_table
  CHANGING
    t_table      = lt_result.

gr_table->display( ).

This way you don't need fieldcatalog at all.

1
votes
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
   exporting
     i_program_name                    = sy-repid
     i_internal_tabname                = 'LT_RESULT'
     i_inclname                        = sy-repid "< if you use top-include  
    changing
     ct_fieldcat                       = lt_fldcat[]

When declaring lt_result using TYPE and not using LIKE

-1
votes

x+(28%of342+71.78÷17.91)-102.98×4=298.09 Slav it