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

disabling parameters on selection screen

Former Member
0 Likes
3,662

Hi experts,

I am using At Selection Screen Output event to disable parameters based on a particular radio button.

the code is:

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS:s_pernr FOR pb0001-pernr MODIF ID M1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

SELECTION-SCREEN BEGIN OF LINE .

SELECTION-SCREEN COMMENT 5(5) text-003.

SELECTION-SCREEN POSITION 15.

PARAMETERS: p_begda LIKE pb0001-begda MODIF ID M2.

SELECTION-SCREEN COMMENT 38(8) text-004 .

PARAMETERS: p_endda LIKE pb0001-begda MODIF ID M2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-005.

SELECT-OPTIONS:s_offid FOR pb4001-offid MODIF ID M3.

SELECTION-SCREEN END OF BLOCK b3 .

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-006.

SELECT-OPTIONS:s_objid FOR pb4003-objid MODIF ID M4.

SELECTION-SCREEN END OF BLOCK b4.

SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-007.

PARAMETERS:p_optn1 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn2 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn3 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn4 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b5.

*AT SELECTION-SCREEN OUTPUT.

*IF P_OPTN3 = 'X'.

*LOOP AT SCREEN.

*IF SCREEN-GROUP1 = 'M1'

*OR SCREEN-GROUP1 = 'M2'

*OR SCREEN-GROUP1 = 'M4'.

*SCREEN-INPUT = '0'.

*MODIFY SCREEN.

*ENDIF.

*ENDLOOP.

*ENDIF.

&----


*& Start of Selection

&----


START-OF-SELECTION.

IF p_optn1 = 'X'.

PERFORM get_data_from_pb0001.

ELSEIF p_optn2 = 'X'.

PERFORM get_data_from_pb0002.

ELSEIF p_optn3 = 'X'.

PERFORM get_data_from_pb0022.

ELSEIF p_optn4 = 'X'.

PERFORM get_data_from_pb0023.

ENDIF.

PERFORM populate_data.

**********************************************

but when i am running the report the report is processed and the alv grid is displayed.And after that when i press the back button the parameters are disabled .

But this is not what i wanted.

I want that when i select a particular radio button the specified parameters are disabled before the actual grid display.

Where am i goin wrong.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,845

you have to do like this

data : flag.

SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-007.

PARAMETERS:p_optn1 RADIOBUTTON GROUP g1 user command ucom.

PARAMETERS:p_optn2 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn3 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn4 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b5.

AT SELECTION-SCREEN OUTPUT.

IF flag = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'M1'

OR SCREEN-GROUP1 = 'M2'

OR SCREEN-GROUP1 = 'M4'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

clear flag.

ENDIF.

at selection-screen.

if P_OPTN3 = 'X'.

flag = 'X'.

else.

clear flag.

endif.

regards

shiba dutta

9 REPLIES 9
Read only

Former Member
0 Likes
1,845

Hi

Do it in the AT selection-screen output event

see the sample

REPORT zrich_001.

PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'

user-command chk,

p_rad2 RADIOBUTTON GROUP grp1.

SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,

s_datum2 FOR sy-datum MODIF ID d2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_rad1 = 'X'

AND screen-group1 = 'D2'.

screen-active = '0'.

ENDIF.

IF p_rad2 = 'X'

AND screen-group1 = 'D1'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

or

IF pa_rep EQ gc_x.

LOOP AT SCREEN.

IF screen-group1 = gc_abc.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_def.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pa_upd EQ gc_x.

*For Reprocessing

LOOP AT SCREEN.

IF screen-group1 = gc_def.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_abc.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

CLEAR pa_upd.

ENDLOOP.

ENDIF.

Reward points for useful Answers

Regards

Anji

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,845

Hi,

The problem is you dont have the event

AT SELECTION-SCREEN.

You need to check the radio button here and set some flag.

Then in the event

AT SELECTION-SCREEN OUTPUT you need to put the code to disable fields.

<b>You are going Wrong coz</b>

The problem with the current report is you dont have the AT SELECTION-SCREEN so it going to START OF SELECTION.

When ever you have AT SELECTION-SCREEN after this event bloc AT SELECTION-SCREEN OUTPUT is called so the screen fields will get disabled.

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

Read only

Former Member
0 Likes
1,845

you will need to reset the radio button 3 to '' (blank) on coming back because the at selection screen output event is fired again when you come back. at this stage, the value of the radio button is still 'X'...and thats why the observed behaviour.

in the alv user command, write the code to reset the buttons to their initial values (selecting the one you want) and then see the result.

Message was edited by:

Priyank Jain

Read only

former_member491305
Active Contributor
0 Likes
1,845

Hi,

U just have to set the user-command for the radio button like this...

Then it will trigger both <b>at selection-screen</b> event and <b>at selection-screen output</b> event.

SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-007.

PARAMETERS:p_optn1 RADIOBUTTON GROUP g1 <b>USER-COMMAND RD1</b>.

PARAMETERS:p_optn2 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn3 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn4 RADIOBUTTON GROUP g1.

Read only

Former Member
0 Likes
1,845

See the Anji program and when you select radio button ,selection-screen will not disable,you need to press enter button.

Read only

Former Member
0 Likes
1,846

you have to do like this

data : flag.

SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-007.

PARAMETERS:p_optn1 RADIOBUTTON GROUP g1 user command ucom.

PARAMETERS:p_optn2 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn3 RADIOBUTTON GROUP g1.

PARAMETERS:p_optn4 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b5.

AT SELECTION-SCREEN OUTPUT.

IF flag = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'M1'

OR SCREEN-GROUP1 = 'M2'

OR SCREEN-GROUP1 = 'M4'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

clear flag.

ENDIF.

at selection-screen.

if P_OPTN3 = 'X'.

flag = 'X'.

else.

clear flag.

endif.

regards

shiba dutta

Read only

Former Member
0 Likes
1,845

Thanks to all for ur help.

I have awarded points for all ur help.

Read only

Former Member
0 Likes
1,845

I need some more help on this.

its working fine now but when the selction screen is displayed its having p_optn1 selected as default but the parameters of modif id M2 M3 and M4 are still enabled.

How to cater for this.

Read only

Former Member
0 Likes
1,845

hEY SORRY ALL.

i got the answer myself.

This could be done in the initialisation event.