Professional Documents
Culture Documents
0CALDAY in InfoPackage
Selection
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 a Routine for 0CALDAY in InfoPackage Selection.
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.
SAP COMMUNITY NETWOR SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 1
How to Write a Routine for 0CALDAY in InfoPackage Selection
Table of Contents
Introduction: ........................................................................................................................................................ 3
Live Scenario: ................................................................................................................................................. 3
Create Flat File DataSource: .......................................................................................................................... 3
All Tabs of Flat File DataSource: .................................................................................................................... 4
Transformations and DTP:.................................................................................................................................. 7
Routine in InfoPackage:...................................................................................................................................... 8
Code Window: .................................................................................................................................................. 10
Code before Change: ....................................................................................................................................... 10
Code After Change: .......................................................................................................................................... 11
Data Loading using above InfoPackage: .......................................................................................................... 13
Monitor Screen: ................................................................................................................................................ 16
PSA Data: ......................................................................................................................................................... 16
Related Content ................................................................................................................................................ 20
Disclaimer and Liability Notice .......................................................................................................................... 21
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 2
How to Write a Routine for 0CALDAY in InfoPackage Selection
Introduction:
This article addresses the requirement of a Routine in InfoPackage selection on 0CALDAY. Using this
routine, I need to load only that particular Date Data into InfoCube and other data just ignore.
Live Scenario:
Some times when we are loading data from Source System into BW/BI System, we need some selections in
InfoPackage in BW/BI side, this is useful specially when we are doing Full Loads, and actually we need only
One Day before data, i.e. SY-DATUM 1 data only.
Here in this example I took Flat File as my Source System and explained all steps how to do it.
If you see the above screen, in Fields Tab we can find all fields which are using for extraction and for
0CALDAY, in selection column I selected it as X , this means once you select it, then this Field/InfoObejct will
be available in InfoPackage select. You just press F4 in that Selection it will display the values like below
Apart from this the remaining part is same as normal Flat File DataSource creation only. You just Save &
Activate the DataSource.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 3
How to Write a Routine for 0CALDAY in InfoPackage Selection
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 4
How to Write a Routine for 0CALDAY in InfoPackage Selection
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 5
How to Write a Routine for 0CALDAY in InfoPackage Selection
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 6
How to Write a Routine for 0CALDAY in InfoPackage Selection
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 7
How to Write a Routine for 0CALDAY in InfoPackage Selection
Routine in InfoPackage:
This is the place where we are going to write the routine using ABAP code and implementing our logic. i.e.
just consider only System date 1 records.
Eg: This article I prepared on 24-06-2011, and my flat file is having data from 2010 year to 2011 (till
December), but I need only 23-06-2011 Data.
See the InfoPackage in below screen and also settings for creating a routine.
If you see the above screen, you can find the 0CALDAY in Data Selection tab, this is because of our
selection at the time of DataSource creation, for reference see the initial screens and DataSource creation.
In above screen, you can find Type (Variable Change.) if you press F4 it will show the below options.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 8
How to Write a Routine for 0CALDAY in InfoPackage Selection
Just select 6 (ABAP Routine) option, it will ask namefollow the below steps.
Give name Routine for Date Selection and click on Editor Button.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 9
How to Write a Routine for 0CALDAY in InfoPackage Selection
Code Window:
Once you click on Editor Button, you can see the below screen.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 10
How to Write a Routine for 0CALDAY in InfoPackage Selection
p_subrc = 0.
*$*$ end of routine - insert your code only before this line *-*
endform. "
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 11
How to Write a Routine for 0CALDAY in InfoPackage Selection
program conversion_routine.
* Type pools used by conversion program
type-pools: rsarc, rsarr, rssm.
tables: rssdlrange.
* Global code used by conversion rules
*$*$ begin of global - insert your declaration only below this line *-*
* TABLES: ...
* DATA: ...
*$*$ end of global - insert your declaration only before this line *-*
* -------------------------------------------------------------------
* InfoObject =
* Fieldname = CALDAY
* data type = DATS
* length = 000008
* convexit =
* -------------------------------------------------------------------
form compute_CALDAY
tables l_t_range structure rssdlrange
using p_infopackage type rslogdpid
p_fieldname type rsfnm
changing p_subrc like sy-subrc.
* Insert source code to current selection field
*$*$ begin of routine - insert your code only below this line *-*
data: l_idx like sy-tabix.
p_subrc = 0.
*$*$ end of routine - insert your code only before this line *-*
endform. "
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 12
How to Write a Routine for 0CALDAY in InfoPackage Selection
For your reference, Im showing all tabs of the InfoPackage in below screens.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 13
How to Write a Routine for 0CALDAY in InfoPackage Selection
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 14
How to Write a Routine for 0CALDAY in InfoPackage Selection
Finally in the below screen you can find the Start Button, so just click it and load the data from Flat File.
Once you click on Start Button, you can see the message Data was requested , then go to Monitor and
see the status of the Data Load.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 15
How to Write a Routine for 0CALDAY in InfoPackage Selection
Monitor Screen:
See the below Monitor screen, you can find our selection also under Selection in right side and number of
records transferred.
Here our Flat file is having only few records will fall under 23-06-2011 date, but it is showing 10681 records,
so see the PSA Data, there you can find only related to 23-06-2011 date data.
PSA Data:
Click on PSA Icon like below.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 16
How to Write a Routine for 0CALDAY in InfoPackage Selection
See in above screen, you can find only 33 records are loaded into PSA, all these records are 23-06-2011
date records.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 17
How to Write a Routine for 0CALDAY in InfoPackage Selection
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 18
How to Write a Routine for 0CALDAY in InfoPackage Selection
InfoCube Data:
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 19
How to Write a Routine for 0CALDAY in InfoPackage Selection
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
For more information, visit the EDW homepage.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 20
How to Write a Routine for 0CALDAY in InfoPackage Selection
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 21