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

validation

Former Member
0 Likes
937

i need to validate vkorg field by using check table tvko by using select single

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
896

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

8 REPLIES 8
Read only

Former Member
0 Likes
896

HI,

use AT SELECTION-SCREEN ON VKORG.

Read only

Former Member
0 Likes
897

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

Read only

Former Member
0 Likes
896
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.
Read only

Former Member
0 Likes
896

Hi Rasheed,

select single * from tvko where vkorg = vkorg.

if sy-subrc <> 0. write: / 'Not found'. exit. endif.

Regards, Dieter

Read only

Former Member
0 Likes
896

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.

Read only

Former Member
0 Likes
896

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

Read only

Former Member
0 Likes
896

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.

Read only

Former Member
0 Likes
896

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.