Skip to Content

Export CL_SALV_TREE to Excel with XLSX Workbench

related page 1
related page 2
related page 3

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

Let’s use standard demo report SALV_DEMO_TREE_SIMPLE is available in the every system (the report demonstrates how to use CL_SALV_TREE control). We export this CL_SALV_TREE to the Excel based form.

1 PREPARE A PRINTING PROGRAM.

1.1 Copy standard demo report SALV_DEMO_TREE_SIMPLE to the customer namespace, for example Z_SALV_DEMO_TREE_SIMPLE :

IMG_01.PNG

1.2 In the copied report, add new button to GUI-status ‘100’:

IMG_02.PNG

1.3 In the report line number 261, insert next code to processing the new OK-code :

IMG_03.PNG

1.4 Activate objects:

IMG_4.PNG

2 PREPARE A FORM.

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

IMG_05.PNG

Empty form will be displayed:

IMG_06.PNG

2.2 Push button444_19_2.PNGto save the form.

2.3 Assign context CL_SALV_TREE to the form:

IMG_07.PNG

Herewith, you will be prompted to create a form’s structure automatically (based on context):

IMG_08.PNG

Press the button IMG_08a.PNG.

The Tree component will be automatically added to the form structure :

IMG_08b.PNG

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

IMG_09.PNG

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

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

IMG_10.PNG

2.8 Activate form by pressing button444_30.PNG.

3 EXECUTION.


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

IMG_13.PNG

IMG_14.PNG


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


IMG_15.PNG

7 Comments
You must be Logged on to comment or reply to a post.