cancel
Showing results for 
Search instead for 
Did you mean: 

columns display dynamically in webdynpro alv

0 Kudos

Hello Webdynpro Experts,

i want display dynamically webdynpro alv, based on input values.

if the user enter the date 20th march,2015 to 24th,march 2015, then it should show the columns from 20th to 24th.

if the user enter the date 20th march,2015 to 26th,march 2015, then it should show the columns from 20th to 26th.

then after i have to add some more fields like employee_name and shift ..etc.

u can see bellow screen shot.

Thanks in Advance.

sam.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

hi,

thanks for replay

but your hiding the columns , but i need to display columns at run time.

please read the my post, what is Req.

sam

Former Member
0 Kudos

HI Sam p,

  you can write this logic inside the LOOP and HIDE which are not in required to show.

in your case. "date 20th march,2015 to 24th,march 2015,"


you must above date range so HIDE which are not falling in your date range.


LOGIC something LIKE;


     LOOP at columns WHERE

        columns-name LT 20thMarch 2015 AND

                                   lv_date GT 24thMarch 2015.

     <HIDE COLUMN LOGIC>.

     ENDLOOP.

                                 

Follow the COLumn name logic accordingly;


thanks,

Kiran

0 Kudos

HI Kiran,

Thanks for reply,

Can you explain briefly .

i can display edit alv. can you give after this code step by step.

Sam

Former Member
0 Kudos

you can loop through the columns and which one to hde

* Declare ALV config table

  data: ALV_CONFIG_TABLE  type REF TO CL_SALV_WD_CONFIG_TABLE.

  DATA: wd_table_usage TYPE REF TO if_wd_component_usage.

* 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.

* Get ALV component

  DATA: wd_table TYPE REF TO iwci_salv_wd_table.

  wd_table = wd_this->wd_cpifc_alv_comp( ).

  alv_config_table = wd_table->get_model( ).

* Declare variable to store column details

  DATA: column_settings TYPE REF TO if_salv_wd_column_settings,

        column          TYPE REF TO cl_salv_wd_column.

  column_settings ?= alv_config_table.

***************

*HIDE COLUMNS *

***************

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

  column->set_visible( if_wdl_core=>visibility_none ).