cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

Hi,

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 report...so 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.

Thanks,

Uday.

former_member184494
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Arun,

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 templates...as 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 week..so 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.

JJP

Former Member
0 Kudos

Hi,

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.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = ZCMTD_LOW-1.

*initializing low interval limit

L_S_RANGE-HIGH = SY-DATUM.

*initializing high interval limit

L_S_RANGE-SIGN = 'I'.

*defining interval as inclusive

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

May be this is helpful.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edc...

Hope it is useful.

Thanks,

Ashok

Former Member
0 Kudos

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