ABAP ALV Tree tutorial to create a fully working ALVTree Control SAP dynpro program
The ALV tree report produced uses OBJECT METHOD functionality in-order to produce a
tree structured ALV output.
The creation of an ALVtree report first requires the creation of a simple program to build the ALV
details such as the fieldcatalog and to call a screen which will be used to display the ALVTree.
The screen should be created with a 'custom control' where you wish the ALVtree report to appear.
For the following example it will have the name 'SCREEN_CONTAINER'.
Creation of Main Program code, Data declaration and screen call
Creation of 'INCLUDES' to store ALVtree code
Create Screen along with PBO and PAI modules for screen
Define OK CODE(SY-UCOMM) variable
Add screen control to PAI module(INCLUDE Z......I01)
Create pf-status
Once you have the main program code in place to call the screen which will display the
ALVtree, you now need to setup the actual ALVtree and populate it. As this is screen
based(dialog) the display coding will be performed within the PBO screen module.
Therefor you need to add the following processes to the PBO(STATUS_0100) module
of the screen.
Create Custom control
Create Container
Create Object in Container
Set ALVtree table for first display
Create ALV Tree Hierarchy
Add 'does tree already exist?' check
ABAP code listing of PBO(..O01) and FORM(..F01) includes should now look like this
Further development to add additional functionality for user interaction, but not required for ALV tree to execute.
Change Toolbar
Register Events
More ALV Tree lessons and tutorials
If you want to break this down into more manageble chunks or see tutorials on specific ALV Tree tasks such as
add button, refresh, add user interaction etc.. please go to the main ALV tree menu