ABAP Web Dynpro – ALV Table Settings

Home / SAP / ABAP Coding / ABAP Web Dynpro – ALV Table Settings

Well, the next phase of my journey was the ABAP Web Dynpro ALV Table Settings.  I wanted to control things like the number of rows to display, what buttons should be available etc…

So after a little more research, I found that is pretty easy to do too.

Again we go to the WDDOINIT and add the follow code (or something like it ).

  data lo_cmp_usage type ref to if_wd_component_usage.
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
DATA lv_value TYPE ref to cl_salv_wd_config_table.

*** instantiate the component
lo_cmp_usage =   wd_this->wd_cpuse_alv_comp( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv_comp( ).
*** get the ALV table
lv_value = lo_interfacecontroller->get_model( ).

*** Set Table Buttons and attributes
lv_value->IF_SALV_WD_TABLE_SETTINGS~SET_SCROLLABLE_COL_COUNT( value = 10 ).
lv_value->IF_SALV_WD_STD_FUNCTIONS~SET_EXPORT_ALLOWED( value = abap_false ).
lv_value->IF_SALV_WD_STD_FUNCTIONS~SET_PDF_ALLOWED( value = abap_false ).

this particular example turns off the print button (PDF Allowed), turns off the Export button (Export_Allowed), and sets the scrollable column count = 10.  Just because my particular table could be 100 columns wide.  So I want it to render nicely, and 10 is a pretty good number of columns.  In addition, I’m leaving the settings button available, so a user can make his own settings if he doesn’t like my default.  I really like this ALV stuff 🙂

Alright, back to it.  Thanks for reading,

As always, thanks for reading and don't forget to check out our SAP Service Management Products at my other company JaveLLin Solutions,
Mike

Leave a Reply

Your email address will not be published. Required fields are marked *