Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic loading dates

Former Member
0 Likes
858

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

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
815

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

6 REPLIES 6
Read only

FredericGirod
Active Contributor
0 Likes
816

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

Read only

0 Likes
815

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

Read only

0 Likes
815

You would like to put that into a selection screen of a specific report ?  or you would like to create a job ? 

Read only

0 Likes
815

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

Read only

0 Likes
815

For my point of view the better is to create 12 jobs with two steps.

  • First step is an Abap program, that check if a variable of the TVARV is empty or not
  • Second step is the transaction with the variable of the TVARV

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

Read only

0 Likes
815

Thanks Frédéric

Amine