07-08-2015 10:27 AM
Hi Expert,
Not sure am I use a correct discussion forum. I would like to set SAP standard report date range with dynamic date variant. My criteria for the date is beginning of the month to yesterday date. Eg. today is 8-Jul-2015, date range should show from 1-Jul-2015 to 7-Jul-2015.
I checked existing date dynamic selection variables but no such condition. I can only set To Date with Current -1 but not From Date. Anyone can help ? Thank you.
Regards,
Oscar
07-08-2015 10:38 AM
Hello Oscar,
Assuming that your query is for a Selection screen of Standard report as you mentioned. Then....it looks very much possible.
Select First day of current month option for From Date .
Select Current date +/- ??? days option for To Date by giving value -1 for ???.
Regards
KJogeswaraRao
07-08-2015 10:38 AM
Hello Oscar,
Assuming that your query is for a Selection screen of Standard report as you mentioned. Then....it looks very much possible.
Select First day of current month option for From Date .
Select Current date +/- ??? days option for To Date by giving value -1 for ???.
Regards
KJogeswaraRao
07-08-2015 10:42 AM
Hi Oscar,
You can write a small code at INITIALIZATION event of the report.
if so_date is range table.
so_date-low= sy-datum+0(4) && sy-datum+4(2) && '01'.
so_date-high = sy-datum - 1.
so_date-sign = 'I'.
so_date-option = 'BT'.
append so_date.
Once the screen get display, you will get default set date.
or you can use RS_CREATE_VARIANT function to create static variant.
Regards,
Praveer.
07-09-2015 2:04 AM
Hi All,
Thanks for your reply. As this is SAP standard report, I'm not prefer code change. As for Jogeswara's suggestion, the report selection date has a date range but in Variant Attribute, there is only one row of date field object. I can only make use of one selection variable and cannot define From and To date field separately.
Regards,
Oscar
07-09-2015 2:18 AM
Hi Oscar
Quite right there only a couple of variants that permit for From and Date range setting and I don't think those will meet your requirements.
Another option is just to right a small front end Z Program which allow you to then have a variant in the format described by Jogeswara. This report can then submit the standard program.
Regards
Arden