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: 

Get value from TVARVC table to select-options

Former Member
0 Kudos

Hi,

I have a entry in the TVARVC table. I need to know how to assign it to the select-option by default.

eg, if i have z_vkorg as type S , low is 1000 and high is 1000 sign is I and opt is bt.

how to assign it to the select-options in the selection screen by default.

Thanks and Regards,
Muthu

1 ACCEPTED SOLUTION

TanmayVerma
Active Participant
0 Kudos

Hi ,

This can be achieved very easily but creating a dynamic variant. While saving the variant you have an option to enter  selection variable. Select the value as 'T' ( TVARVC table ) and then select the TVARVC entry using F4 in  'name of variable'. The values will be populated automatically.

~Tanmay

7 REPLIES 7

Former Member
0 Kudos

Hi,

Get the data from TVARVC into internal table and pass it to your select option in INITIALIZATION Event. Find below a sample code.

TYPES: BEGIN OF ty_tvarvc,

            name  TYPE rvari_vnam,

            sign  TYPE tvarv_sign,

            opti  TYPE tvarv_opti,

            low   TYPE tvarv_val,

            high  TYPE tvarv_val,

           END OF ty_tvarvc.

SELECT   name

            sign

            opti

            low

            high INTO TABLE lt_tvarvc

     FROM tvarvc

     WHERE name = ' z_vkorg'

       AND type = 'S'.

Loop at lt_tvarvc in wa_tvarvc.

s_vkorg-sign = wa_tvarvc-sign.

s_vkorg-option = wa_tvarvc-opti.

s_vkorg-low = wa_tvarvc-low.

s_vkorg-high = wa_tvarvc-high.

append s_vkorg.

clear s_vkorg.


endloop.

Venkat_Sesha
Advisor
Advisor
0 Kudos

Use Transaction STVARV.

Former Member
0 Kudos

Hi,

Thank you for the answers,
While i execute the report, then the select-options eg., vkorg must be filled with value from tvarvc table.

I tried initialization before but i am getting some RT errorr....

0 Kudos

Hi,

Can you elaborate what error are you getting.

You can also do as Phillip has mentioned via saving the

Variant and selecting the variant from STVARV.

BR.

Phillip_Morgan
Contributor
0 Kudos

It depends on how you need to use this. Is it default for everybody? specific user?

You may already know, but you can create a variant that takes the values for a specific parameter or select-option from TVARV. This is done with no programming.

TanmayVerma
Active Participant
0 Kudos

Hi ,

This can be achieved very easily but creating a dynamic variant. While saving the variant you have an option to enter  selection variable. Select the value as 'T' ( TVARVC table ) and then select the TVARVC entry using F4 in  'name of variable'. The values will be populated automatically.

~Tanmay

0 Kudos

thank you Tanmay