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 variant creation

Former Member
0 Kudos
2,004

Hi ,

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

thx

7 REPLIES 7

Former Member
0 Kudos
163

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

Former Member
0 Kudos
163

Hi,

Please refer the following link:

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

Regards,

Anurodh

Former Member
0 Kudos
163

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

Former Member
0 Kudos
163

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

Former Member
0 Kudos
163

Hi Lavanya,

Check this link.

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

Regards,

Amit.

Former Member
0 Kudos
163

Hi lavanyaa,

Hope this thread will help you..

Thanks.

Nitesh

Former Member
0 Kudos
163

yes