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 on selection screen parameter.

Former Member
0 Likes
963

I have select options in my selection screen.

1) s_a

2) s_b

Requirement:-

1) If I run the program and click the arrow on the "s_a" field, it should open multi selection screen. From that I can make multi entry or upload data from excel file.

2) If "s_a" and "s_b" is empty it sud throw an error message.

Can I do this validation in AT SELECTION-SCREEN n how?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
824

Hi

AT SELCTION-SCREEN.
  CHECK SY-UCOMM = 'ONLI' OR
        SY-UCOMM = 'PRIN' OR
        SY-UCOMM = 'SJOB'.

  IF S_A[] IS INITIAL AND
      S_B[] IS INITIAL.
* ------------->  MESSAGE ERROR.
  ENDIF.

Max

7 REPLIES 7
Read only

Former Member
0 Likes
824

for 1 SELECT-OPTIONS .....VALUE-REQUEST

for 2 SELECT-OPTIONS .....OBLIGATORY

Read only

Former Member
0 Likes
825

Hi

AT SELCTION-SCREEN.
  CHECK SY-UCOMM = 'ONLI' OR
        SY-UCOMM = 'PRIN' OR
        SY-UCOMM = 'SJOB'.

  IF S_A[] IS INITIAL AND
      S_B[] IS INITIAL.
* ------------->  MESSAGE ERROR.
  ENDIF.

Max

Read only

0 Likes
824

Thnx for yr help.It solve my issue.

Read only

Former Member
0 Likes
824

hi abhijeet,

at selection screen u can validat eur select options and print error msg too.. like an exampl egiven below,

if s_a-low = 0

message 'error' type 'I'.

like this u can specify..

and by clicking arrow mark asub screen opens where u can select multiple values by giving the range in option green color range tab.

Read only

Former Member
0 Likes
824
tables : sscrfields.

at selection-screen.

CHECK SSCRFIELDS-UCOMM = 'ONLI'.

if s_a[] is initial 
SET CURSOR FIELD 'S_A-LOW'.
  *error message
endif.  

if s_b[] is initial 
SET CURSOR FIELD 'S_B-LOW'.
  *error message
endif. 
Read only

Former Member
0 Likes
824

hi Abhijeet,

u can do the first by just writing the sel-options as:

S_A like table-field (say vbak-vbeln). then the multiple selection comes automatically.

the second - u can do thru at selection-screen by just writing a if condition.

if s_a-low is initial and s_a-high is initial.

message e001.

endif.

Let me know if you still have any issue.

/Praveen

Read only

0 Likes
824

check program 'demo_selection_screen_events '

Sudheer