‎2007 Mar 01 10:49 AM
i need to validate vkorg field by using check table tvko by using select single
‎2007 Mar 01 10:51 AM
Hello,
parameters: p_vkorg like tvko-vkorg.
data: lr_tvko like tvko.
select single * from tvko into lr_tvko where vkorg = P-VKORG.
if sy-subrc ne 0.
error message.
endif.
If useful reward.
Vasanth
‎2007 Mar 01 10:51 AM
‎2007 Mar 01 10:51 AM
Hello,
parameters: p_vkorg like tvko-vkorg.
data: lr_tvko like tvko.
select single * from tvko into lr_tvko where vkorg = P-VKORG.
if sy-subrc ne 0.
error message.
endif.
If useful reward.
Vasanth
‎2007 Mar 01 10:52 AM
select single vkorg from tvko into tvko-vkorg where vkorg eq v_vkorg.
if sy-subrc ne 0.
message e000(ZZ) with 'Vkorg not found'.
endif.
‎2007 Mar 01 10:52 AM
Hi Rasheed,
select single * from tvko where vkorg = vkorg.
if sy-subrc <> 0. write: / 'Not found'. exit. endif.
Regards, Dieter
‎2007 Mar 01 10:55 AM
hi rasheed,
at selection screen on p_vkorg.
select single * from tvko into wa_tvko
where vkorg = p_vkorg.
if sy-subrc ne 0.
message E001(ZZ).
endif.
‎2007 Mar 01 10:57 AM
parameters p_vkorg type -
.
at selection-screen on p_vkorg.
select single vkorg from tvko into tvko-vkorg where vkorg eq v_vkorg.
if sy-subrc ne 0.
message 'Value does not exist in check table!' type 'E'.
endif.
start-of-selection.
-
-
reward if it helps u...
sai ramesh
‎2007 Mar 01 10:59 AM
hi
first in the selection screen, declare this field as :
selection-screen begin of block b1 with frame title text-011.
select-options s_vkorg for vbak-vkorg.
selection-screen end of block b1.
now at the at selection-screen event.
write the below code to validate the inputs:
at selection-screen.
perform sub_validate_vkorg.
form sub_validate_vkorg.
data l_vkorg like vbak-vkorg. "local vairable
select single vkorg
from tvko
into l_vkorg
where vkorg in s_vkorg.
if sy-subrc <> 0.
message e001. "create message class zclass and declare with the report heading.
endif.
this should work.
regards,
shamim
rewards point if u find it helpful.
‎2007 Mar 01 11:40 AM
AT SELECTION-SCREEN ON vkorg
write the select query
if sy-subrc ne 0.
error message
endif.
when the user enters any invalid value for vkorg it will display the error message and takes the program control to the selection screen where the user can re-enter the selections.