2013 Jun 13 9:47 AM
Hi experts,
I have a complex requirment in BW, I am looking for a way to automate some laoding filters, I tought that an abap code will help me in my case.
Lets' say we are in period 006.2013. I would like to load all the previous periods limited to the current year one by one until the current period as following:
001.2013
002.2013
003.2013
004.2013
005.2013
006.2013
I think that an abap code and/or SM36 events will help me to schedule process chains. what do you think? Any other ideas based on your own experiences?
Thanks for your support.
Amine
2013 Jun 13 10:26 AM
Hi Amine,
you would like to play with a variant ? with the TVARVc table ? with an Abap code ?
where do you want to use this value ?
Regards
Fred
2013 Jun 13 10:26 AM
Hi Amine,
you would like to play with a variant ? with the TVARVc table ? with an Abap code ?
where do you want to use this value ?
Regards
Fred
2013 Jun 13 11:04 AM
Hi Fred,
I think that a combination of TVARVC table and an Abap code will do the trick.
But i am for now stuck how to set it.
Amine
2013 Jun 13 11:22 AM
You would like to put that into a selection screen of a specific report ? or you would like to create a job ?
2013 Jun 13 11:40 AM
This process is to be applied to BW infocubes.
So it's better to go with the second option which is creatings a job.
Thanks.
Amine
2013 Jun 13 2:43 PM
For my point of view the better is to create 12 jobs with two steps.
Before that, you have to create a job to manage this variable.
So to be more clear.
In the TVARVc, you create twelve variable : 001, 002, 003 .....
001 will contain (for today) 001.2013
002 will contain (for today) 002.2013
...
007 will contain (for today) //nothing//
The contains of this variable are uptaded by a specific job, that runs at the first day of the month (you could schedul that in the SM36/SM37 trans.)
the code could look like that (I didn't control the code in SAP):
data : IS_TVARVC like tvarvc ,
w_field(20) type c.
field-symbols <field> type any.
do 12 times.
if sy-tabix gt sy-datum+4(2).
clear IS_TVARVc-LOW.
else.
concatenate sy-tabix+0(3) sy-datum+0(4) into IS_TVARVC-low.
endif.
concatenate 'MY_FIELD_' sy-tabix into w_field.
assign (w_field) to <field>.
check sy-subrc eq space.
update tvarvc .... where name eq <field>.
enddo.
The first step of the job, run a simple program could look like that :
parameters P_MONTH(3) type c.
data : w_field(20) type c,
w_low type tvarv_val.
field-symbols : <field> type any.
concatenate 'MY_FIELD_' p_month into w_field.
assign (w_field) to <field>.
check sy-subrc eq space.
select single low
into w_low
from tvarvc
where name eq <field> .
if w_low eq space.
message e...(..).
endif.
the program will stop with an error, so the second step of the job will never run.
It's little bit complex, I hope you will find something inside
regards
Fred
2013 Jun 13 5:39 PM