Customer Exits for Standard Reporting
SAP enhancement: MCR00002, function exit: EXIT_SAPLMCS2_001 Changing key figure texts in standard analyses Description:
This SAP enhancement enables you to do the following in the standard analysis of the Logistics Information System:
- Define the preset key figures depending on the drill-down level.
- Change the text (= column heading) for individual key figures. The standard analysis usually gets the heading for a key figure from the Data Dictionary. (The system reads a text (= field label) which is
assigned to the respective data element in the Dictionary). The above SAP enhancement allows you to make your own column headings which differ from data element field labels of the respective key figure.
Key figure headings can also consist of two lines. This function exit
enables you to create and change the second line of a heading.
- Display key figure texts that are dependent on the characteristic value, when using the function "All key figures...(display)".
If you call up this function for material 1, you can, for instance,
display the text "quantity of sulfur ordered" instead of the key figure text "order quantity", while in the same place "quantity of chlorine ordered" appears for material 2.
The system always calls up the function exit before it displays a list (initial or drill-down list). This means that you can change the preset
key figures from list to list. You can therefore configure the key figure view according to the drill-down level.
At vendor level (= initial list) the key figures A, B and C are displayed. If the user wants to display all materials for a specific
vendor (drill down according to material), then he/she can use this function exit to preset the key figures D and E for the drill-down list.
The changes made by the function exit remain in effect for all subsequent drill-down lists, i.e. for all subordinate lists in the
drill-down hierarchy, until the key figure setting is changed again by the function exit. In the above example, this means that the system will still continue to display the key figures D and E if you drill down on a material according to period and the function exit does not
change the key figure setting again before displaying the period list. Parameters: Input parameters:
- T_AUS_S000 : Contains the data prepared for the screen output of an initial or drill-down list.
- T_DRILLDOWN : Current drill-down level. In the field T_DRILLDOWN-DDICFELD, the header line of this table contains the name
of the characteristic according to which the drill down is performed for the list contained in table T_AUS_S000. (Example: if the field name MATNR is in the DDICFELD, then in the case of the list which is displayed after calling up the function exit, the user is given a
DDICFELD is a field in the info structure on which the standard analysis is based. Alternatively, you can also request the field T_DRILLDOWN-ROLLNAME in order to determine the current drill-down level. T_DRILLDOWN-ROLLNAME contains the Dictionary data element of the
characteristic according to which the drill-down is performed on the list contained in table T_AUS_S000.
- T_KEY_FIGURES : Preset key figures.
- MCINF : Name of the info structure that contains the key figures.
- FLG_ALL_FIGURES: This import parameter contains the value 'X if the
function exit is called up before the popup which displays all key figures appears. If an initial or drill-down list is called up then this parameter is reset (i.e. contains a space).
- OBJECT : Name of the characteristic value (e.g. material or vendor
number), for which the user has called up the function "All key figures ... display" (FLG_ALL_FIGURES = X').
Show/hide key figures:
- T_KEY_FIGURES : Key figures preset for the next list.
You can show and/or hide key figures by either inserting or deleting the line belonging to the key figure in the table T_KEY_FIGURES.
If you insert a line in table T_KEY_FIGURES, you only need to fill the fields TABNAME and FIELDNAME. The remaining fields of the tables T_KEY_FIGURES are filled automatically by the standard analysis.
TABNAME contains the name of the info structure from which the info structure with the table field name FIELDNAME originates. Change key figure texts (headings):
You can find key figure texts in the following four fields of the table
T_KEY_FIGURES (the following notation applies to the number of characters permitted): (x) = maximum length [x] = recommended length (in bytes).
SCRTEXT_S = short key word (10) 
SCRTEXT_M = medium key word (20)
SCRTEXT_L = Long key word (40) 
REPTEXT = program heading (55) [output length
of the key figure]
When overwriting these four data fields, please observe that the length
of the shortest text affects the column width in which the respective key figure is displayed during the standard analysis. This column width is determined as follows:
An output length is assigned to each key figure in the ABAP/4 Dictionary. If you select (in the standard analysis via the menu
sequence: "Settings -> Column width -> Key figures") a column width that is longer than the output length of a key figure, the system ignores your entry and displays the key figure in its output length. If the shortest key figure text is longer than the output length, then the
system uses the length of the shortest key figure text for the column width.
If all four key figure texts in the function exit are NOT filled, then the standard analysis fills the empty text fields in accordance with the following logic:
If at least one text field has been filled, the standard analysis
copies one of these texts into the empty text fields. If no text has been defined in the function exit at all, the standard anaylsis takes the key figure texts from the Data Dictionary.
The field HEADLINE_2 is used to control the second line of the key
figure heading. If you require a second line, then you need to fill this field accordingly. Additional information / tips:
For certain purposes it might be necessary to access the table T_AUS_S000. For instance, you might want to read the characteristic
texts, in order to find out which key figure texts need to be defined.
Table T_AUS_S000 is made up of two parts. The first part is independent of the information structure and is therefore always identical. The fields in this part are defined in the structure AUSTAB_GLOBAL (see program RMCS0TP1).
The second part of T_AUS_S000 contains the key figure fields. The structure of this part is therefore dependent on the info structure.
In order to access the fields in table T_AUS_S000, you therefore need to define a structure in the function exit, which agrees with the
structure of table T_AUS_S000. You can find out the structure of this table in the respective main program. You can find out the name of the main program by displaying the status during the standard analysis in question (menu path: System -> Status).
- EXIT_SAPLMCS2_001: Change Key Figure Texts in Standard Analyses