Hi
You can use your code in the AT SELECTION-SCREEN event, you set the error only if any data is ok:
select-options s_vkorg for tvko-vkorg.
data: r_vkorg type range of tvko-vkorg,
l_vkorg like line of r_vkorg.
data: t_tvko type standard table of tvko with header line.
at selection-screen.
free r_vkorg.
select * into table t_tvko
from tvko
where vkorg in s_vkorg.
loop at t_tvko.
authority-check object 'V_VBAK_VKO'
id 'VKORG' field t_tvko-vkorg
id 'VTWEG' dummy
id 'SPART' dummy
id 'ACTVT' field '03'.
if sy-subrc = 0.
l_vkorg(3) = 'IEQ'.
l_vkorg-low = t_tvko-vkorg.
append l_vkorg to r_vkorg.
endif.
endloop.
if r_vkorg is initial.
* -----> User not authorizzated for any sales org.
endif.
In your selection you use the range instead of select-option
Max