As some of you may now it’s possible to call transactions and reports with data from the message variables within the AIF Monitor and Error Handling transaction (/AIF/ERR). Nicole Goeddelmann has also shown a way on how to call AIF value mappings in her recent article but what if we’d like to call a custom mapping table and to check some of the values ? If there a simple way ? It turns out it’s not that difficult, you just need to follow the steps shown in my article.
At first you need to have a custom mapping table like the one shown below for example.
If you open your custom mapping table in SE16 you can get the generated program name – /1BCDWB/DBZAIFDEMO
In order to pass the variables from the system message from transaction /AIF/ERR to the selection screen of custom table we need to write a small program which will open the selection screen at a predefined row of the table.
DATA : lt_key TYPE table of RSPARAMS.
DATA : ls_key TYPE RSPARAMS.
*we will take one parameter from the /AIF/ERR as input (and this is the key field in our customizing table)
Parameters: p_key type char10.
ls_key-SELNAME = ‘I1’.
ls_key-kind = ‘S’.
ls_key-sign = ‘I’.
ls_key-option = ‘EQ’.
ls_key-low = p_key.
ls_key-high = p_key.
insert ls_key into table lt_key.
*we call the module which will display the table entry for a specific key
CALL FUNCTION ‘RS_TABLE_LIST_CREATE’
TABLE_NAME = ‘ZAIFDEMO’
SELTAB = lt_key
IF SY-SUBRC <> 0.
* Implement suitable error handling here
Now we can assign the report to the error message in /AIF/ERR and assign the variable to the input parameters of the report.
Please make sure you also select the checkbox – “Skip first screen”
From that time whenever we try to select the function for the error message as shown on the picture below
system will take us automatically to the table display of the custom mapping table where you can check if the value exists.
You can use this functionality not only to display the whole key of the table but only the part which might be missing as if they key does not exist system will not take you anywhere.