..2 Form

The Form's source is here .

How to import Form into the system see here .



Create and save a new form

Launch an XLSX Workbench, and create a new form with name ORGUNIT_HIERARCHY_2 .


Assign a context to the form


Assign a context ZCONTEXT_ORGUNIT_HIER_TAB to the form

When an automatically creation of the Form structure will be prompted, you should press the button   to create a structure manually.


Markup of template

Markup an Excel-template as shown below :

ALV_TREE to Excel
 

Go to Excel menu: Data > Outline and uncheck the checkboxes in the popup-window (if they are not set):


Create a Form structure

Add the new components into form structure as shown in the picture below:

ALV_TREE 2 Excel


Template binding for components


Perform Template binding for all the «Patterns» and all the «Values» according to scheme below:

ALV_TREE Excel Mapping


Context binding for components


Perform Context binding for «Loopsteps» and «Values» according to scheme below:

ALV_TREE Excel context binding



Geting name of the «Sheet» from context field [orgtx]

To make worksheet names more understandable, assign them to the field Department name (ORGTX) of context. 

Use option «Sheet name at runtime» in the Properties tab 

ALV-Tree to Excel - Properties tab


Activate the Form by pressing a button 

Form is ready to use.


Explanations

For each «Loopstep» iteration a new Worksheet will be inserted in the Workbook of the Printing form at runtime. There are two components on the Worksheet:
  • The header with Department name (FORM_HEADER) is placed on top of worksheet.
  • The org.unit hierarchy (TREE) is located below.

Properies tab of the «Tree» component: