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

Select options validations

Former Member
0 Likes
657

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
624

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

4 REPLIES 4
Read only

Former Member
0 Likes
625

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

Read only

Former Member
0 Likes
624

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,

Read only

Former Member
0 Likes
624

hi

try with writing ur validation in AT SELECTION-SCREEN OUTPUT

reward if helpful.

Read only

Former Member
0 Likes
624

Hi Senior Folks ,

Kaluvala Santosh's answer solved my prurpose .

Thanks Guru .......

Regards ,

Jaga.