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: 

Can one field of a variant of an ABAP4 program takes value from a table ?

Former Member
0 Kudos

When I run an ABAP4 program, there is one input field called Time Stamp. If I run the program directly (without selecting a variant), this Time Stamp field is filled with a field value from a table called TVARVC, but if I select a variant of this program, this Time Stamp field is filled with another field value of the table TVARVC. It seems that the variant value can be filled with a value in system table, am I right? If this is the case, then how it is programmed?

Thanks

Message was edited by: Kevin Smith

3 REPLIES 3

Former Member
0 Kudos

Hi Kevin

In the table TVARVC you should insert a new record which name (field NAME) have to begin with SAP_SCMA_ and the type (field TYPE)is P for parameter or S for select-options and the values (field LOW and/or HIGH) are your value.

So you have to create a variant and for input field Time Stamp set flag SELECTION VARIABLE and then push button SELECTION VARIABLES. Now you have to insert the name of your record of TVARVC.

So when user choose this variant the input field Time Stamp is filled with value you have entered in TVARVC.

Now in TVARVC you can insert another record (if you want it isn't avaible for SELECTION VARIABLE function in the variant, you should give it a name it doesn't begin with SAP_SCMA_) and put this value in the input field Time Stamp during INITIALIZATION event:

INITIALIZATION.

SELECT * FROM TVARVC WHERE NAME = ......

Time Stamp = TVARVC-LOW.

........

Max

P.S. you have opened two post with the same problem, close older one.

Message was edited by: max bianchi

0 Kudos

We use the TVARV table a lot at my company, we have 30 some different variables, some parameters, so select-options. Most of which are date calculations. I wrote a program which looks at all of these variables are updates them via a BDC call transaction SM30. This program runs every night to update all of the variables. Maybe you could do something simular for updating your variables.

Regards,

Rich Heilman

0 Kudos

Hi Kevin,

I think you have multiple posts with the same question and you have marked one of them as being answered. Could you please close all these other posts as well?

Thanks,

Srinivas