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
1,707

Hi All,

I have a requirement in which I need to create a dynamic variant for the standard program RKO7KO8G.

In the selection screen there are two PARAMETERS, Settlement period and Settlement year. The requirement is:

"The Variant should be created with the Period and the Fiscal Year being obtained from the TVARVC table with the Period being the Z_PROC_CURR_FISCAL_PERIOD Variable and the Fiscal Year being the Z_PROC_CURR_FISCAL_YEAR Variable".

i.e. whenever the program is run in background it should consider the Current period and year.

Please let me know how to do this?

Thanks & Regards,

Neethu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,037

Hi,

These are the steps.

1. 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.

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

3. In the next screen (ABAP: Save as Variant) enter Variant name, description, set the u2018Selection variableu2019 (L) radio button and press u2018Selection variableu2019 push button.

4. In the next screen check that green traffic light is on under column T (T: Table variable from TVARV).

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

4 REPLIES 4
Read only

Former Member
0 Likes
1,038

Hi,

These are the steps.

1. 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.

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

3. In the next screen (ABAP: Save as Variant) enter Variant name, description, set the u2018Selection variableu2019 (L) radio button and press u2018Selection variableu2019 push button.

4. In the next screen check that green traffic light is on under column T (T: Table variable from TVARV).

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

Read only

0 Likes
1,037

Hi,

Thanks for the input.Could you please tell me in detail how to maintain variable in transaction STVARV. I am doing this for the first time, so dont have any idea.

Thanks,

Neethu.

Read only

0 Likes
1,037

Hi,

I got it.

Read only

JoffyJohn
Active Contributor
0 Likes
1,037

you create an zreport for calling std report.

In the zreport you write the logic to derive Settlement period and Settlement year,

data: rspar_tab type table of rsparams,

rspar_line like line of rspar_tab.

rspar_line-selname = 'P_BANK'. "for parameter

rspar_line-kind = 'P'.

rspar_line-low = 'CITI'.

append rspar_line to rspar_tab.

rspar_line-selname = 'S_VEND'. " for selection-option

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = 'ASD12'.

append rspar_line to rspar_tab.

Then Submit <std report name> WITH

SELECTION-TABLE T_RSPAR.

Then schedule this report

Try something like this