Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9052

Re: Configuring List without FLUID

$
0
0

Hi Christopher,

 

If I understand your question then you want to display LIST dynamically without using FLUID.

Although I also understand you have tried GET_DEFAULT_CONFIG method as below.

 

*--> Adding Column to layout configuration

 

*--> tbl_list will contain all your columns

 

LOOP AT tbl_list ASSIGNING <fs_list_data>.

      TRY.

          io_layout_config->add_column(

            EXPORTING

              iv_name               =  <fs_list_data>-fieldname             " Component name

              iv_display_type       =  |{ lv_display_type }|                " TextValue

              iv_index              =  lv_index                             " Index value

              iv_header             =  |{ <fs_list_data>-field_text }|      " To convert the type

          ).

          CLEAR lv_display_type.

        CATCH cx_fpm_configuration.

ENDLOOP.

 

Try to add some code in GET_DEFINATION.

 

LOOP AT tbl_list ASSIGNING <fs_list>.                                               "all field names from config table

    APPEND INITIAL LINE TO et_field_description ASSIGNING <fs_field_description>.              "Setting table properties

    <fs_field_description>-read_only    = abap_true.

    <fs_field_description>-allow_filter = abap_true.

    <fs_field_description>-allow_sort   = abap_true.

<fs_field_description>-name = <fs_list>-fieldname.

ENDLOOP.

 

If your code gives dump then add below code,

 

*--> DUMMY starts

  TYPES: BEGIN OF ty_s,

    cust TYPE char10,

    END OF ty_s.

  DATA lt_data TYPE TABLE OF ty_s.

*--> DUMMY ends

 

 

  TRY.

    CATCH cx_root.

      eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( p_data = lt_data ).     "Adding blank dummy values to prevent dump

  ENDTRY.

 

 

Thanks-

Abhishek


Viewing all articles
Browse latest Browse all 9052

Trending Articles