Remove ALV Buttons on SAP Web Dynpro Component
In this SAP Web Dynpro tutorial I share ABAP codes showing how to remove standard ALV buttons like APPEND, INSERT or DELETE with ABAP programmers. On default view of an Web Dynpro ALV there are a numerous buttons which developers can require to hide or remove from ALV table. Using ALV object Get_Model() method and using the methods from IF_SALV_WD_STD_FUNCTIONS interface ABAP programmers can customize the buttons on an SAP Web Dynpro component.
I'm using SALV_WD_TABLE ALV Component to display an internal table data on a SAP Web Dynpro page. Here is how ALV data is displayed with default settings.
As you see the following ALV buttons are displayed by default when the Web Dynpro page is displayed. Since I do not want a ALV functionality like Append Row, Insert Row or Delete Row on this SAP Web Dynpro component, I will hide these buttons or remove them using ALV configuration methods.
Following ABAP code fetches the model for the ALV which I will use for configuration of default buttons. This ABAP code will help me to remove ALV buttons that I do not need here in this case Append, Insert and Delete buttons for example.
After this line in ABAP code, ABAP programmers can use one of the below two ABAP code blocks to configure visibility of default ALV buttons on Web Dynpro page.
Or change the allowed or available attributes by using the ABAP_TRUE or ABAP_FALSE values as follows.
After ABAP programmers make changes on their codes and activate Web Dynpro component, resultant ALV table will be as follows. As seen in below screenshot Export button is allowed on the other hand Check, Append Row, Insert Row and Delete Row buttons are disabled and removed from the ALV table.