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: 

dynamic date calculation in variants

Former Member
0 Kudos

Hi all,

I need to keep a dynamic date selection in the selection screen variant for the background processing . The selection has to be from start of the month to current date - 1 . for eg. if the current date is 11th june, then the selection screen should contain 1st june to 10th june .

Thanks & Regards

Magesh Anandan

6 REPLIES 6

Former Member
0 Kudos

var = sy-datum-1.

u can use like this.

Regards

anbu

Former Member
0 Kudos

Hi,

you mean you are scheduling a variant and in that you want the date like that?

Raj

Former Member
0 Kudos

In INTIAliZATION event u can code to check the current date and from thsi calculate the date u want on the selct options , as these are going to be the default in back ground mode user will able run the date .

u can always code if want to initialize in background only check for sy-batch

Former Member
0 Kudos

Hi Magesh Anandan,

you may display 2 parameters, both of type date. One of them should be "date from" and the other one "date to".

Then, when saving the variant attributes, check "D: Dynamic date calculation" on column "selection variable". Now you have to populate column "Name of variable (input only using F4)". On the first date parameter ("from"), choose "First day of current month"; on the second date parameter ("to"), choose "Current date +/- ??? days", and enter "-1" when the popup asks you to.

I hope this helps. Kind regards,

Alvaro

Former Member
0 Kudos

Dear magesh

use this document to learn how to create dynamic variant

http://www.saptechnical.com/Tutorials/ABAP/DynamicVariant/Procedure.htm

in choose date validation, choose from month start to today.

this will solve your problem

Regards

abhinesh

Edited by: abhinesh mishra on Jun 11, 2008 8:54 AM

sachin_mathapati
Contributor
0 Kudos

1> First fill in all the selection screen data including Date and save the data as variant.

2> Give some variant name and description. Select the check box corresponding to the Date range as selection variable (L). Next press push button selection variables in the tool bar.

3> Click on the yellow light corresponds to column D(Stands for Dynamic). It will become green colour.

4>Then press the down arrow at the end of the date range.

5>It will display a popup for various calculations.For your requirement choose 'From month start to today'.

6> Save the Variant.

Reward Points if Helpful.