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: 

Values in TVARV

Former Member
0 Kudos

hello all,

i have a condition to test a particular variable (v_werks in my case) if exists it in my tvarv entry. would you give me an idea how is it done the best. i tried declaring select-options and populated it using the following code:

select-options so_werks for t001w-werks.

select * from tvarv

into corresponding fields of table so_werks

where name = 'Z_REPAIR_SITES'.

but the effect of declaring so_werks is that it creates initial screen in my report program which i don't want to appear...

please help,

sid

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

DATA: GT_TVARV LIKE TABLE OF TVARV WITH HEADER LINE.

select * from tvarv into table GT_TVARV

where name = 'Z_REPAIR_SITES'.

LOOP AT GT_TVARV.

so_werks-SIGN = GT_TVARV-SIGN.

SO_WERKS-OPTION = GT_TVARV-OPTI.

SO_WERKS-LOW = GT_TVARV-LOW.

SO_WERKS-HIGH = GT_TVARV-HIGH.

APPEND SO_WERKS.

ENDLOOP.

Max

5 REPLIES 5

Former Member
0 Kudos

Hi

DATA: GT_TVARV LIKE TABLE OF TVARV WITH HEADER LINE.

select * from tvarv into table GT_TVARV

where name = 'Z_REPAIR_SITES'.

LOOP AT GT_TVARV.

so_werks-SIGN = GT_TVARV-SIGN.

SO_WERKS-OPTION = GT_TVARV-OPTI.

SO_WERKS-LOW = GT_TVARV-LOW.

SO_WERKS-HIGH = GT_TVARV-HIGH.

APPEND SO_WERKS.

ENDLOOP.

Max

sridhar_k1
Active Contributor
0 Kudos

Instead of select-option use ranges:

ranges r_werks for t001w-werks.

Regards

Sridhar

former_member214131
Active Contributor
0 Kudos

Hello,

If you want the Select option. so_werks not to appear on selection screen, then:

select-options so_werks for t001w-werks no-display.

I am not sure about your requirement.

Best regards, Murugesh AS

ferry_lianto
Active Contributor
0 Kudos

Hi Sid,

You can code something like this.

DATA: BEGIN OF I_WERKS OCCURS 0,
        WERKS LIKE T001W-WERKS.
DATA: END OF I_WERKS.

INITIALIZATION.

SELECT <field name>       <-  could be 'LOW' 
INTO TABLE I_WERKS 
FROM TVARV
WHERE NAME = 'Z_REPAIR_SITES'.

LOOP AT I_WERKS.
  SO_WERKS-SIGN   = 'I'.
  SO_WERKS-OPTION = 'EQ'. 
  SO_WERKS-LOW    = I_WERKS-WERKS.
  APPEND SO_WERKS.
ENDLOOP.

Hope this will help.

Regards,

Ferry Lianto

0 Kudos

thanks a lot guys, i've learned a lot...

regards,

sid