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

selection screen validation - one field based on another field

Former Member
0 Likes
923

Hi all,

i'm getting Month in Select option and Year in Parameter.

When i execute the report, it should check whether one is entered without the other one. If so, it should throw error message.

How to do this in selection screen ?

this is what the coding should be...

if s_month[] is not initial and p_year is initial.

Message 'Enter Payroll Year' type 'E'.

endif.

if s_month[] is initial and p_year is not initial.

Message 'Enter Payroll month' type 'E'.

endif.

But under which event i should write this..

can anyone pls help me..

Regards,

Shanthi

4 REPLIES 4
Read only

Former Member
0 Likes
572

Hi Shanthi,

You can write your checks at "at selection-screen" event.

Regards

Yossi.R.

Read only

Former Member
0 Likes
572

Hi Shanti,

Try the following in AT Selection-Screen event.

if s_month[] is initial.

if p_year is initial.

message 'Enter month and year' type E.

else.

message 'Enter month also' type 'E'.

endif.

else.

if p_year is initial.

message 'Enter year also' type 'E'.

endif.

endif.

Hope this helps you.

Any queries, get back to me.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
572

Hi Shanti,

Define your selection-screen elements between

SELECTION-SCREEN BEGIN OF BLOCK <block name>

Select-options....

Parameters:

SELECTION-SCREEN END OF BLOCK <block name>

You specify ur code in AT SELECTION-SCREEN ON BLOCK <b1>.

This would help you if either one of the entry is missing...

And even you can mention in AT SELECTION-SCREEN event...

But if you have any other parameters there its not necessary for the user to specify if he had entered...

As month and year are interrelated for your program its better you go for the first procedure ie in BLOCK event.

Hope this would help you,

Regards

Narin Nandivada.

Read only

Former Member
0 Likes
572

Hi,

Just declare those variables as mandatory variables,

so that system will through an error if user won't enter values in month or year.

Otherwise just write ur if conditional statements with in AT SELECTION screen.

Regards,

Kusuma.