Export ALV-Tree to Excel with XLSX Workbench

A+ A-
related page


NOTE: Before beginning, the XLSX Workbench functionality must be available in the your system.

 

Let's use standard demo report BCALV_TREE_02 is available in the every system (the report demonstrates how to use ALV-Tree control). We export this ALV-tree to the Excel based form.

 

1 PREPARE A PRINTING PROGRAM.

 

1.1 Copy standard demo report BCALV_TREE_02 to the customer namespace, for example Z_BCALV_TREE_02 :

444_5.PNG

 

 

1.2 In the copied report, add new button to GUI-status 'MAIN100':

444_14.PNG

 

 

1.3 In the report line number 29, write CL_HRPAYNA_GUI_ALV_TREE instead CL_GUI_ALV_TREE :

444_8.PNG

 

 

1.4 In the report line number 125, insert next code to processing the new OK-code :

444_112.PNG

 

1.5 Activate objects:

444_15.PNG

 

 

 

2 PREPARE A FORM.

 

2.1 Launch XLSX Workbench, and in the popup window specify a form name TEST_ALV_TREE , and then press the button «Process»:

444_19.PNG

Empty form will be displayed:

444_19_1.PNG

2.2 Push button444_19_2.PNGto save the form.

 

 

2.3 Assign context CL_HRPAYNA_GUI_ALV_TREE to the form:

444_19_55.PNG

 

2.4 Add new sheet to a form:

444_19_56.PNG

 

 

2.5 Assign created Sheet to worksheet in the Excel-template:

444_19_57.PNG

 

2.6 Add a Tree to the Sheet:

444_201.PNG

 

2.7 Assign created Tree to the context:

444_23.PNG

 

2.8 Make markup in the Excel template (read more here):

444_24.PNG

 

2.9 Assign Tree to the marked area (cells range A1:B5) in the Excel template.

To do that, select cells range A1:B5 in the Excel template, and then, press button with "pencil" in the item "Area in the template" of the Properties tab:

444_28.PNG

2.10 Activate form by pressing button444_30.PNG.

 

 

 

3 EXECUTION.


Run your report Z_BCALV_TREE_02; ALV-tree will be displayed :

444_41.PNG


Press button444_43.PNGto export ALV-Tree to Excel form :

444_42.PNG