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

Selction Screen

Former Member
0 Likes
532

Hi Everybody,

can anybody help me regarding selection-screen.

My requirement is

in Selection screen iam having the following fields with condition

A-...... to .......

B-...... to .......

C-...... to .......

D-...... to .......

E-...... to .......

F-...... to .......

here condition is either A or D were mandatory

and if 'D' is populated then 'E','F' are mandatory.

Thanking you,

4 REPLIES 4
Read only

Former Member
0 Likes
506

Hi Sunil,

Instead of making a selection screen like this the best way is do this validaion in AT SELECTION SCREEN.

There you can check for these conditions and it is only the best way to do this.

Regards,

Atish

Read only

0 Likes
506

Agreed - this is best done in the "at selection-screen" event... one thing to be careful of is that since you appear to be using select-options for each criterion, you need to code you validation to check the body of the range, not just the screen elements i.e.

if s_bukrs[] is initial.
  set cursor field 'S_BUKRS-LOW'.
  message e398(00) with 'Company Code must be provided'
    space space space.
endif.

Read only

Former Member
0 Likes
506

Hi Guys,

iam asking how to write code for looping the screen.

i.e., we must give value either 'A' or 'D' ('A' or 'D' is Mandatory)

if we give any value for 'A' then 'B', 'C' should be mandatory( if 'A' is populated)

if we give any value for 'D' then 'E', 'F' should be mandatory( if 'D' is populated)

I think this condition will be done on AT Selection-Screen OUTPUT.

Read only

0 Likes
506

Hi Sunil

This validation is done in AT SELECTION-SCREEN event.

Your Code:

AT SELECTION-SCREEN.

IF A[] IS INITIAL AND D[] IS INITIAL.

Message 'Error' TYPE e. " Sunil replace this by your message class.

ENDIF.

IF NOT A[] IS INITIAL.

IF B[] IS INITIAL OR C[] IS INITIAL.

Message 'Error' TYPE e. " Sunil replace this by your message class.

ENDIF.

ENDIF.

IF NOT D[] IS INITIAL.

IF E[] IS INITIAL OR F[] IS INITIAL.

Message 'Error' TYPE e. " Sunil replace this by your message class.

ENDIF.

ENDIF.