Showing results for 
Search instead for 
Did you mean: 

Creating customer formula to be used in the Query Designer

Former Member
0 Kudos


How can i code a specific formula to be used in the query designer. As an example, i need to calculate dynamically working days between two dates.

i tried to find the corresponding BAdl interface with no success..

Do you have any suggestion ?


Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos


I have a scenario ... it may help..

The group HR administrator wants a detailed line item report that lists all employee absences in a given period. The report is to show the employee number, the absence start date, together with the end date of the absence and show the number of calendar days the employee was absent.

The good thing about using this technique is that no redesign work is needed from your technical BW team, no ABAP is involved and best of all, it quick and easy.


For this example I created an ODS object called Absence that holds basic employee information along with individual absence record data.

Follow the steps below:

Open the BEx Query Designer and create a new report on your chosen InfoProvider.

Drag the Employee, Valid from and Valid to characteristics into the Rows section of the screen.

If needed, apply data selection restrictions to the characteristics as pop up

Right click on the Key Figures structure and select New Formula

In the new formula window right click on Formula Variable and choose New Variable

The Variables Wizard will launch and will require you to specify the variable details.

( Click the NEXT button if the Introduction screen appears )

Enter the variable details on the General Information as shown in pop up

Enter the Variable Name , Description and select Replacement Path in the Processing by field.

Click the Next Button.

In the Characteristic screen (pop up) select the date characteristic that represents the first date to use in the calculation (From Date).

Click the Next Button.

The Save Variable screen (pop up) displays a summary of the new variable.

Click on the Finish button to save the variable.

Repeat steps first four for to create a second variable for the second date to be used in the calculation.

In the example shown, the characteristic 0DATETO is used to create the variable ABSEND (Absence End Date)

Define the Calculation............

The new calculated key figure will now show in the columns section of the BEx query designer


with regards,