REPORTING
Bex:-
-Bex has multiple components of tools
-Bex query designer
-Bex analyzer
-Bex WAD (Web application designer)
1). Bex query designer:-
-Purpose to design Bex design
-It is a tool were we can design a query
Info provider:-
-Any object we can design and run Bex query this is called info provider.
2). Bex analyzer:-
-It is a normal Excel sheet + Add-on components
-It is used to design Bex workbooks (Formatted query)
3).Bex WAD:-
-Ti design web temples by using web items
Bex query designer:-
-0RRMX – Is T code for opening analyzer
Query executing process:-
-When we executing in BEX query it triggers the data OLAP processor it
first check the data in OLAP and it not available OLAP processor identifies the
info cube on which the BEX report should be excites and triggers the query on the
characteristics values in the OLAP processor and transfer the records to front end
and records are formatted in the front end and shows to us.
Charecterstics properties:-
FIGURE 1 : PFA
Key figure properties:-
FIGURE 2 : PFA
Query properties:-
Restricted key figure:-
- If we want restrict the multiple keyfigure with a same Charecterstics we
go for RKF.
-With the RKF will affect only particular coloums only.
-When we want each key figure to be restricted with a different
Charecterstics we go for RKF.
New Selection:
-Same as Restricted Key figure.
-New selection is local
-RKF is Global at Info Provider and New Selection is Local
Note:-
-When we have two structures in a report, we can build new selection on
two but we have the flexibility to use key figure in a one selection only.
Exceptions:
-We use Exceptions to provide alerts on to the Report based on the key figure
value.
- Active
- Cell Restriction
- Degrades Query performance
Note Scenario:-
- We have used exceptions to provide alerts in the - P/A (Profitability analysis)
Report - only on the result.
Calculated key figure (CKF):-
-When we calculated a new key figure based on the existing key figures by
performing some calculations and using some pre defined functions.
-When we use calculated key figure it performs the some calculations
throughout the entire Coolum.
-It is global can be used in all the reports designed on same info provider.
New formula:-
-It is a same as a calculated key figure but new formula is local and it has
more than 6 functions than the calculated key figure.
CKF/New formula:-
-CKF is global and new formula is local.
-When compare to CKF, new formula will have 6 functions more.
-All key figures can be used in building calculated key figures.
-But we can only use the key figure, which is used as the structure elements in
new formula.
Structure and New selection modes:-
Purpose:-
-To make the more node levels like formula and new selections
-It’s has a 2 structure
-Why do we use structure?
-We have to make Level up and Level done
-Reusable component
-It is used in global and local aspects
-Remove reference
-If we use saved structure it will not allowed to make the changes to make the
changes we go to the structure in report structure and give right click remove
reference with this we have that structure to make changes within the query it is
called remove reference.
Cell definitions:-
-We use this when we want to perform some calculating specific to each
cell on a Coolum.
-We can implement cell definitions only when we have 2 (Two) structures
in a reporting.
Exceptions:-
-Exception means to provide the alerts to the particular coloum for analysis
Note:-
-We have the flexibility to give exception on hierarchy node wise also.
Filter:-
-Filter means here we have to make restriction Charecterstics as well as
key figure
-If we put object in this area it will not shown result set as well as
navigation block.
Free Charecterstics:-
-Free Charecterstics means here we have to make restriction on
Charecterstics only
-If we put a Charecterstics into free charecterstic it will not shown in the
result set after as per our requirements we have the flexibility to make drilldown
and dril across and filter here
VARIABLES
Variables:-
-We can variables the Bex reporting
-To parameterize the queries
-By using variables we can make the Bex queries dynamically
Types of variables:-
1) Charecterstics value variable
2) Text variable
3) Formula variable
4) Hierarchy Variables
5) Hierarchy node variable
1). Charecterstics variable:-
-We can use variables when to make the restriction dynamic on a
characteristic
2). Text variable:-
-We use variables to define the description of key figure, CKF, RKF, NS, NF
query description dynamically
3). Formula variable:-
-We use these variables to parameterize the Conditions, Exceptions and
CKF or NF
4). Hierarchy variable:-
-We use hierarchy to dynamically select the hierarchy to be used the Bex
report
5). Hierarchy node variable-
-We use the variables to make dynamically select particular node on
hierarchy to be show in the Bex report
Processing types:-
-This properties define how the variables is process to populate value
Types:-
1). User entry/Default
2). Customer exit (ABAP code)
3). Authorizations
4). Replacement
5). SAP exit
Processing types
User entry/Default Customerexit SAPexit Authorizations Replacement
Charecterstics Variable x x x x x
Text variables x x x N/A x
Formula Variable x x x N/A x
Hierarchy Variable x x x N/A N/A
Hierarchy node Variable x x x x N/A
FIGURE 3: PFA
**N/A means not available that combination
Case 1:
Characteristic Value Variable with User Entry / Default:
-We use this to give values to the query as user entry
Characteristic Value Variable with Replacement Path:
-When we want a dynamic restriction on a characteristic by replacing with the
query result set of other query.
Note:-
* Queries could be on different Info Providers.
* But the Characteristic must be same.
* We have the flexibility to make the restriction on info object we can use that in
other cube reports but that info object must be there in a cube.
Charecterstics value with authorization:-
UsersProfiles------------ Roles-------Authorization objects-------
Authorization objects:-
S_RS_COMP
S_RS_COMP1 System defined objects for reporting
S_RS_CUBE
Note:-
“RSSM” is T-Code for define authorization in our objects
“PFCG” s T-Code for creating Roles as well as generating properties
“SU0 (zero) 1” User management T-Code
“RSECADMIN” is T-Code is in BI 7.0 overall authorization activities have the
flexibility
Ex:-
Steps:-
Step 1:-
Create a role –“PFCG”
Give some name (Create role)
Give a description (Save)
Authorization (Click tab)
Change authorization data
Choose template (Role)
S_RS_RREPU (Select)
Adopt reference
Utilities Manu (On technical name)
RS technical name (Select it)
S_RS_
Display, Execute, Enter
Info area
Info cube
Name of reporting component
Types of reporting (Select all)
Generate
Save it
Ex 2:-
Characteristics value variable with the Authorization:-
Step 1:-
Set the info object as authorization relevant –RSA1
Go to the Customer (Info object) change
Business explore tab
Go to the Authorization relevant and click the check box and active
the info object
Step 2:-
Create authorization object- RSSM
Authorization object
Create
Description
Give customer no
Save it
Step 3:-
Enable the authorization on the info provider –RSSM
Chek for info provider
Change
Select authorization object
Save it
Step 4:-
Define the roles and generate the profile – PFCG
Display, Execute, Enter
Info area
Info cube
Name of reporting component
Types of reporting (Select all)
Manually (Enter all values)
Generate
Step 5:-
Create the necessary users – SU01
Step 6:-
Create a Charecterstics value variable with authorizations as processing in
the BEX query designer
Notes: - Find the query role:-
-SUIM
-Roles
-Roles by complex selection criteria
Note:-
-SU53 is a T-Code for Display authorization data for user Like (SAPUSER)
Note:-
-SU01D is T-Code to display all users
Charecterstics value variable with SAP exit:-
-All the business content variables will have the processing types
Note:-
-Ready for input
-If we select this checkbox we will get popup box in front end does
not we can’t get.
Note:-
-Can be changes in navigation block
Purpose:-
If we select this checkbox, we have the flexibility to make the changes like
filter as well as drill down drill across.
Note:-
-Popup box we have the save also variant as well as use that in other
usage.
Note:-
-Personalization
Charecterstics value variable with Customer exit:-
-For these type of variable the values is processed by using ABAP/4 code
Case 1:-
0CALDAY:-
Steps:-
1). Create the Charecterstics value variable with customer exit on 0CALDAY
2).Create a project – CMOD
Project
Attribute
Create
Short text
Save
Package
Save it
3). Assign the enhancement to the project – CMOD
*”RSR00001” is T-Code for to see complete enhancement
Enhancement assignment
Change
RSR00001
Save it
Note:-
-One project can have multiple enhancements, but the same enhancement should
not assign multiple projects
4). Chek the components of the project –CMOD
Components
Function exit (Click it)
{EXIT_SAPLRRSO_001}
5). Go to the component and implement the logic as per the requirement - CMOD
Component
Change
Function exit (Click it)
Source code (Tab click it)
Include “ZXRSRU01 (Click it)
Change
WHEN ‘ZYDATE’.
CLEARE L_S_RANGE.
L_S_RANGE-SIGN = ‘I’.
L_S_RANGE-OPT = ‘EQ’.
L_S_RANGE-LOW = SY-DATUM.
APPEND L_S_RANGE TO E_T_RANGE.
WHEN ‘ZYDATE’.
CLEARE L_S_RANGE.
L_S_RANGE-SIGN = ‘I’.
L_S_RANGE-OPT = ‘BT’.
L_S_RANGE-LOW = SY-DATUM-1.
L_S_RANGE-HIGH = SY-DATUM.
APPEND L_S_RANGE TO E_T_RANGE
Case 2:-
0CALMONTH –Current month:-
Steps:-
Step:-1
-Create the charecterstics value with customer exit on ‘CALMONTH’
Step:-2
-Go to the SE38 for implementing ABAP code
ABAP code for Current month:-
WHEN ‘ZY’.
CLEAR L_S_RANGE.
L_S_RANGE-SIGN = ‘I’.
L_S_RANGE-OPT = ‘EQ’.
L_S_RANGE-LOW = SY-DTUM
+0(6).
APPEND L_S_RANGE TO E_T_RANGE.
Case 3:-
Current week:-
Steps:-
Step:-1
-First we have to create charecterstics variable with customer exit
Step:-2
-Then we go to the SE38 for writing ABAP code
ABAP Code for current week:
WHEN 'YCW'.
DATA ZV_WEEK LIKE SCAL-WEEK.
CLEAR L_S_RANGE.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = SY-DATUM
IMPORTING
WEEK = ZV_WEEK.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
L_S_RANGE-LOW = ZV_WEEK.
APPEND L_S_RANGE TO E_T_RANGE.
Case 4:-
Year to date (YTD):-
Steps:-
Step:-1
-First we can create charecterstics variable on Calday with customer exit
Step:-2
-Then we go can go to SE38 for implementing ABAP code
ABAP Code for Year to date (YTD):-
WHEN 'Z_YTD'.
DATA ZV_YEAR(4) TYPE N.
DATA ZDATE TYPE D.
CLEAR L_S_RANGE.
ZV_YEAR = SY-DATUM+0(4).
CONCATENATE ZV_YEAR '0101' INTO ZDATE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
L_S_RANGE-LOW = ZDATE.
L_S_RANGE-HIGH = SY-DATUM.
APPEND L_S_RANGE TO E_T_RANGE.
Case 5:-
Month to Date (MTD):-
Steps:-
Step:-1
-First we can create the charecterstics variable with customer on Calday
Step:-2
-Then we go for SE38 for writing ABAP code
ABAP code for Month to date:-
WHEN 'Z_MTD'.
DATA ZV_YEAR1(4) TYPE N.
DATA ZDATE1 TYPE D.
CLEAR L_S_RANGE.
ZV_YEAR1 = SY-DATUM+0(4).
CONCATENATE ZV_YEAR1 '0301' INTO ZDATE1.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
L_S_RANGE-LOW = ZDATE1.
L_S_RANGE-HIGH = SY-DATUM.
APPEND L_S_RANGE TO E_T_RANGE.
Case 6:-
Date Get First Week:-
Steps:-
Step:-1
- First we can create the charecterstics variable with customer on Calday
Step:-2
-Then we go SE38 for implement the ABAP code
ABAP code for Date get first week:-
WHEN'ZYWTD'.
DATA VFDATE TYPE DATS.
CLEAR L_S_RANGE.
CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
EXPORTING
DATE_IN = SY-DATUM
IMPORTING
DATE_OUT = VFDATE.
L_S_RANGE-LOW = VFDATE.
L_S_RANGE-HIGH = SY-DATUM.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
Case 7:-
I_STEP2:-
Steps:-
Step:-1
-Create charecterstics variable with user entry on Calday
Step:-2
-Create customer exit variable on cal year/week and ready for input must
be deselect and mandatory
Step:-3
-And go to SE38 for implementing ABAP code
WHEN 'Z_IST2'.
DATA ZDATE TYPE DATS.
DATA ZWEEK LIKE SCAL-WEEK.
IF I_STEP = 2.
CLEAR L_S_RANGE.
LOOP AT I_T_VAR_RANGE INTO INTERN_RANGE.
IF INTERN_RANGE-VNAM = ZDATE.
ZDATE = INTERN_RANGE-LOW.
ENDIF.
ENDLOOP.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = ZDATE
IMPORTING
WEEK = ZWEEK.
L_S_RANGE-LOW = ZWEEK.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
Text Variable:
-We use Text Variable to make the description of the KF,CKF,RKD,NS.NF and
Query Description dynamic.
Processing types:
- User entry / Default
- Customer Exit - 25% (% of real-time usage)
- Replacement Path - 75% (% of real-time usage)
- SAP Exit
Case 1:
1).Text with User entry / Default:-
-If we have to go this scenario then we have a chance to select description
of any key figure/CKF/NF/NS/RKF etc in a dynamically.
Ex:-
Select key figure
Edit
Select text variable [ ]
Variable name
Description
Length of input field [32]
Case 2:
2).Text with Customer Exit:
-If we required changing query description dynamically based on sy-datum
then we go for this scenario
Purpose:-Balance Sheet Report title with Current Date:-
Go to the query properties
Select text variable
Variable name
Description
Processing by [Customer Exit]
Length of output field [32]
ABAP/4 Code for this scenario:-
WHEN ‘ZBALANCE’.
CLEAR L_S_RANGE.
L_S_RANGE-SIGN = ‘I’.
L_S_RANGE-OPT = ‘EQ’.
L_S_RANGE-LOW = SY-DATUM.
APPEND L_S_RANGE TO E_T_RANGE.
Case 3:
3).Text with Replacement Path:-
Purpose:-Trending Reports:-
Select key figure
Select new selection
Give the Name as Current month
(And here we create text and also give processing by as Replacement variable)
Select and drag any key figure from left blog to right blog and restriction on
clamonth2 and create variable customer with processing by as User entry
Case 4:
4).Text Variable with SAP Exit
Formula variables:-
-We use formula variables to make conditions, Exceptions, Calculated key
figure, new formula in dynamically.
Processing Types:-
-User default/Default – 10% (% of real-time usage)
-Customer Exit – 30% (% of real-time usage)
-Replacement path – 60% (% of real-time usage)
-SAP Exit
Case 1:-
Formula variable with user entry:-
Case 1:-
In CKF (Calculated Key figure):-
Purpose:-
-If we make formula variable on CKF then we have the flexible to make
calculations with in pop up box.
Select Calculated key figure
-Edit
-Formula variable
-New variable
-Variable name
-Description
-Processing by [User entry]
-Now must drag what created into Formula box
Case 2:-
Formula variable with user entry:-
Case2:-
-On conditions
Case 3:-
Formula variable with replacement path:-
-There are two scenarios one is we can use a characters in calculations and
key figures what the any info objects which hold the attributes as key figures we
can use that key figures in calculation part by using formula variable with
replacement path.
Scenario 1:-
Formula variable with replacement path :-( By using Charecterstics values)
-No of day’s b/w actual goods date and planed goods date
-Create Formula
-Create formula variable
-New variable
-Technical name
-Description
-Replacement path
-Charecterstics (Choose one)
-Mention particularly its is what type
-Date
-Number
-Quantity
And finally w create two variables in formula variable one for actual goods issued
date and one more for Planned goods date and drag into that both into formula
screen and (Variable1-variable2) then we will get no of days b/w that dates
Scenario 2:-
Formula variable with replacement path :-( By using Attribute, key figures)
-To get the sales cost from the attribute key figure
-Create Formula
-Create formula variable
-New variable
-Technical name
-Description
-Replacement path
-Charecterstics (Choose one)
-Attribute
-Select a particular attribute
-Mention particularly its is what type
-Date
-Number
-Quantity
-Finally in key figure we have quantity and we need the standard price for
getting sales cost so we use quantity direct calculations and use formula variable
what we have done and put that both quantity and formula variable into formula
screen and run the query.
Hierarchy Variable:
-Dynamic Selection of Hierarchies
Processing Types:
- User entry / Default - 80%
- Customer Exit - 20%
- SAP Exit
Case 1:
Hierarchy Variable with User entry / Default
- Product hierarchy
Hierarchy Node Variable:
- When we want the restriction to be made dynamic at the Node level of an
Hierarchy we go for Hierarchy Node Variable.
Processing Types:
- User entry / Default - 40%
- Customer Exit - 10%
- Authorization - 40
- SAP Exit
Report-to-Report Interface (RRI) [RSBBS]:-
-We use this to jump one query to another query
BEX ANALYZER
- To Design Bex workbooks (Formatted Report is called as Workbook)
- MS Excel and some Add-on Components
-Settings icon
-BW server connection
Case 1:
- Formatting (Charts, Multiple queries in single sheet as well as different sheets)
For a chart……………..
-Select the result area
-Layout icon
-Attach charts
For refreshing query……………………..
-Right click the any area in the excel sheet
-Properties
-Interaction
-Refresh query out put
Finally save that workbook
Case 2:
-Moving filters, Text elements, Move result area
-Here we have the flexibility to move those from one area to another
to another area in a sheet.
To design text elements……………………………..
-Layout icon
-Display text elements
-All
Purpose to make this activity it will shown those properties of about query as
well as user name changed date time etc,,,,
Case 3:
- Workbook Template
Case 4:
- Multiple Queries - Multiple Sheets
Case 5:
- Multiple Queries in Single Sheet
Case 6:
- Organizing Text Elements & Navigation Block & charts
Case 7:
- BEx MAP
- .SHX
- .SHP
- .DBF
Case 8:
- VB Macros
Sub SAPBEXonRefresh (queryID As String, result Area As Range)
Dim i As Integer
Dim j As Integer
Dim v_cols As Integer
Dim v_rows As Integer
i = resultArea.Rows.Count
j = resultArea.Columns.Count
v_cols = 1
v_rows = 1
For v_cols = 1 To j
For v_rows = 1 To i
If resultArea.Cells(v_rows, v_cols).Value = "Overall Result" Then
resultArea.Cells(v_rows, v_cols).Value = "Total Stock"
End If
Next v_rows
Next v_cols
End Sub