Skip to Content
0
Former Member
Feb 19, 2008 at 01:05 PM

ALV list with only 1 field

17 Views

Hi guru's,

I want to create an ALV list with only a char255 field.

<all_table> contains data of sflight and is of type sflight(dynamically).

I want to show the data as one line.

CALL FUNCTION 'DDIF_FIELDINFO_GET'
       EXPORTING
            tabname   = 'TPPARFIL'
            fieldname = 'LINE'
      TABLES
            dfies_tab = it_dfies.
  READ TABLE it_dfies INDEX 1.
  IF sy-subrc IS INITIAL.
  MOVE-CORRESPONDING it_dfies TO wa_fieldcat.
  wa_fieldcat-scrtext_s = 'Results:'.
    APPEND wa_fieldcat TO gt_fieldcat.
  ENDIF.
 t_output[] = <all_table>.

  CALL FUNCTION 'LVC_TRANSFER_TO_SLIS'
       EXPORTING
            it_fieldcat_lvc = gt_fieldcat
       IMPORTING
            it_fieldcat_alv = it_fieldcat_alv.
  PERFORM fill_alv_layout.
* Show list
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program = lv_repid
            i_grid_title       = sy-title
             is_layout          = gs_layout
            it_fieldcat        = it_fieldcat_alv[]
       TABLES
            t_outtab           = t_output
       EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
*&---------------------------------------------------------------------*
*&      Form  fill_alv_layout
*&---------------------------------------------------------------------*
  FORM fill_alv_layout.
    CLEAR: gs_layout.
    gs_layout-max_linesize         = 160.
    gs_layout-min_linesize         = 160.
    gs_layout-detail_initial_lines = 'X'.
    gs_layout-zebra                = 'X'.
    gs_layout-edit_mode            = 'A'.
    gs_layout-numc_sum             = 'X'.
    gs_layout-colwidth_optimize    = 'X'.
    gs_layout-window_titlebar      = sy-title.
    gs_layout-totals_only          = 'X'.
  ENDFORM.                    " fill_alv_layout

When I run this it only gives an empty view of the fields with type char255.

Regards,

Wim