‎2008 Jun 29 12:27 PM
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
‎2008 Jun 29 12:39 PM
Hi Shanthi,
You can write your checks at "at selection-screen" event.
Regards
Yossi.R.
‎2008 Jun 29 5:01 PM
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
‎2008 Jun 29 7:01 PM
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.
‎2008 Jun 30 4:53 AM
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.