Skip to Content

Set field cataglog dynamically for an editable table

Hi All,

I have a requirement where to show a table whose field catalog will be changed conditionally( dynamically ) and that table has to be editable, in that table few columns could be Drop down fields and few columns are disabled and few can be normal editable fields.

What is the best way to do it, this i can achieve very well by in dynpro with CL_GUI_ALV_TABLE class, i am new to WDA , so i couldn't find the good solution.. whether to use direct table element or ALV component. can i acheive the above functionality with either of the option.

Appreciate your help.

Regards,

Shiva.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 16, 2010 at 11:50 AM

    Hi Shiva,

    Visible Colums:

    DATA: ALV_CONFIG_TABLE type REF TO CL_SALV_WD_CONFIG_TABLE.

    DATA: wd_table_usage TYPE REF TO if_wd_component_usage.

    DATA: wd_table TYPE REF TO iwci_salv_wd_table.

    DATA: column_settings TYPE REF TO if_salv_wd_column_settings,

    column TYPE REF TO cl_salv_wd_column.

    • Create an instance of ALV component created ALV_COMP is usage name

    wd_table_usage = wd_this->wd_cpuse_alv_comp( ).

    IF wd_table_usage->has_active_component( ) IS INITIAL.

    wd_table_usage->create_component( ).

    ENDIF.

    wd_table = wd_this->wd_cpifc_alv_comp( ).

    alv_config_table = wd_table->get_model( ).

    column = column_settings->get_column( 'MANDT' ).

    column->set_visible( if_wdl_core=>visibility_none ).

    There are many other Methods in class cl_salv_wd_column.

    For editable Colums (and DropDown e.g.) have a look at this tutorial:

    [SND-Tutorial - Conditionally Assigning Colors and Input Enable to ALV Columns|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0625002-596c-2b10-46af-91cb31b71393]

    Hope it helps!

    Add comment
    10|10000 characters needed characters exceeded