Step1:Creating Variants for SAP ABAP programs Normal
Variant is a concept of saving a set of input fields with values with a particular name, so that we can use the same set of inputs next time, the below is the example of creating variants in SAP ABAP programs.
Create a program with a selection-screen.
REPORT ZSAPN_DYNAMICDATE. DATA LV_DATUM TYPE DATUM. PARAMETERS P_DATE TYPE DATUM. SELECT-OPTIONS S_DATE FOR LV_DATUM.
Provide some input values, click on save button.
Provide variant name, description and save.
How to use variant in SAP ABAP programs
Go to the program selection screen, you will find variant icon, click on variant icon.
You will find list of variants available for the program, double click on any variant, the values will be populated to screen automatically.
Step2:Dynamic date in variant for parameters Normal
Go to report selection screen.
Provide some input values, click on save button.
Press F4 on selection variable input of parameter date,select D:Dynamic Date Calculation, enter.
Press enter, press F4 on name of variable, double click on current date +/- ??? days.
A pop up will open enter -1, means current date -1..(todays date -1, changes dynamically everyday).
Save the variant, go to report selection-screen select variant by clicking on variant, you will find yesterdays date on selection screen, this will changes dynamically every day.