Creating and using an ALV report variant

Analytics can display the results of any SAP ALV report. The process is: run the report in SAP, create a variant (with filters), and save a layout (with chosen fields). Analytics will then use this saved definition to refresh live data.

Creating an ALV report

  1. Run an ALV-based report

    1. Use any transaction that outputs in ALV format (e.g. VL06C – Incomplete Deliveries, LT23 – Transfer Orders, LX03 – Bin Stock).

    2. Execute it with broad selection criteria first, so you see enough data to work with.

  2. Apply filters & selection criteria

    1. On the selection screen, choose the filters you want (e.g. warehouse number, date range, movement type).

    2. These will define what Analytics retrieves.

  3. Save a variant

    1. On the selection screen, go to the menu: Goto → Variants → Save as Variant (or click the “Save” button).

    2. Give your variant a name (useful to prefix with “PB_” or something meaningful).

    3. Choose whether to mark values as default or leave fields open for Analytics to populate dynamically.

    4. Save.

  4. Adjust the layout (optional but recommended)

    1. Once the report executes, use the ALV toolbar to:

      1. Hide irrelevant columns

      2. Reorder columns

      3. Apply totals or subtotals

    2. Save this layout via Settings → Layout → Save As.

    3. You can assign it as the default layout for your variant.

  5. Test your variant

    1. Re-run the transaction using your saved variant.

    2. Confirm the data looks correct and filters are working.

Adding your ALV report to Analytics

Analytics transactions that report on data using an ALV report will need the following configuration options:

  • REPORT_CLASSES and TILES_ACTIONS configuration options determine the tiles and actions that are displayed when the transaction is run.

  • *_DETAILS, *_SORT, *_ACTIONS configuration options determine the data displayed on the graphs and screen actions when the tile is selected.

  • *_SRC_COLUMNS configuration option determines the data that is displayed on the ‘Source Details’ screen, when more details are needed for a specific section of the graph.

All ALV tiles will need the ALV report class (/TCTM/WM_APP_651_ALV) maintained in the REPORT_CLASSES configuration option.

ALV tiles will also require the following ALV configuration fields to display the ‘Graph’ screen for each tile:

REPORT_CLASSES

Field

Field Text

Data Type

Description

KEY

Key

B - String

Tile key used to link all the configuration fields maintained for the tile. This must be the table or transaction number followed by a tilde (‘~’) and then a unique number e.g. LX22~1 means tile 1 for SAP transaction LX22.

CLASS

Report Class

B - String

The report class determines the logic for the tile.

T_TYPE

Tile Type

B - String

This is not currently required to be maintained. If it is left blank, then the standard tile will be used. As of release 5.5.0 a new tile type with value “1” is available for the ALV based analytics app transactions which will convert the tile output to use a gauge.

T_LABEL

Tile Label

B - String

The text maintained in this field will appear as the main heading on the tile.

T_SUBTEXT

Tile Subtext

B - String

The text maintained in this field will appear underneath the main heading on the tile.

T_VALUEINFO

Tile Value Info

B - String

This text appears in the bottom row of the tile and can be used to indicate that the number displayed in the tile is, for example, the ‘Total’ quantity, or any other description as required.

T_BACKCOL

Tile Background Colour

B - String

This is not currently supported.

R_SEQ

Range Sequence

B - String

Tile range sequence can be set to either RAG (Red, Amber, Green) or GAR (Green, Amber, Red).

The first colour relates to numbers less than the quantity in ‘Range Low Value’, the second colour relates to the number if it falls between ‘Range Low Value’ and ‘Range High Value’, and the last colour relates to numbers more than ‘Range High Value’.

R_VALUE_LOW

Range Low Value

B - String

Number that relates to the first and second colours in ‘Range Sequence’.

R_VALUE_HIGH

Range High Value

B - String

Number that relates to the third colour in ‘Range Sequence’.

T_GROUP_LABEL

Group Label

B - String

Field to allow grouping of tiles into a particular section. All tiles for the same section should be given the same Group Label in AMD.

ALV_DETAILS

Field

Field Text

Data Type

Description

KEY

Key

B - String

Tile key used to link all the configuration fields, as maintained in the REPORT_CLASSES configuration option for the tile. This must be the table or transaction number followed by a tilde ‘~’ and then a unique number e.g. LX22~1 means tile 1 for SAP transaction LX22.

SUMMARY_FIELD

Summary Fields

B - String

Maintain configuration field ‘ALV_SORT’, which will determine the sort order of the data.

VARIANT

Variant

B - String

The SAP selection variant maintained for the SAP transaction code that has been used as the key.

Different selection variants are required for each plant or warehouse if multiple organisational units are being setup for Analytics, as the organisational unit is saved in the variant. The selection variant naming convention should include the plant or warehouse for clarity.

The layout saved to the variant must not include layout functions e.g. column filters, sums or subtotals and should not be user specific.

D_TITLE

Detail Title

B - String

Enter text to appear on the detail title.

D_X_AXIS

Detail X Axis Title

B - String

Enter text to appear on the X axis.

D_Y_AXIS

Detail Y Axis Title

B - String

Enter text to appear on the Y axis.

SRC_COLUMNS

Src Data Columns

B - String

Determine Src Data columns with ‘ALV_SRC_COLUMNS’.

TILE_TOTAL_FIELD

Tile Total Field

B - String

Determine the field to be used to provide the total.

· If the TILE_TOTAL_TYPE is “SUM” then the field entered needs to be a numeric field.

· If the TILE_TOTAL_TYPE is “COUNT” then leave the field blank to count the total number of records that the report has selected.

· To count the number of unique occurrences of a field then enter the field name. e.g. to count the number of unique materials in the report then enter the suitable field name for the material number, for example MATNR (whatever is the field name used in the report being read).

· To count the number of unique occurrences of a combination of fields then enter the field names separated by commas (up to 6 fields). No table names are required in the list just the field names, e.g. MATNR,CHARG for material and batch combinations.

TILE_TOTAL_TYPE

SUM/COUNT

B - String

Enter value ‘COUNT’ or ‘SUM’ as appropriate to determine how the total is calculated. If this is left blank then the default “count” of all records extracted from the ALV report will be used.

USER_FIELD

Specific user ID variant field

B - String

Enter the table and field within the selection variant that is used to populate the SAP user ID.

USER_ID

Specific user ID

B - String

Enter a specific SAP user ID or use the SAP variable SY:UNAME to dynamically use the SAP user ID of the user logged on to the application.

CONV_EXIT

Conversion Exit

B – String

This is only useful for when SUM is being used (as COUNT will always have integers) and is used on the number shown for each bar in the bar chart. The SAP format for the conversion exit must be used (for now) rather than the typical PreBilt format. E.g. to display the numbers to 2 decimal places use “DECIMAL,,2” (rather than “DEC,2”).

The selection variant will need to be prefixed with the warehouse or plant in each SAP transaction (e.g. PB1_OPENPUTWY, DE1_OPENPUTWY in transaction LT23) but in the app master data, the variant is maintained without the organisational data as a prefix (e.g., OPENPUTWY) as the app will read the variant for the warehouse the user is logged into.

The variant fields detailed below are not exhaustive and can be changed as per customer requirements.

ALV_SORT

Field

Field Text

Data Type

Description

KEY

Key

B - String

Tile key used to link all the configuration fields, as maintained in the REPORT_CLASSES and ALV_DETAILS configuration options for the tile.

NAME

Sort: field

B - String

SAP field name to sort the data.

DESCENDING

Descending

A - Toggle

Set to active to sort in descending order, or inactive to sort in ascending order.

CONV_EXIT

Conversion Exit

B - String

Maintain a conversion exit to remove leading zeros, set the date format or format quantities.

· To remove leading zeroes with ALPHA conversion it must be accompanied with a suitable field name. e.g. ALPHA,VBELN.

· To set date formats use the PreBilt supoorted formats such as PDATE, LDATE, etc. – see the 499 Base Framework – AMD User Guide for details.

· To format numbers use the conversion exit “DECIMAL,,3,X” or some other similar variation – the standard PreBilt formats such as “DEC,3,X” will not work.

ALV_SRC_COLUMNS

Field

Field Text

Data Type

Description

KEY

Key

B - String

Tile key used to link all the configuration fields, as maintained in the REPORT_CLASSES configuration option for the tile.

FIELD

Field

B - String

SAP field name to sort the data.

TEXT

Text

B - String

Set to active to sort in descending order, or inactive to sort in ascending order.

CONV_EXIT

Conversion Exit

B - String

Maintain a conversion exit to remove leading zeros, set the date format or format quantities.

· To remove leading zeroes with ALPHA conversion it must be accompanied with a suitable field name. e.g. ALPHA,VBELN.

· To set date formats use the PreBilt supoorted formats such as PDATE, LDATE, etc. – see the 499 Base Framework – AMD User Guide for details.

· To format numbers use the conversion exit “DECIMAL,,3,X” or some other similar variation – the standard PreBilt formats such as “DEC,3,X” will not work.

Last updated

Was this helpful?