‎2008 May 02 11:47 AM
Hi Senior ABAP folks ,
I have ten select options and should promt user to enter atleast one select options.
If i write my validations in AT SELECTION-screen event it is not allowing me to press the arrow button in select-options before that it throws error to enter atleast one field .
If i write my validations in start of selection event it throws the error and leaves to program .When the error msg is thrown i want the contol tobe back in the selection screen .I tried all leave screen probablities...not working
Kindly go through the below code and advice .
AT SELECTION-SCREEN.
To validate the vendor
select single lifnr from lfa1 into
lfa1-lifnr where lifnr in s_lifnr.
if sy-subrc ne 0.
message e124 with
text-113 s_lifnr-low text-116.
endif.
TO validate the BP
SELECT single partner FROM but000
INTO but000-partner WHERE
partner IN s_gpart.
IF sy-subrc NE 0.
MESSAGE e124 with
text-115 s_gpart-low text-118.
ENDIF.
To validate the IO
SELECT single insobject FROM dimaiobpar
INTO dimaiobpar-insobject WHERE
insobject IN s_vtref.
IF sy-subrc NE 0.
MESSAGE e124 with
text-114 s_vtref-low text-117.
ENDIF.
Start of the selection process***************************
START-OF-SELECTION.
IF s_chect[] IS INITIAL AND
s_aug_ap[] IS INITIAL AND
s_augdt[] IS INITIAL AND
s_wrbtr[] IS INITIAL AND
s_lifnr[] IS INITIAL and
s_pymet[] IS INITIAL AND
s_chuser[] IS INITIAL AND
s_gpart[] IS INITIAL AND
s_vtref[] IS INITIAL and
s_opbel[] is initial and
s_mdopbl[] is initial.
MESSAGE e126.
leave screen.
endif.
selection continues................
(e126 - Enter atleast one filed )
Regards,
Jaga
‎2008 May 02 11:51 AM
Hi
in these cases you have to give an information message instead of an error message as below and use the stmt leave list-processing
START-OF-SELECTION.
IF s_chect[] IS INITIAL AND
s_aug_ap[] IS INITIAL AND
s_augdt[] IS INITIAL AND
s_wrbtr[] IS INITIAL AND
s_lifnr[] IS INITIAL and
s_pymet[] IS INITIAL AND
s_chuser[] IS INITIAL AND
s_gpart[] IS INITIAL AND
s_vtref[] IS INITIAL and
s_opbel[] is initial and
s_mdopbl[] is initial.
MESSAGE i126.
leave list-processing.
santhosh
‎2008 May 02 11:51 AM
Hi
in these cases you have to give an information message instead of an error message as below and use the stmt leave list-processing
START-OF-SELECTION.
IF s_chect[] IS INITIAL AND
s_aug_ap[] IS INITIAL AND
s_augdt[] IS INITIAL AND
s_wrbtr[] IS INITIAL AND
s_lifnr[] IS INITIAL and
s_pymet[] IS INITIAL AND
s_chuser[] IS INITIAL AND
s_gpart[] IS INITIAL AND
s_vtref[] IS INITIAL and
s_opbel[] is initial and
s_mdopbl[] is initial.
MESSAGE i126.
leave list-processing.
santhosh
‎2008 May 02 11:54 AM
Hi,
SELECT-OPTIONS s_p_cid FOR zscp_project-circle_id OBLIGATORY NO INTERVALS.
Pls use the above statement for the select option. It will throw an error message for the user to enter at least a single value.
Hope this helps ur problem
Pls reward if useful.
thanks,
Sirisha,
‎2008 May 02 11:56 AM
hi
try with writing ur validation in AT SELECTION-SCREEN OUTPUT
reward if helpful.
‎2008 May 02 12:03 PM
Hi Senior Folks ,
Kaluvala Santosh's answer solved my prurpose .
Thanks Guru .......
Regards ,
Jaga.