on 03-08-2013 10:35 PM
Hi experts,
I have to load data in full mode with a filter on period on DTP between DSO and Infocube.
I am comfortable with it , but there is a type of data that I have to manage to avoid me big changes on my flow.
To simplify, let’s say data is coming from DSO as following:
Employee | WorkDate | ApprovDate | Hours |
A | 08/02/2013 | 10/03/2013 | 5 |
And In stvarv, I will create 2 variables as following:
First Date of current period (FDCP): 01/03/2013
Last Date of current period (LDCP): 31/03/2013
So what I have to do, is to control that approvdate is between FDCP and LDCP, and also superior to workdate.
If the 3 conditions are respected, I have to set the value of Approvaldate in Wordate, so my record will be:
Employee | WorkDate | ApprovDate | Hours |
A | 10/03/2013 | 10/03/2013 | 5 |
So I tought about creating a Start routine in my cube transfo level and do something as following:
LOOP AT SOURCE PACKAGE into structure
If APROVDAT between FDCP and LDCP
And WORKDATE LT APPROVDAT
WORKDAT = APPROVDAT
ENDIF
ENDLOOP
What do you think about it? What could you advice me?
Thanks.
Amine
Hello Amine,
Your logic looks good. Please go ahead with coding.
Regards,
Sangita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi...
You can try this variant..
LOOP AT SOURCE PACKAGE into structure WHERE WORKDAT LT APPROVEDAT
If APROVDAT between FDCP and LDCP
WORKDAT = APPROVDAT
ENDIF
ENDLOOP
This will check Workdat < approve date before copying into work area and improve performance.
regarding FDCP and LDCP , instead of taking them from DTP filter use system date to calculate .
Function Modules are available for it.
FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET.
From SYSDATE take Year and Month. Concatenate 0 with month.
Pass YYYY , Fiscal Year Variant ( Like K4) and Period ( 003) to get first and last dates.
Cheers
Anindya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amine,
What happens if your conditions are not met? Will the record still go to the Cube ?
Guess your code is just for illustration. Otherwise the logic seems fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sujit,
If you are refering to:
First Date of current period (FDCP): 01/03/2013
Last Date of current period (LDCP): 31/03/2013
I am going to store them in a tvarv table (T-code STVARV), they will be updated via an abap program.
If i understand you:
I can select/Declare them in the start routine.
And at the field level transformation i will implement that logic, right?
If APROVDAT between FDCP and LDCP
And WORKDATE LT APPROVDAT
WORKDAT = APPROVDAT
else
WORKDAT = SOURCE-PACKAGE-WORKDATE.
ENDIF
Thanks.
Amine
I
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.