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 creation

Former Member
0 Likes
2,780

Hi ,

is there any way of creating variant dynamically based on the selection screen values.

thx

7 REPLIES 7
Read only

Former Member
0 Likes
939

Yes u can do the same by using the field-symbols.

Read only

Former Member
0 Likes
939

Hi,

Please refer the following link:

[http://help.sap.com/search/highlightContent.jsp]

Regards,

Anurodh

Read only

Former Member
0 Likes
939

Hi

Yes it is possible....First you execute the program.....then give some values in the selection screen....Then press Save Button on the top.....then one new screen will appear in front of you...here you can set static variant & dynamic variant.....Suppose there is a date field And you want to make dynamic variant for that....then you have to choose the f4 help under the selection variable option....choose 😧 dynamic date calculation......Then go to the column "Name of Variable: Input only using f4" & press f4 help.....now you will get lots of options....

Current Date

Current date +/- ??? days

current date +/- ??? work days

First day of current month

nth working day of current month

First day of next month

First day of previous month

Last day of previous month

Last Day of the Current Month

now you choose your option correctly and give one name for that variant and save it....

Every time when you will execute your program the variant will set dynamically.

Arunima

Read only

Former Member
0 Likes
939

Hi,

Try like this.....

First maintain a variable with values in table TVARV. This can be done from transaction STVARV. Later this variable needs to be assigned to the variant. In stvarv set the variants under parameter or select options.

Next create the dynamic variant by pressing the SAVE button on the selection screen.

In the next screen (ABAP: Save as Variant) enter Variant name, description, set the u2018Selection variableu2019 (T) from the drop down

Svae it....

Now from the popup select the variable name created in Step1 and save the variant.

Select the variant from Variant catalog.

It will populate the varients from the ones you created in tvarv.

Regards

Debarshi

Read only

Former Member
0 Likes
939

Hi Lavanya,

Check this link.

[http://saptechnical.com/Tutorials/ABAP/DynamicVariant/Procedure.htm]

Regards,

Amit.

Read only

Former Member
0 Likes
939

Hi lavanyaa,

Hope this thread will help you..

Thanks.

Nitesh

Read only

Former Member
0 Likes
939

yes