Showing results for 
Search instead for 
Did you mean: 

customer exits (0calday) for a query to populate dates dynamically

Former Member
0 Kudos


Our user has this requirement for running a reporting in background for every previous week and month which has 34 variants.

Please tell if the way i choose is correct and also any suggestion for the below!...

1. wanted to use reporting agent for running the report in the background with reporting agent+ webtemplates.

2. and also wanted to get the dates populated dynamically in the thought of using CUSTOMER EXITs.

please help me with the code to write in CMOD. for populating the dates for every previous week and month dynmically.

- jj

Edited by: Jpjuvvan on Jun 1, 2009 8:36 PM

Edited by: Jpjuvvan on Jun 1, 2009 8:39 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jpjuvvan

Why dn't you go for variant.

It will dynamically populate the values of variables.



Active Contributor
0 Kudos

I would recommend variants since this makes the query flexible in terms of any changes etc...

Former Member
0 Kudos


The report has 34 variants for which the date ( 0calday) RANGE has to be populated dynamically when I am running the report in the background using Reporting agent( using 'Precaculating of Web reporting agent setting).

My concern is ..

1. How can I dynamically populate the dates(0calday) for running the report weekly and monthly for all 34 varinats in the report in the backgrond?( since dont want to manually enter the date range for all 34 variants of the report)

2. Since I am using precalculating web templates as reporting agent setting should I have to create webtemplate on the query ( if so ..will it automatically run the 34 variants) or should I create web template for 34 variants using query views ( even then the dates has to be populated automatically/dynamically)?

For eg. If I am running the report on 1s t June....for Monthly the date range should be 5/1/2009 to 5/31/2009 and for weekly I run the report on sunday of every if i run the report on 6/14/2009 then the date range should be 6/5/2009 to 6/13/2009.

The date range should be populated DYNAMICALLY , since I don't want to manulally give the date range for all 34 varinats every time I run the report.

Please suggest.


Former Member
0 Kudos


To get the previous month, use the below code.

WHEN 'your variable'.

  • you variable name

data: ZCMTD_LOW like sy-datum.

*defining variable for using as a starting date of the interval

ZCMTD_LOW +4(2)= sy-datum.



*initializing low interval limit


*initializing high interval limit


*defining interval as inclusive



May be this is helpful.

Hope it is useful.



Former Member
0 Kudos

Thnx Ashok..will try out this ..will let you know if it worked!