cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Columns in table /ALV

Former Member
0 Kudos

Hi ,

I need to decide number of columns at run time out of fixed number of coulmn in table.

one way of doing it through ALV column hiding but problem is what ever coloumns I hide programeticaly user can always to go ALV settings and unhide them and that defeats the purpose.

is there any otherway I can determine my number of columns dynamicaly.

It can be a table or ALV table.

Thanks

Gaurav

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

How about creating a dynamic node with the number of columns that you need?

Let me know if that helps. I have a code for creating cloumns dynamically.

Thank You.

Former Member
0 Kudos

Thanks, could you pl provide me that code.

Regards,

Gaurav

Former Member
0 Kudos

gaurav,

if Settings in Not needed in ALV you can Hide the settings too

Badari

Former Member
0 Kudos

Thanks Badri ,

and how to hide settings?

Regards,

Gaurav

Former Member
0 Kudos

Hi gaurav,

In d Do_init method ,

read the table following table

data : ls_function TYPE salv_wd_s_a_function_ref,

  • Disable Setting on ALV

READ TABLE wd_this->alv_config_table->

if_salv_wd_function_settings~t_functions

INTO ls_function

WITH KEY id = 'SALV_WD_SETTINGS'.

IF sy-subrc = 0.

ls_function-r_function->set_visible( cl_wd_uielement=>e_visible-none ).

ENDIF.

  • reward If Usefull

Former Member
0 Kudos

Gaurav,

r u trying to hide the settings?

Let me know if you still need the code for dynamic node and attributes?