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: 

Selection-screen

Former Member
0 Kudos

Hi All,

I have three fields in selection screen and 4 radio buttons

if user selected first radio button first field needs to be disabled and

if user selected second radio button all three fields needs to be disabled.

how i need to do this.

Thanks,

Sarala

1 ACCEPTED SOLUTION

former_member208856
Active Contributor
0 Kudos

Hi,

Take help from this code :

tables : spfli, sflight.

selection-screen begin of block b1 with frame.

PARAMETERS: rad1 RADIOBUTTON GROUP rad USER-COMMAND radio.

SELECT-OPTIONS: s_carrid FOR spfli-carrid MODIF ID sl1,

s_connid FOR spfli-connid MODIF ID sl1.

PARAMETERS: rad2 RADIOBUTTON GROUP rad.

SELECT-OPTIONS: s_fldate FOR sflight-fldate MODIF ID sl2.

selection-screen end of block b1.

at selection-screen output.

loop at screen.

IF rad1 = 'X'.

IF screen-group1 = 'SL2'.

screen-input = 0.

ENDIF.

ELSEIF rad2 = 'X'.

IF screen-group1 = 'SL1'.

screen-input = 0.

ENDIF.

ENDIF.

Modify screen.

endloop.

I hope, it can help you,

<b>Reward points, if helpful,</b>Sandeep Kaushik

11 REPLIES 11

former_member197281
Active Participant
0 Kudos

Hi sarala,

You can use the AT Selection-screen output event for this.You can loop the screen and make the element disabled or enabled...as you like....

loop at screen.

endloop.

<b>Reward points if helpful,</b>

Regards,

jinesh

Former Member
0 Kudos

Hi,

At selection screen

use loop at screen and modify

regards

Shiva

former_member208856
Active Contributor
0 Kudos

Hi,

Take help from this code :

tables : spfli, sflight.

selection-screen begin of block b1 with frame.

PARAMETERS: rad1 RADIOBUTTON GROUP rad USER-COMMAND radio.

SELECT-OPTIONS: s_carrid FOR spfli-carrid MODIF ID sl1,

s_connid FOR spfli-connid MODIF ID sl1.

PARAMETERS: rad2 RADIOBUTTON GROUP rad.

SELECT-OPTIONS: s_fldate FOR sflight-fldate MODIF ID sl2.

selection-screen end of block b1.

at selection-screen output.

loop at screen.

IF rad1 = 'X'.

IF screen-group1 = 'SL2'.

screen-input = 0.

ENDIF.

ELSEIF rad2 = 'X'.

IF screen-group1 = 'SL1'.

screen-input = 0.

ENDIF.

ENDIF.

Modify screen.

endloop.

I hope, it can help you,

<b>Reward points, if helpful,</b>Sandeep Kaushik

Former Member
0 Kudos

check theck 'modif-id' example in the standard ABAP help.

Sameer

Former Member
0 Kudos

HI,

see this example.

PARAMETERS:check RADIOBUTTON GROUP rad1 USER-COMMAND RAD DEFAULT 'X',

field RADIOBUTTON GROUP rad1.

PARAMETERS:field1(10),field2(10).

PARAMETERS:check1 as CHECKBOX,

check2 AS CHECKBOX.

AT SELECTION-SCREEN OUTPUT.

if check = 'X'.

LOOP AT SCREEN.

if screen-name = 'CHECK1' OR SCREEN-NAME = 'CHECK2'.

screen-ACTIVE = 1.

MODIFY SCREEN.

ELSEIF screen-name = 'FIELD1' OR SCREEN-NAME = 'FIELD2' OR

SCREEN-NAME = '%_FIELD1_%_APP_%-TEXT'OR SCREEN-NAME = '%_FIELD2_%_APP_%-TEXT'.

screen-ACTIVE = 0.

MODIFY SCREEN.

endif.

ENDLOOP.

elseif FIELD = 'X'.

LOOP AT SCREEN.

if screen-name = 'FIELD1' OR SCREEN-NAME = 'FIELD2' OR

SCREEN-NAME = '%_FIELD1_%_APP_%-TEXT'OR SCREEN-NAME = '%_FIELD2_%_APP_%-TEXT'.

screen-ACTIVE = 1.

MODIFY SCREEN.

ELSEIF screen-name = 'CHECK1' OR SCREEN-NAME = 'CHECK2'.

screen-ACTIVE = 0.

MODIFY SCREEN.

endif.

ENDLOOP.

endif.

at SELECTION-SCREEN.

case sscrfields-ucomm.

when 'RAD'.

if check = 'X'.

LOOP AT SCREEN.

if screen-name = 'CHECK1' OR SCREEN-NAME = 'CHECK2'.

screen-ACTIVE = 1.

MODIFY SCREEN.

ELSEIF screen-name = 'FIELD1' OR SCREEN-NAME = 'FIELD2' OR

SCREEN-NAME = '%_FIELD1_%_APP_%-TEXT'OR SCREEN-NAME = '%_FIELD2_%_APP_%-TEXT'.

screen-ACTIVE = 0.

MODIFY SCREEN.

endif.

ENDLOOP.

elseif FIELD = 'X'.

LOOP AT SCREEN.

if screen-name = 'FIELD1' OR SCREEN-NAME = 'FIELD2' OR

SCREEN-NAME = '%_FIELD1_%_APP_%-TEXT'OR SCREEN-NAME = '%_FIELD2_%_APP_%-TEXT'.

screen-ACTIVE = 1.

MODIFY SCREEN.

ELSEIF screen-name = 'CHECK1' OR SCREEN-NAME = 'CHECK2'.

screen-ACTIVE = 0.

MODIFY SCREEN.

endif.

ENDLOOP.

endif.

ENDCASE.

<b>reward if helpful</b>

rgds,

bharat.

Former Member
0 Kudos

Hi Sarala,

Check with the below code.It will solve your problem.

tables: mara,

MKPF.

selection-screen begin of block b1 with frame TITLE text-001.

parameters: rb_matnr radiobutton group grp1 DEFAULT 'X' user-command rusr.

select-options: s_matnr for mara-matnr.

parameters: rb_mtart radiobutton group grp1.

select-options: s_mtart for mara-mtart,

s_mblnr for MKPF-mblnr,

s_BLART FOR MKPF-BLART.

selection-SCREEN end of block b1.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF rb_matnr = 'X'.

IF SCREEN-NAME = 'S_MATNR-LOW' or SCREEN-NAME ='S_MATNR-HIGH'.

SCREEN-INPUT = 0.

ELSE.

SCREEN-INPUT = 1.

ENDIF.

MODIFY SCREEN.

elseif rb_MTART = 'X'.

if screen-name = 'S_MTART-LOW' or screen-name = 'S_MTART-HIGH' or screen-name = 'S_MBLNR-LOW' or

screen-name = 'S_MBLNR-HIGH' or screen-name = 'S_BLART-LOW' or screen-name = 'S_BLART-HIGH'.

SCREEN-INPUT = 0.

ELSE.

SCREEN-INPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Reward if useful.

Regards

Sayee

Former Member
0 Kudos

Hi,

I hope following code will solve your problem.


AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

  IF rb_1 = 'X' AND screen-name = first_field_name.
    screen-input = 0.
  ENDIF.

  IF rb_2 = 'X'.
    IF screen-name = first_field_name OR screen-name = second_field_name  OR   
        screen-name = third_field_name .
          screen-input = 0.
    ENDIF.
  ENDIF.

  MODIFY screen.

ENDLOOP.

Here, rb_1 & rb_2 are radio buttons.

Reward points if the answer is helpful.

Regards,

Mukul

Former Member
0 Kudos

Hi

parameters : p_f1 type i modif id g1,

p_f2 type i modif id g3,

p_f3 type i modif id g3.

parameters : p_r1 radiobutton group g2,

p_r2 radiobutton group g2,

p_r3 radiobutton group g2,

p_r4 radiobutton group g2..

at selection-screen output.

loop at screen.

if p_r1 = 'X'.

if screen-group1 = 'G1'.

screen-input = '0'.

screen-invisible = '1'.

modify screen.

endif.

elseif p_r2 = 'X'.

if screen-group1 = 'G3'.

screen-input = '0'.

screen-invisible = '1'.

modify screen.

endif.

endif.

endloop.

Regards

vasu

varma_narayana
Active Contributor
0 Kudos

Hi Sarala..

This is the code..

selection-screen begin of block b1 with frame.

PARAMETERS: RB1 RADIOBUTTON GROUP RG USER-COMMAND RAD.

SELECT-OPTIONS: s_carrid FOR spfli-carrid MODIF ID MG1,

s_connid FOR spfli-connid MODIF ID MG1.

PARAMETERS: RB2 RADIOBUTTON GROUP RG.

SELECT-OPTIONS: s_fldate FOR sflight-fldate MODIF ID MG2.

selection-screen end of block b1.

AT SELECTION-SCREEN OUTPUT.

CASE 'X'.

WHEN RB1.

loop at screen.

IF screen-group1 = 'MG2'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

WHEN RB2.

LOOP AT SCREEN.

IF screen-group1 = 'MG1'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

.

ENDLOOP.

ENDCASE.

REWARD IF HELPFUL.

Former Member
0 Kudos

Hi,

Just paste the code and run..

REPORT ychatest2.

parameters:

P_r1 radiobutton group GR1 <b>USER-COMMAND CLK</b>,

P_r2 radiobutton group GR1,

P_r3 radiobutton group GR1,

P_r4 radiobutton group GR1.

parameters:

p_f1(10) type c,

p_f2(10) type c,

p_f3(10) type c,

p_f4(10) type c.

<b>at selection-screen output.</b>

loop at screen.

if p_r1 = 'X' and screen-name = 'P_F1'.

screen-input = 0.

modify screen.

exit.

endif.

if p_r2 = 'X' and screen-name = 'P_F2'.

screen-input = 0.

modify screen.

exit.

endif.

if p_r3 = 'X' and screen-name = 'P_F3'.

screen-input = 0.

modify screen.

exit.

endif.

if p_r4 = 'X' and screen-name = 'P_F4'.

screen-input = 0.

modify screen.

exit.

endif.

endloop.

Former Member
0 Kudos

Thanks you all for your replys