Skip to Content
author's profile photo Former Member
Former Member

ALV list with only 1 field

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 19, 2008 at 01:37 PM

    hi,

    As per your code I think your internal table is empty. Please set debugger after internal table fill and check. If the data is there then please check your field catalog entry.

    Regards,

    Sachin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.