ALV Reports Part 3: OO ALV with CL_GUI_ALV_GRID and a Custom Container
Preview · a free account unlocks the full lesson
Build the classic OO ALV used in most custom transactions: screen 100 with a custom control, CL GUI CUSTOM CONTAINER, CL GUI ALV GRID, LVC field catalog and layout, set table for first display, PBO/PAI modules and refresh table display.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Parts 1 and 2 covered full-screen ALVs that needed no screen of their own. CL_GUI_ALV_GRID is different: it is a GUI control placed in a container on your own dynpro screen, which gives you full control — events (covered in Parts 6 and 8), editing (Part 9), and even several grids on a single screen.
Building it requires a few pieces to come together. First, a screen — screen 100, created in SE51 or from SE80 — needs a Custom Control element on it, named something like CC_ALV. A GUI status, created in SE41, defines the BACK, EXIT and CANCEL functions, and gets set during PBO. The container itself is created with CL_GUI_CUSTOM_CONTAINER EXPORTING container_name = 'CC_ALV'. — or, as an alternative that needs no screen element at all, CL_GUI_DOCKING_CONTAINER. The grid itself is then created with CL_GUI_ALV_GRID EXPORTING i_parent = go_container.
The field catalog and layout here use LVC types rather than the SLIS types from REUSE_ALV: it uses LVC types (lvc_t_fcat, lvc_s_layo) — not the SLIS types of REUSE_ALV. LVC_FIELDCATALOG_MERGE, given i_structure_name, builds an lvc_t_fcat from the DDIC, after which individual entries can be adjusted for coltext, outputlen or do_sum. The layout structure lvc_s_layo covers things like zebra striping, cwidth_opt for automatic column widths, sel_mode set to 'A' for multi-row selection, and grid_title.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Code example
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
Keep exploring
Interview questions on this topic
Related SAP topics
Referenced SAP objects
Reviewed reference pages for the objects this page mentions.
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.