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

Select option

Former Member
0 Likes
766

Hi experts,

I reading a TVARV table. In this table I defined some value to a variable.

I want to check whether the BUKRS from a parameter is among this values or not.

I'm using: if p_bukrs in z_tvarv_bukrs.

Is this statement correct or not? Is there any other way to check?

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
735

hi,

the statement is correct in case z_tvarv_bukrs is range of bukrs, but did you try on your own?

If z_tvarv_bukrs is an internal table, where one field is bukrs, than you can use READ TABLE to check if the value exists

ec

5 REPLIES 5
Read only

JozsefSzikszai
Active Contributor
0 Likes
736

hi,

the statement is correct in case z_tvarv_bukrs is range of bukrs, but did you try on your own?

If z_tvarv_bukrs is an internal table, where one field is bukrs, than you can use READ TABLE to check if the value exists

ec

Read only

saranwin
Contributor
0 Likes
735

Hi,

Define like and check . Use the follow coding

Select-options : so_bukrs for table-bukrs.

at selection-screen on value request for p_field.

perform select_value.

Form select_value.

select single field from table into p_field where bukrs in so_bukrs.

Endform.

regards,

Saran

Read only

Former Member
0 Likes
735

p_bukrs is not coming from the selection-screen. It's coming after a selection.

So I cannot define as a select-option. It's 1 single value, do you have any idea in this case?

Read only

Former Member
0 Likes
735

Hi,

Try like this:

if p_bukrs CA z_tvarv-bukrs.

Regards,

Bhaskar

Read only

Former Member
0 Likes
735

Hi

data : lv_varname_t type tvarv- .

select single var_name from TVARV into lv_varname_t where var_name eq p_bukrs.

if sy-subrc = 0.

" Value found in the table.

else.

" Value not found in the table.

endif.