‎2008 Sep 15 2:06 PM
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?
‎2008 Sep 15 2:10 PM
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
‎2008 Sep 15 2:10 PM
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
‎2008 Sep 15 2:10 PM
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
‎2008 Sep 15 2:14 PM
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?
‎2008 Sep 15 2:12 PM
‎2008 Sep 15 2:31 PM
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.