Skip to Content
Author's profile photo Igor Borodin

Export internal table 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 BCALV_GRID_DEMO is available in the every system (the report demonstrates how to use ALV-Grid control). We will export an output table to the Excel based form.

1 PREPARE A PRINTING PROGRAM.

1.1 Copy standard demo report BCALV_GRID_DEMO to the customer namespace, for example Z_BCALV_GRID_DEMO :

IMAGE_4.PNG

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

IMAGE_5.PNG

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

IMAGE_7.PNG

1.4 Activate objects:

IMAGE_8.PNG

2 PREPARE A FORM.

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

IMAGE_9.PNG

Empty form will be displayed:

/wp-content/uploads/2014/11/444_19_1_760393.png

2.2 Push button444_19_2.PNGto save the form.

2.3 Assign context FLIGHTTAB to the form:

IMAGE_12.PNG

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


We will create form structrure manually,

therefore we should press the button

2.4 Add a «Grid» component into the Sheet:

IMAGE_26.PNG

2.5 Make markup in the Excel template:

IMAGE_38.PNG

2.6 Select the «Grid» component node and go to the Properties tab:

  1. Select the marked cell range in the Excel-template and press the button IMAGE_39.PNG located in the Item «Area in the template»

  2. Press the button IMAGE_39.PNG in the Item «Value» and pick the Context Table (FLIGHTTAB) from the popup-list.
  3. Press the button IMAGE_98.PNG in the Item «Layout options» and choose columns for output.

IMAGE_99.PNG

2.7 Activate form by pressing button444_30.PNG.

3 EXECUTION.


Run your report Z_BCALV_GRID_DEMO; ALV-grid will be displayed :

IMAGE_48.PNG


Press button444_43.PNGto export Grid to Excel form :

IMAGE_49.PNG


Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Looks great. Hope to have some time soon an test it myself. Thank you.

      Author's profile photo Former Member
      Former Member

      Igor - you are just amazing..

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

      Thank you, Raghavendra

      Author's profile photo Hailong Lu
      Hailong Lu

      Great job!

      It's the greatest open source project in ABAP environment.

      Thanks for your share.

       

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

      Hailong, thank You!