Skip to Content
author's profile photo Former Member
Former Member

Selection-screen

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

11 Answers

  • Best Answer
    Posted on Sep 11, 2007 at 10:35 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:41 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:41 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:52 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:33 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:34 AM

    Hi,

    At selection screen

    use loop at screen and modify

    regards

    Shiva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:36 AM

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

    Sameer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:38 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 11, 2007 at 10:48 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.