Thursday, May 2, 2013

BEx variables SAP exits

Variables
BEx variables are parameters of a query which are filled with values when the query is executed.  The assignment of values can be done by the user when prompted or automatically during run time by the system in exits.  They are implemented as ABAP functions which are called when the query is invoked.
Variables are defined as exits in its processing type in Query Designer while the logic behind it is coded in ABAP.

Fig 1 Query Designer

The technical name for the variable, which is a Query object, is shown as (2) above, while the processing type (3) signifies that this is implemented as an SAP Exit.

SAP exit
SAP exits are delivered as part of Business Content while Customer exits are specified by the customer.  Searching for sap customer exit variable in a search engine should turn up various articles and documents on how to create a new customer exit.
The ABAP function name for SAP exits is formed by concatenating RSVAREXIT_ with the technical name of the exit.  For instance, the function name for the variable 0P_GL_ACCTP is RSVAREXIT_0P_GL_ACCTP.

The list of all variables with their processing type can also be found in table RSZGLOBV.

Code stepthrough
To understand or to step through the exit function, first open the function in an SAP ABAP session using transaction SE37.  Then create an External Breakpoint at the first line of code in the function module.  Remember to create the breakpoint using the login id as in the query.  When the query is run, processing will stop in the ABAP debugger.

Fig 2 Function Editor

You can now step through the code line by line.

No comments:

Post a Comment