![]() ![]() We usually set a unique key to make the different ALV layout settings unique between each other, and set a restriction for saving the layouts. Set the Layout Key and the Saving RestrictionĪs we get a CL_SALV_LAYOUT instance, there is nothing left then using its instance methods to set the expected behavior. Layout_settings->set_save_restriction( if_salv_c_layout=>restrict_none ). We are going to get and save an instance of the CL_SALV_LAYOUT in the variable, called LAYOUT_SETTINGS by calling the instance method of the CL_SALV_TABLE class, called GET_LAYOUT().ĭATA layout_settings TYPE REF TO cl_salv_layout. Let's implement it! As I mentioned above, to set the layout settings feature for an ALV list, first we should get an instance of the CL_SALV_LAYOUT class. ![]() ![]() We introduced a new subroutine above, named ENABLE_LAYOUT_SETTINGS. I like this approach, because it ensures a high transparency in our code without using unnecessary "dead comments".Īs I mentioned before, we are going to put our ALV settings into the subroutine, INITIALIZE_ALV in the following order: first we call the FACTORY() method of the CL_SALV_TABLE to get an instance of it, then call the subroutines that responsible for different settings. The development workflow is going to be really simple, namely we are going to organize the different settings (mentioned above) into small, clearly named subroutines, then place the calls of these routines one by one in the existing INITIALIZE_ALV subroutine under the FACTORY() method call. This method will give us an instance of the CL_SALV_LAYOUT class that we can use to enable the layout settings feature for the users. To provide this functionality, let me introduce you our first CL_SALV setting class, called CL_SALV_LAYOUT that we can use via the CL_SALV_TABLE's instance method, named GET_LAYOUT(). Today, my goal is to show you how to enable ALV layout settings for the users at the top of the ALV list. In the previous post, we already prepared the main ABAP program that responsible to display a flight schedule from database table, SPFLI in an ALV list using CL_SALV_TABLE class. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |