Skip to Content
Author's profile photo Igor Borodin

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

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Durga Prakash Jasti
      Durga Prakash Jasti

      Good one Borodin...

      Author's profile photo Former Member
      Former Member

      Спасибо! Очень круто. Особенно хорошо что все так подробно прокомментировано 🙂 .

      Author's profile photo Igor Borodin
      Igor Borodin
      Blog Post Author

      Limir, thank you a lot!

      But, non-English posts are undesirable here ( see The SCN Rules of Engagement , Item 4)

      Author's profile photo vamsilakshman p
      vamsilakshman p

      Hi Borodin,

      Nice Documentation. Can we compare this concept with ADOBE Forms Concept in sap abap?

      Very Intresting...!

      And how do we get XLSX Workbench on SAP System.

      Is this BASIS Guys work or our self do this?

      Author's profile photo Igor Borodin
      Igor Borodin
      Blog Post Author

      Hi Vamsilakshman,

      Yes, some principles are similar to Smartforms and AdobeForms.

      There are two ways of installing XLSX Workbench: Manually and via SAPLink tool .
      Of course, you must have developer role.

      Regards, Igor.

      Author's profile photo Former Member
      Former Member

      Outstanding work!  This is exactly what I was looking for.

      Author's profile photo Igor Borodin
      Igor Borodin
      Blog Post Author

      Thanks a lot !

      Regards, Igor