Application Development 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: 

Date Issues while creating a Variant.

Former Member
0 Kudos

HI,

I have a report with a date field, which is hard coded where from date = 1st day of month and todate = system date -1,

How do i create a variant with the date field set as above.

I need to create a variant, so that i can schedule the report daily.

Rgds

Norman

1 ACCEPTED SOLUTION

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can use FM "RS_CREATE_VARIANT" inside the report and then use this variant for execution.

Other FM to check out for RS_VARIANT_EXISTS .

4 REPLIES 4

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can use FM "RS_CREATE_VARIANT" inside the report and then use this variant for execution.

Other FM to check out for RS_VARIANT_EXISTS .

prasoon_sahay
Participant
0 Kudos

Please search in SDN before posting your issues.

You need to create dynamic variant

Try below link for its detail:

http://wiki.sdn.sap.com/wiki/display/ABAP/Creatingdynamicvariantusingtable+TVARV

Regards,

Prasoon Sahay

satyajit_mohapatra
Active Contributor
0 Kudos

While saving the variant.....

1. Select selection variable as D for TO date

2. Select Current date - XXX days as give it as -1 so it will show as currentday- 1 days....

1. Select selection variable as D for FROM date

2. Select First day of current month.....

You can set these values in ALV options bar displayed in variant maintenance....

Don't go for TVARVC or manually changing the variant through code...it's the easiest option available...

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

You can achieve this by creating a namic variant. Checkout below blog on how to create.

[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/17257] [original link is broken] [original link is broken] [original link is broken];

Thanks,

Vinod.