Application Development 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: 

How to make the obligate field in selection screen

Former Member
0 Kudos

Hi ,

In my report two radio buttons and two bloc selection screens are there.When we select the first radio button first screen will be editable second screen will be non-editable vice-versa.

but the problem is in each selection screen one mandatory field is required suppose if i give the one field obligatory in first block screen it is not allowing the second readout please help me regarding this how i will make the mandatory field in both screens.

Thanks,

Harinath

10 REPLIES 10

Former Member
0 Kudos

hi

could u please send the code written in

at selection-screen output.

0 Kudos

AT SELECTION-SCREEN OUTPUT.

IF pa_udp = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ABC'. "#CCE

screen-active = 1.

ELSEIF screen-group1 = 'DEF'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pa_rep = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ABC'. "#CCE

screen-input = 0.

ELSEIF screen-group1 = 'DEF'.

screen-active = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

This is my Code on At Selection screen event

0 Kudos

Hi...

Dont Declare your field as OBLIGATORY.

Instead perform the validation in AT SELECTION-SCREEN event. But validation should be only when Particular Radiobutton is selected.

And Generate only Error Message (Type E).

Try this code:

AT SELECTION-SCREEN on <yOUR mandatory field>.

IF PA_UPD = 'X'.

IF <YOUR MANDATORY FIELD> IS INITIAL.

Message 'Entry is must in this field' type 'E'.

ENDIF.

ENDIF.

AT SELECTION-SCREEN OUTPUT.

IF pa_udp = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ABC'. "#CCE

screen-active = 1.

ELSEIF screen-group1 = 'DEF'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pa_rep = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ABC'. "#CCE

screen-input = 0.

ELSEIF screen-group1 = 'DEF'.

screen-active = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

<b>Reward if Helpful</b>

0 Kudos

Hi,

i have tried like that also but that time it is not selected the second screen

Thanks,

Hari.

0 Kudos

Hi

Have u given modif id to selection screen fields .......

can u post u r code

reward points to all helpful answers

kiran.M

0 Kudos

HI

u can do like this..

give default values to those fields which are obligatory....

then it will work fine.

if u want to change the value on selection screen u can change .....

u can chk this...

parameters : rb1 radiobutton group grp1 user-command RB1 default 'X',

rb2 radiobutton group grp1.

selection-screen begin of block b1 WITH FRAME.

parameters : p_name(20) obligatory DEFAULT 'ABC' MODIF ID ID1.

selection-screen end of block b1.

selection-screen begin of block b2 WITH FRAME.

parameters : p_name1(20) obligatory DEFAULT 'XYZ' MODIF ID ID2.

selection-screen end of block b2.

AT SELECTION-SCREEN OUTPUT.

IF RB1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ID1'.

SCREEN-INPUT = ' '.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ID2'.

SCREEN-INPUT = ' '.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Message was edited by:

Premalatha G

Former Member
0 Kudos

Do not make any fields obligatory - instead code a check in the "AT SELECTION-SCREEN" event using IF tests to validate that right fields have been completed, and issue error message if not.

Andrew

0 Kudos

Hi Andrew,

i have done like that only,but when ever that error message will come that time only blank screen is comming but i want error message in selection screen.

Thanks,

Hari

0 Kudos

Hi Hari,

Here IF u give the defauale values for the obligatory fields then u will get the error message in the same screen.If u are validating the selection screen inputs in the 'At Selection Screen event' this will display erros in the next screen.

So give the defaulat values for obligatory fields if u wanna display the error messge in the same screen.

Thanks,CSR.

****Please Reward if helpful.

Former Member
0 Kudos

Hi,

Please give default values for mandatory fields.

Then u will not face any problem.

Thanks,CSR.