Output factory4/6/2023 Selecting a layout would display its output with that layout. Selection screen: I have created ALV layouts from the output screen. Gr_layout->set_initial_layout( value = set_lay ). It provides the values of Saved layout in the F4 Help. The saved layouts can be added to the selection screen as F4 Help and a specific layout can be set as default. The saved layouts are displayed as shown. Hence, the different versions of layouts can be obtained in a go without altering it every time. Provide the values to the Layout and Name and save it. I have applied a sort and a filter in the below screenshot.Ĭlick on the Save layout Icon. Using them, We can alter the ALV Layout and Save that layout by giving some name to it. Gr_layout->set_save_restriction( cl_salv_layout=>restrict_none ).Ĭalling the above methods allows user to Save the Layouts and select the saved layouts when needed. Calling the following methods before calling display would do that. Observe that the option to save the layout is still not available. Now the output is shown with Sort, Filter, Export, etc., Gr_display->set_striped_pattern( abap_true ). Gr_display->set_list_header( 'Material Details ' ). Gr_display = lr_alv->get_display_settings( ). ** To Display the Sort, Filter Export, Etc. DATA: gr_functions TYPE REF TO cl_salv_functions.ĭATA: gr_display TYPE REF TO cl_salv_display_settings. To get them, add the following code before calling the display method. The ALV output does not have any of the sort, filter or other such options when called using factory method. R_salv_table = lr_alv " Basis Class Simple ALV Tables SELECT a~matnr, a~mtart, a~matkl, a~meins,ĭELETE ADJACENT DUPLICATES FROM lt_output COMPARING ALL FIELDS. Let us assume the following query where Material details from tables MARA (Material Master), MAKT (Material Description) and MARC( Plant Data for Material ) as shown below. This blog post explains the approach to achieve the requirement using Factory Method. User case: In some situations, user may want to see only few fields in his output of the ALV or he may want to see different version of layout from the one being displayed.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |