Add alv tree already exists check to pbo module
The following ABAP code and information is part of the example ALV tree report demo and adds an "already exists?" check to the pbo module, to ensure it is not created again. Simply follow the below instructions and copy and paste the ABAP code into the appropriate include(PBO).
*---------------------------------------------------------------------------------* ***INCLUDE ZDEMO_ALVTREEO01 . *---------------------------------------------------------------------------------* *&-------------------------------------------------------------* *& Module STATUS_0100 OUTPUT *&-------------------------------------------------------------* * text *---------------------------------------------------------------------------------* MODULE status_0100 OUTPUT. SET PF-STATUS 'STATUS1'. * SET TITLEBAR 'xxx'. * If ALVtree already exists then it mush not be re-created as this * will cause a runtime error. IF gd_tree IS INITIAL. * Create ALVtree (must be performed within screen PBO module) PERFORM create_alvtree_container. PERFORM create_object_in_container. PERFORM create_empty_alvtree_control. PERFORM create_alvtree_hierarchy. ENDIF. CALL METHOD cl_gui_cfw=>flush. ENDMODULE. " STATUS_0100 OUTPUT
Return to the full list of instructions on how to create an example ALV tree report and find the next steps required to create the fully working demo.