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 variant date range

Former Member
0 Likes
1,940

Hi experts,

i need to create dynamic variant for date range (so_date-low, so_date-high): sy-datum-1.

that will bring the data in the report for yesterday.

How can i do this?

i know how can i make variant for so_date-low

i dont know how can i do that on so_date-high.

thanks,

Michal.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,136

thanks for reply.

i dont know how can i create dynamic variant for the variable so_date-high.

to the variable so_date-low i succeed.

thanks in advanced,

Michal.

8 REPLIES 8
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,136

What do you mean by a dynamic variant ?

Just initializing the values to the screen fields will satisfy your requirement.

In at selection-screen output,

so_dat-low = sy-datum - 1.

so_dat-high = so_dat-low.

append so_dat.

Read only

former_member404244
Active Contributor
0 Likes
1,136

Hi,

In the initialization event you can put your code like this

so_dat-low = sy-datum - 1.

so_dat-high = so_dat-low.

append so_dat.

Regards,

Nagaraj

Read only

0 Likes
1,136

Hi nagaraj,

Initialization triggers only once right

Read only

Former Member
0 Likes
1,136

Hi,

Befor Saving the variant go into change Mode : "Copy Screen Assign ment" then click on cloumn "Selection Variable" against that date field (F4 help) select Dynamic Date Caliculation.

Then Select the Value "Name of the variable" to Select the date .

regards.

Venu Madhav

Read only

former_member194669
Active Contributor
0 Likes
1,136

1. Execute the report and you will get your selection screen then press save

2. system will take u to variant screen , select the line of your date select-options field from the list and scroll right

3. double clik on "selection variable " column and select "D"

4. double clik on "Name of variable" last column and select "Current date - xxx,current date + yyy" system will provide you popup with "Enter a value xxx" and "Enter a value for yyy" and enter value 1 in xxx and 0 in yyy

and save the variant . now your S_DATE_LOW will be system date - 1 ie yesterdays date

a®

Read only

Former Member
0 Likes
1,137

thanks for reply.

i dont know how can i create dynamic variant for the variable so_date-high.

to the variable so_date-low i succeed.

thanks in advanced,

Michal.

Read only

0 Likes
1,136

As said in my earlier reply select

"Current date - xxx,current date + yyy" system will provide you popup with "Enter a value xxx" and "Enter a value for yyy"

and here XXX is S_DATE-LOW and YYY is for S_DATE-HIGH . and enter values in these will provide you dynamic variant.

a®

Read only

Former Member
0 Likes
1,136

i guess date questions are no more allowed.. any ways please search.. you will find your answer ...

[search link|http://forumsa.sdn.sap.com/search.jspa?threadID=&q=dynamicdatevariantinselection+screen&objID=f50&dateRange=all&numResults=30&rankBy=10001]

BTW for high value you can write the code in initialization event of your report.