Quantcast
Channel: ABAP Development
Viewing all articles
Browse latest Browse all 948

Export internal table to Excel with XLSX Workbench

$
0
0
related page 1
related page 2


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 «Process»:

IMAGE_9.PNG

Empty form will be displayed:

IMAGE_10.PNG

2.2 Push button444_19_2.PNGto save the form.

 

 

2.3 Assign context FLIGHTTAB to the form:

IMAGE_12.PNG

 

2.4 Add new sheet to a form:

IMAGE_14.PNG

 

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

IMAGE_17.PNG

 

 

2.6 Add a Pattern (HEADER LINE) to the Sheet:

IMAGE_26.PNG

 

 

2.7 Add a Loop to the Sheet:

IMAGE_29.PNG

 

2.8 Set context binding for created Loop:

IMAGE_23_.PNG

 

 

2.9 Add a Pattern (POSITION) to the Loop:

IMAGE_32.PNG

 

2.10 Add a Values to the Pattern (POSITION):

IMAGE_37.PNG

 

2.11 Make markup in the Excel template:

IMAGE_38.PNG

 

2.12 Set template binding for Pattern (HEADER LINE). To do it, you have to perform next steps successivery:
  • Select node PATTERN_HEADERLINE in the tree of the form structure;
  • Select cells range A1:I1 in the Excel template;
  • Press a button IMAGE_39.PNG located in the item «Area in the template» of the Properties tab.

IMAGE_42.PNG

 

 

2.13 Set template binding for Pattern (POSITION). To do it, you have to perform next steps successivery:
  • Select node PATTERN_POSITION in the tree of the form structure;
  • Select cells range A2:I2 in the Excel template;
  • Press a button IMAGE_39.PNG located in the item «Area in the template» of the Properties tab.
IMAGE_43.PNG

 

2.14 Set template binding for Values. To do it, you have to perform steps, described in the previous item. Mapping is figured below:
  • CORRID           (cell: A2)
  • CONNID           (cell: B2)
  • FLDATE            (cell: C2)
  • PRICE              (cell: D2)
  • CURRENCY     (cell: E2)
  • PLINETYPE      (cell: F2)
  • SEATSMAX      (cell: G2)
  • SEATSOCC      (cell: H2)
  • PAYMENTSUM (cell: I2)


2.15 Finally, you have to set template binding as figured below:

IMAGE_47.PNG

 

2.16 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



Viewing all articles
Browse latest Browse all 948

Trending Articles