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

Selection Screen Problem(Urgent)

I have a problem with the selection screen.

I have to define a selection screen.The selection screen details are as under :

parameter1

radiobutton1

radiobutton2

parameter2(a)

when radiobutton 1 is selected the screen should look as above and when radiobutton 2 is selected the screen should look as under ;

parameter1

radiobutton1

radiobutton2

parameter2(b)

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 06:12 AM

    PARAMETERS:

    P_VAR1 TYPE C,

    R1 RADIOBUTTON GROUP G1 USER_COMMAND U1,

    R2 RADIOBUTTON GROUP G1 DEFAULT 'X',

    P_VAR2 TYPE I MODIFID SC1,

    P_VAR3 TYPE I MODIFID SC2.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    IF R1 ='X'.

    IF SCREEN-GROUP = 'SC1'.

    SCREEN-ACTIVE = 1.

    MODIFY SCREEN.

    ELSEIF SCREEN-GROUP = 'SC2'.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    ELSEIF R2 ='X'.

    IF SCREEN-GROUP = 'SC1'.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ELSEIF SCREEN-GROUP = 'SC2'.

    SCREEN-ACTIVE = 1.

    MODIFY SCREEN.

    ENDIF.

    ENDIF.

    ENDLOOP.

    Rewards if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 06:08 AM

    Hi Ankit,

    U can use like when rb1 = 'x' .

    LOOP AT SCREEN.

    IF screen-group1 = 'GR1'.

    screen-invisible = 1.

    screen-input = 0.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    regards,

    kavitha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 06:09 AM

    Check this code.

    PROGRAM demo_dynpro_check_radio .

    DATA: radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,

    field1(10) TYPE c, field2(10) TYPE c, field3(10) TYPE c,

    box TYPE c.

    DATA: ok_code TYPE sy-ucomm,

    save_ok TYPE sy-ucomm.

    CALL SCREEN 100.

    MODULE user_command_0100 INPUT.

    save_ok = ok_code.

    CLEAR ok_code.

    CASE save_ok.

    WHEN 'RADIO'.

    IF radio1 = 'X'.

    field1 = 'Selected!'.

    CLEAR: field2, field3.

    ELSEIF radio2 = 'X'.

    field2 = 'Selected!'.

    CLEAR: field1, field3.

    ELSEIF radio3 = 'X'.

    field3 = 'Selected!'.

    CLEAR: field1, field2.

    ENDIF.

    WHEN 'CANCEL'.

    LEAVE PROGRAM.

    ENDCASE.

    ENDMODULE.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 26, 2007 at 06:15 AM

    Hi,

    go through this code,

    &----


    *& Report ZKHAN_ASG3 *

    *& *

    &----


    REPORT ZKHAN_ASG3 NO STANDARD PAGE HEADING.

    TABLES: EKKO,MARA,MARC,MARD.

    DATA: BEGIN OF IT_MARA OCCURS 0,

    MATNR LIKE MARA-MATNR,

    MAKTX LIKE MAKT-MAKTX,

    ERSDA LIKE MARA-ERSDA,

    WERKS LIKE MARC-WERKS,

    LGORT LIKE MARD-LGORT,

    END OF IT_MARA.

    DATA: BEGIN OF IT_EKKO OCCURS 0,

    EBELN LIKE EKKO-EBELN,

    LIFNR LIKE EKKO-LIFNR,

    MATNR LIKE EKPO-MATNR,

    MENGE LIKE EKPO-MENGE,

    NETWR LIKE EKPO-NETWR,

    END OF IT_EKKO.

    DATA: BEGIN OF IT_MAK OCCURS 0,

    MATNR LIKE MAKT-MATNR,

    MAKTX LIKE MAKT-MAKTX,

    SPRAS LIKE MAKT-SPRAS,

    END OF IT_MAK.

    PARAMETERS: P_RB1 RADIOBUTTON GROUP RAD1 USER-COMMAND KHAN,

    P_RB2 RADIOBUTTON GROUP RAD1.

    SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN,

    S_BUKRS FOR EKKO-BUKRS,

    S_AEDAT FOR EKKO-AEDAT.

    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,

    S_ERSDA FOR MARA-ERSDA,

    S_WERKS FOR MARC-WERKS.

    INITIALIZATION.

    P_RB1 = 'X'.

    AT SELECTION-SCREEN OUTPUT.

    IF P_RB1 EQ 'X'.

    LOOP AT SCREEN.

    IF SCREEN-GROUP4 = '005'.

    SCREEN-INPUT = '0'.

    SCREEN-INVISIBLE = '1'.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP4 = '006'.

    SCREEN-INPUT = '0'.

    SCREEN-INVISIBLE = '1'.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP4 = '007'.

    SCREEN-INPUT = '0'.

    SCREEN-INVISIBLE = '1'.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    IF P_RB2 EQ 'X'.

    LOOP AT SCREEN.

    IF SCREEN-GROUP4 = '002'.

    SCREEN-INPUT = '0'.

    SCREEN-INVISIBLE = '1'.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP4 = '003'.

    SCREEN-INPUT = '0'.

    SCREEN-INVISIBLE = '1'.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP4 = '004'.

    SCREEN-INPUT = '0'.

    SCREEN-INVISIBLE = '1'.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    START-OF-SELECTION.

    IF P_RB1 = 'X'.

    PERFORM EKKORB1.

    ENDIF.

    IF P_RB2 = 'X'.

    PERFORM MARARB2.

    ENDIF.

    END-OF-SELECTION.

    IF P_RB1 = 'X'.

    PERFORM ESRB1.

    ENDIF.

    IF P_RB2 = 'X'.

    PERFORM ESRB2.

    ENDIF.

    TOP-OF-PAGE.

    IF P_RB1 = 'X'.

    PERFORM TPRB1.

    ENDIF.

    IF P_RB2 = 'X'.

    PERFORM TPRB2.

    ENDIF.

    END-OF-PAGE.

    IF P_RB1 = 'X'.

    ULINE AT 0(90).

    WRITE:/ 'END OF PAGE....',SY-PAGNO.

    ENDIF.

    IF P_RB2 = 'X'.

    ULINE AT 0(100).

    WRITE:/ 'END OF PAGE....',SY-PAGNO.

    ENDIF.

    &----


    *& Form EKKORB1(PURCHASE DOCUMENT DATA RETRIVING)

    &----


    FORM EKKORB1 .

    SELECT EKKO~EBELN

    EKKO~LIFNR

    EKKO~BUKRS

    EKKO~AEDAT

    EKPO~MATNR

    EKPO~MENGE

    EKPO~NETWR

    INTO CORRESPONDING FIELDS OF TABLE IT_EKKO FROM

    EKKO INNER JOIN EKPO

    ON EKKOEBELN = EKPOEBELN

    WHERE EKKO~EBELN IN S_EBELN AND

    EKKO~BUKRS IN S_BUKRS AND

    EKKO~AEDAT IN S_AEDAT.

    *IF NOT IT_EKKO[] IS INITIAL.

    • SORT BY IT_EKKO-EBELN.

    • DELETE ADJACENT DUPLICATES FROM IT_EKKO[].

    *ENDIF.

    ENDFORM. "EKKORB1

    &----


    *& Form MARARB2 (MATERIAL DOCUMENT DATA RETRIVING)

    &----


    FORM MARARB2 .

    SELECT MARA~MATNR

    MARA~ERSDA

    MARC~WERKS

    MARD~LGORT

    INTO CORRESPONDING FIELDS OF TABLE IT_MARA

    FROM ( ( MARA INNER JOIN MARC ON MARAMATNR = MARCMATNR )

    INNER JOIN MARD ON MARAMATNR = MARDMATNR )

    WHERE MARA~MATNR IN S_MATNR AND

    MARA~ERSDA IN S_ERSDA AND

    MARC~WERKS IN S_WERKS.

    IF NOT IT_MARA[] IS INITIAL.

    SORT IT_MARA.

    SELECT MATNR

    MAKTX

    INTO CORRESPONDING FIELDS OF TABLE IT_MAK

    FROM MAKT

    FOR ALL ENTRIES IN IT_MARA

    WHERE MATNR = IT_MARA-MATNR AND

    SPRAS = SY-LANGU.

    ENDIF.

    DELETE ADJACENT DUPLICATES FROM IT_MARA[].

    SORT IT_MAK.

    ENDFORM. " MARARB2

    &----


    *& Form ESRB1 (PURCHASE HEADER DETAILS)

    &----


    FORM ESRB1 .

    LOOP AT IT_EKKO.

    FORMAT COLOR 4.

    WRITE:/ SY-VLINE,

    IT_EKKO-EBELN, 19 SY-VLINE,

    IT_EKKO-LIFNR, 33 SY-VLINE,

    IT_EKKO-MATNR, 52 SY-VLINE,

    IT_EKKO-MENGE, 69 SY-VLINE,

    IT_EKKO-NETWR, 90 SY-VLINE.

    ULINE AT 0(90).

    ENDLOOP.

    ENDFORM. " ESRB1

    &----


    *& Form ESRB2

    &----


    FORM ESRB2 .

    LOOP AT IT_MARA.

    READ TABLE IT_MAK WITH KEY MATNR = IT_MARA-MATNR BINARY SEARCH.

    FORMAT COLOR 6 INTENSIFIED ON INVERSE ON.

    IF SY-SUBRC = 0.

    WRITE:/ SY-VLINE,

    IT_MARA-MATNR, 20 SY-VLINE,

    IT_MAK-MAKTX, 64 SY-VLINE,

    IT_MARA-ERSDA, 76 SY-VLINE,

    IT_MARA-WERKS, 84 SY-VLINE,

    IT_MARA-LGORT, 100 SY-VLINE.

    ULINE AT 0(100).

    ENDIF.

    ENDLOOP.

    ENDFORM. " ESRB2

    &----


    *& Form TPRB1

    &----


    FORM TPRB1 .

    LOOP AT IT_EKKO.

    AT FIRST.

    FORMAT COLOR 7.

    ULINE AT 0(90).

    WRITE:/ SY-VLINE,

    'PURCHASE-DOC-NO',19 SY-VLINE,

    'VENDOR-NO', 33 SY-VLINE,

    'MATERIAL-NO', 52 SY-VLINE,

    'QUANTITY', 69 SY-VLINE,

    'AMOUNT', 90 SY-VLINE.

    ULINE AT 0(90).

    ENDAT.

    ENDLOOP.

    ENDFORM. " TPRB1

    &----


    *& Form TPRB2

    &----


    FORM TPRB2 .

    LOOP AT IT_MARA.

    AT FIRST.

    FORMAT COLOR 2.

    ULINE AT 0(100).

    WRITE:/ SY-VLINE,

    'MATERIAL-NO', 20 SY-VLINE,

    'MATERIAL-DESC', 64 SY-VLINE,

    'D-O-C', 76 SY-VLINE,

    'PLANT', 84 SY-VLINE,

    'STORAGE-LOC', 100 SY-VLINE.

    ULINE AT 0(100).

    ENDAT.

    ENDLOOP.

    ENDFORM. " TPRB2

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 06:17 AM

    HI

    execute this code and see the result after changing the radiobutton press enter button to apply changes

    REPORT ZNNR_EDIT .
    
    *******DATA DECLARATIONS***********
    DATA : BEGIN OF IT_PLANT OCCURS 0,
            MATNR LIKE MARA-MATNR,
            WERKS LIKE MARC-WERKS,
            PSTAT LIKE MARC-PSTAT,
            EKGRP LIKE MARC-EKGRP,
           END OF IT_PLANT.
    
    DATA : BEGIN OF IT_PONO OCCURS 0,
            EBELN LIKE EKKO-EBELN,
            EBELP LIKE EKPO-EBELP,
            MATNR LIKE EKPO-MATNR,
            WERKS LIKE EKPO-WERKS,
            LGORT LIKE EKPO-LGORT,
           END OF IT_PONO.
    
    TABLES EKKO.
    *********END OF DATA DECLARATIONS**********
    
    ********SELECTION SCREEN DESIGN ***********
    
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    
    PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.
    
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
    SELECTION-SCREEN END OF LINE.
    
    
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R2 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
    SELECTION-SCREEN END OF LINE.
    
    PARAMETER : P_WERKS1 LIKE MARC-WERKS MODIF ID S2.
    PARAMETER : P_WERKS2 LIKE MARC-WERKS MODIF ID S3.
    
    
    
    SELECTION-SCREEN END OF BLOCK B1.
    
    
    *******END OF SELECTION SCREEN DESIGN*****************
    
    
    ************SCREEN MODIFICATIONS********************
    
    AT SELECTION-SCREEN OUTPUT.
    
      LOOP AT SCREEN.
    
        IF R1 EQ 'X' AND SCREEN-GROUP1 EQ 'S3'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
        ENDIF.
    
        IF R2 EQ 'X' AND SCREEN-GROUP1 EQ 'S2'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
        ENDIF.
    
      ENDLOOP.
    
    
    
    *********END OF SCREEN MODIFICATIONS******************

    <b>Reward if usefull</b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 06:21 AM

    Hi Ankit,

    Try the below code.

    TABLES: mara.

    selection-screen begin of block b3 with frame TITLE text-003.

    parameters: rb1 radiobutton group grp1 DEFAULT 'X' user-command

    rusr.

    parameters: rb2 radiobutton group grp1.

    select-options: s_matnr for mara-matnr,

    s_matkl for mara-matkl.

    selection-SCREEN end of block b3.

    AT SELECTION-SCREEN output.

    LOOP AT SCREEN.

    IF rb1 = 'X'.

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

    SCREEN-INPUT = 0.

    ELSE.

    SCREEN-INPUT = 1.

    ENDIF.

    MODIFY SCREEN.

    elseif rb2 = 'X'.

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

    SCREEN-INPUT = 0.

    ELSE.

    SCREEN-INPUT = 1.

    ENDIF.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    Hope it helps.

    Reward if useful.

    Regards

    Sayee

    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.