What is this about - Tutorial
Overview
As we have said in the previous pages, ALV robot is intended to help the programmers in the programming of ALV reports.
Using a template and a couple of questions, it takes care of most of the typing needed to create the source code of the report.
As the reports generated are neither complex nor contain complex queries, you may find usefull to use this site to create a base report for later enhacement. Since the source code given is simple, clean and straigh-forward, you may easily do that and won't get messed in the source code.
Step 1: General Information
During the first step, general information about the report is required. You will be asked for:
- Program name
- ALV title
- Author name (Your name)
- Program description

Multiple templates / Personalized templates
In the future (the tool is still under construction) you will also need to select the template to be used. This way you will be able to create an ALV report using the 'REUSE_ALV_GRID_DISPLAY' function module (as you can now) or use other approaches, as the O.O. paradigm.
Personalized templates: If you want to use your own template, plase, send it to me! It will be added to the template library. If you want to keep it private, you will be provided with a password for you to be the only one allowed to handle the template.
Step 2: Tables involved
At this step, the tool needs to know the tables that are going to be involved in the query.
As we list them, you also be asked to fill in the relationship among them:
- Alias: Just as we do, the tool uses aliases to refer to the tables. Then, we have to give each table an alias.
- Join type: Is the table going to be joined using an iner join, a left outer join or a right outer join?
- Join condition: After selecting the join type, we can freely enter the join condition for each of the tables.

Step 3: Fields of the selection screen
We need to build the selection screen.
Again, you will be provided a texbox for each of tables entered in step 2.
Please, use the textboxes to list the fields you want to appear in the selection screen.
Note this is not the right time to specify the appearance of the fields, as parameters or select-options. That will be done later.

Step 4: Selection fields properties
After listing the fields of the selection selection, we are configuring them.
You will be shown a list of all the selection screen's fields. For each of the fields, please choose if you want them to appear as a:
- Text Parameter
- Select-Option
- Checkbox
- RadioButton.
Also, you will be able to define if it is obligatory and may enter a default value.
In case you have chosen to use a RadioButton, you will need to enter the "radio button group".

Step 5: Fields of the ALV report
It is time to tell the tool which fields are going to be included in the ALV report.
For each of the tables listed in the previous step, you will be provided a textbox, where the table's fields have to be entered.
Please, separate each of the fields with a space.

Step 6: ALV report fields properties
As well as we configure the selection screen fields, we are also going to configure the ALV report fields.
You will be shown a list of all the ALV report fields. For each of them, please choose:

- Output options: Set the appearance of the column.
- Standard (as textbox)
- As checkbox
- As icon
- Hotspot: Check this if you want to set this field as a hotspot (The pointer of the mouse will be changed from an arrow to a hand when the mouse gets over this field).
- Initially hidden: If you set this option, you hide the column on the list. Nevertheless, the column is available in the field selection and can be interactively selected by the user as a display field. The ALV displays the contents of hidden fields on the detail screen for a row in the grid control.
- Sorting Criteria.
- None
- Up: Ascending.
- Down: Descending.
- Aggregate functions.
- None
- Group by: The content of the filed wil be used as criteria for groupping and summing other fields. In case you set this option, you will need to set a sorting criteria.
- Do Sum: This field will be grouped and summed acoording to contents and sorting of the "group by" fields.
- Other output options: Set the appearance of the column.
- Hotspot: Check this if you want to set this field as a hotspot (The pointer of the mouse will be changed from an arrow to a hand when the mouse gets over this field).
- Initially hidden: If you set this option, you hide the column on the list. Nevertheless, the column is available in the field selection and can be interactively selected by the user as a display field. The ALV displays the contents of hidden fields on the detail screen for a row in the grid control.
Step 7: Layout
We are close to the goal, but first we have to take care of the layout options:

- Zebra pattern: Check this if you want the ALV to show alternating cell color for the output.
- Selecting rows: Sometimes we need to select some rows on the ALV and then execute some command / task on them.
In that case we need to define how do we want to select our rows:- None: We don't want to select rows.
- Standard button: A standard ALV selecting row button will be added on the left of the report.
- Checkbox: A checkbx will be added as the first field of the report to mark selected rows.
- Mark field name: In the last 2 cases, the selected rows will be marked as selected. That mark will be stored on a field in the data internal table of the program. Please, set a name for that field, taking care of no overlapping with the other fields name.
Final Step: Source code of the report
You have given the tool all the information it needs to generate the source code of the ALV report.
We can't get into your SAP console, so please:
- Copy the source code given in the textbox.
- Using the SE38 transaction, create a new program.
- Paste the source code in it.
- Compile.
- Go! You are ready to run the program.
Download example generated source code »

Extra Steps: Enhacements to the report
You may feel the program needs some adjustments, stuff only humans can do.
Please, jump into the code and try to enhace it. I think you won't get any problem finding the perfect spot for you to insert your code.
As I have told you the tool is still under construction. Later, I will update this tutorial, showing you some enhacements examples. If you already have some examples and feel they can be usefull, please, send them to me using the contact link! I will be very gratefull!
Also, if you think further automation can be done, please let me know. Maybe you can enhace the tool!