How To Use Text Variables in BW Reports Part - 2 PDF
How To Use Text Variables in BW Reports Part - 2 PDF
Reports Part - 2
Applies to:
SAP NetWeaver Business Warehouse (Formerly BI), Will also work on SAP BI 3.5. For more information,
visit the EDW homepage
Summary
This article gives clear picture about how to use Text Variables in BW/BI reports result Column headings.
Author:
Author Bio
Surendra Kumar Reddy Koduru is a SAP BI Lead Consultant currently working with ITC Infotech
India Ltd (Bangalore/INDIA). He has got rich experience and worked on various BW/BI
Implementation/Support Projects and he is the author for various Articles and Blogs (SAP-BW/BI) in
SAP Community Network.
Table of Contents
Introduction: ........................................................................................................................................................ 3
Live Scenario: ................................................................................................................................................. 3
Creating Customer Exit Variables: .................................................................................................................. 3
Code: ............................................................................................................................................................... 5
Code Explanation: ......................................................................................................................................... 12
Report Designer: ........................................................................................................................................... 12
Creating Text Variables:................................................................................................................................ 16
Variable Names:............................................................................................................................................ 20
Selection Screen: .......................................................................................................................................... 21
Report Result: ............................................................................................................................................... 22
Related Content ................................................................................................................................................ 23
Disclaimer and Liability Notice .......................................................................................................................... 25
Introduction:
Displaying the report result column heading along with the Date, i.e. with this uses will know for which date
this column data/result is displaying.
Here Im taking the example of our previous article Using Customer Exit Variables in BW Reports: Part
17, the logic of the report is remains same but in this Article we are working only on Text Variable on
Column heading.
About Using Customer Exit Variables in BW Reports: Part 17 article.
This article addresses the requirement of Customer Exit variables in BW/BI Reports; in this article Im
explaining the following scenario
Need to display the report result like below
Calculate the First Day of the of the Fiscal Year Period based on Current Fiscal Year Period, dont hard
code, first calculate the Current Fiscal Year Period and then using that calculate First Day in that Fiscal
Year,
First Day in the Current Fiscal Year - 1, First Day in the Current Fiscal Year - 2, First Day in the Current
Fiscal Year 3basically this is a Rollup report in backward direction.
Please click on below URL and then see the Article:
How to use Customer Exit Variables in BW Reports Part 17
Live Scenario:
In SAP-BI/BW reports, users are very much comfort if the reports result will show with all Columns heading
along with on what date or month if the report is having more then one column.
In this scenario, for result/logic part we are using the How to use Customer Exit Variables in BW Reports
Part 17 and for Text Variables we are defining the new Logic in this article.
Creating Customer Exit Variables:
Create Customer Exit Variable ZDT_CM on 0CALDAY.
For reference look into the following screens.
Code:
Goto CMOD TCode in SAP-BW/BI and then give your Project Name and click on Change button.
Click on Components
*
*
*
*
*
*
*
WHEN 'ZDTX_1CMF'.
REFRESH E_T_RANGE.
IF i_step = 1 .
CLEAR l_s_range.
ZDT1 = SY-DATUM.
*
*
*
*
*
*
*
*
ZBUPER = zefyprd1+4(3).
ZGJAHR = zefyprd1+0(4).
*
*
*
*
*
*
OTHERS
= 4
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WHEN 'ZDTX_2CMF'.
REFRESH E_T_RANGE.
IF i_step = 1 .
CLEAR l_s_range.
ZDT1 = SY-DATUM.
*
*
*
*
*
*
*
*
ZBUPER = zefyprd2+4(3).
ZGJAHR = zefyprd2+0(4).
*
*
*
*
*
*
*
WHEN 'ZDTX_3CMF'.
REFRESH E_T_RANGE.
IF i_step = 1 .
CLEAR l_s_range.
ZDT1 = SY-DATUM.
*
*
*
*
*
*
*
U_OVERFLOW
=
D_OVERFLOW
=
EXCEPTIONS
PERIV_NOT_FOUND
= 1
OTHERS
= 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ZBUPER = zefyprd3+4(3).
ZGJAHR = zefyprd3+0(4).
*
*
*
*
*
*
*
Code Explanation:
The Function Module 'UMB_GET_CURRENT_FISCPER' will take Fiscal Year Variant as input, and it will
give current Fiscal Year Period. UMB_SERVICE_FISCPER_CALC will calculates the Minus or Plus (-/+)
Fiscal year periods. FIRST_DAY_IN_PERIOD_GET will calculate the First Day of the Fiscal Year Periods.
Report Designer:
For your reference Im keeping all screen of Article Pert 17, for Ref. click on below URL
How to use Customer Exit Variables in BW Reports Part 17
In Filters:
Nothing.
In Rows:
Drag and Drop Material and Plant.
In Columns:
Create Four New Selection and Drag and Drop Amount, 0CALDAY and restrict 0CALDAY with ZDT_CMF,
ZDT_1CMF, ZDT_2CMF and ZDT_3CMF respectively like above.
In Old report/above report we have four columns in report, and for each column we need to create a Text
Variable, so totally four Text Variables we need to create.
See the above screen, give Description, Technical Name and Processing By Customer Exit.
In Details tab, Uncheck the Variable is Ready for Input, by default it will be check, so un check it.
See the below screen after creating the variable, how it looks like.
Variable Names:
ZDTX_CMF (We just created in above step.)
ZDTX_1CMF (all the remaining three variable you need to create like above for remaining columns.)
ZDTX_2CMF
ZDTX_3CMF
Once you create remaining three variables, you save the report, to populate the values into the all above four
Text variables, we written ABAP Code in Customer Exit. Ref see above ABAP Code.
Once you create all above Text Variables, the report looks like below.
Report Result:
See the following Report Result:
Here the result is displayed for 01.06.2011, 01.05.2011, 01.04.2011,and 01.03.2011 dates.
See the below Image from RSRT, i.e. execute the report in RSRT then see Input and Output like below.
Related Content
For all Articles and Blogs by Surendra Kumar Reddy, Please visit this URL
Using Customer Exit Variables in BW Reports Part - 1
Using Customer Exit Variables in BW Reports Part - 2
Using Customer Exit Variables in BW Reports Part - 3
Using Customer Exit Variables in BW Reports Part - 4
Using Customer Exit Variables in BW Reports Part - 5
Using Customer Exit Variables in BW Reports Part - 6
Using Customer Exit Variables in BW Reports: Part - 8
Using Customer Exit Variables in BW Reports: Part - 9
Using Customer Exit Variables in BW Reports: Part - 10
Using Customer Exit Variables in BW Reports: Part - 11
Using Customer Exit Variables in BW Reports: Part - 12
Using Customer Exit Variables in BW Reports: Part - 13
Using Customer Exit Variables in BW Reports: Part - 14
Using Customer Exit Variables in BW Reports: Part - 15
Using Customer Exit Variables in BW Reports: Part - 16
Using Customer Exit Variables in BW Reports: Part - 17
Using Customer Exit Variables in BW Reports: Part - 18
Inventory Management (0IC_C03) Part - 1
Inventory Management (0IC_C03) Part - 2
Inventory Management (0IC_C03) Part - 3
To Check the Files/Reports in Application Server and trigger mail alerts
Calculating the Ageing of the Materials
Using Selective Deletion in Process Chains
Triggering the Process Chains at Particular Date using Events
Analysis Process Designer (APD) Part - 1
Analysis Process Designer (APD) Part - 2
Analysis Process Designer (APD): Part - 3
Open Hub Destination: Part 1
Open Hub Destination: Part 2
InfoSpoke Part 1
InfoSpoke Part 2
Using Rule Group in SAP-BI Part - 1
Data Flow from LBWQ/SMQ1 to RSA7 in ECC and Delta Extraction in BI
Checking the Data using Extractor Checker (RSA3) in ECC Delta Repeat Delta etc...
Data Flow from LBWQ SMQ1 to RSA7 in ECC (Records Comparison)