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

At selection screen output problem

Former Member
0 Likes
461

Hi all,

I am trying to make a few fields disabled based on the selection of a radio button. I have done it in dialog programming, but in report its not working. Please tell me where i have gone wrong. My code:

*----------------------------------------------------------------------*
* Selection Screen
*----------------------------------------------------------------------*

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
PARAMETER : rb_dwld RADIOBUTTON GROUP radi DEFAULT 'X',
            rb_upld RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
SELECT-OPTIONS : so_cctrl FOR /dceur/z_crconar-crdt_ctrldsa MODIF ID
                                         sc1 NO INTERVALS OBLIGATORY,
                 so_cusno FOR /dceur/z_crdtlmt-dealer MODIF ID sc1.
SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
SELECT-OPTIONS : so_ctrl1 FOR /dceur/z_crconar-crdt_ctrldsa MODIF ID
                                         sc2 NO INTERVALS OBLIGATORY.
PARAMETER pa_fname TYPE rlgrap-filename MODIF ID sc2.
SELECTION-SCREEN END OF BLOCK b3.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
431

Hi,

Please check the below code.

This is one of my requirement.

* Creation of two blocks with parameter fields for create and update
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
PARAMETER p_create LIKE rlgrap-filename MODIF ID crt.
SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME.
PARAMETER p_update LIKE rlgrap-filename MODIF ID upt.
SELECTION-SCREEN: END OF BLOCK b2.

* Making one parameter field active at a time
AT SELECTION-SCREEN OUTPUT.
  IF rb_crt = 'X'.                              "CREATE BUTTON IS SELECTED
    PERFORM hide_rb_options.
    CLEAR p_create.
  ELSE.                                         "UPDATE BUTTON IS SELECTED
    PERFORM hide_rb_options.
    CLEAR p_update.
  ENDIF.

*&---------------------------------------------------------------------*
*&      Form  hide_rb_options
*&---------------------------------------------------------------------*

FORM hide_rb_options .
  IF rb_crt = 'X'    .
    LOOP AT SCREEN.
      CASE screen-group1.
        WHEN 'CRT'.
          screen-active = 1.
          MODIFY SCREEN.
        WHEN 'UPT'.
          screen-active = 0.
          MODIFY SCREEN.
      ENDCASE.
    ENDLOOP.
  ELSE.

    LOOP AT SCREEN.
      CASE screen-group1.
        WHEN 'UPT'.
          screen-active = 1.
          MODIFY SCREEN.
        WHEN 'CRT'.
          screen-active = 0.
          MODIFY SCREEN.
      ENDCASE.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " hide_rb_options

May it helps you.

Regards.

DS.

3 REPLIES 3
Read only

Former Member
0 Likes
431
*----------------------------------------------------------------------*
* At selection screen
*----------------------------------------------------------------------*

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    CASE co_x.
      WHEN rb_dwld.
        IF screen-group1 = co_sc2.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      WHEN rb_upld.
        IF screen-group1 = co_sc1.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
    ENDCASE.
  ENDLOOP.
Read only

Former Member
0 Likes
432

Hi,

Please check the below code.

This is one of my requirement.

* Creation of two blocks with parameter fields for create and update
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
PARAMETER p_create LIKE rlgrap-filename MODIF ID crt.
SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME.
PARAMETER p_update LIKE rlgrap-filename MODIF ID upt.
SELECTION-SCREEN: END OF BLOCK b2.

* Making one parameter field active at a time
AT SELECTION-SCREEN OUTPUT.
  IF rb_crt = 'X'.                              "CREATE BUTTON IS SELECTED
    PERFORM hide_rb_options.
    CLEAR p_create.
  ELSE.                                         "UPDATE BUTTON IS SELECTED
    PERFORM hide_rb_options.
    CLEAR p_update.
  ENDIF.

*&---------------------------------------------------------------------*
*&      Form  hide_rb_options
*&---------------------------------------------------------------------*

FORM hide_rb_options .
  IF rb_crt = 'X'    .
    LOOP AT SCREEN.
      CASE screen-group1.
        WHEN 'CRT'.
          screen-active = 1.
          MODIFY SCREEN.
        WHEN 'UPT'.
          screen-active = 0.
          MODIFY SCREEN.
      ENDCASE.
    ENDLOOP.
  ELSE.

    LOOP AT SCREEN.
      CASE screen-group1.
        WHEN 'UPT'.
          screen-active = 1.
          MODIFY SCREEN.
        WHEN 'CRT'.
          screen-active = 0.
          MODIFY SCREEN.
      ENDCASE.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " hide_rb_options

May it helps you.

Regards.

DS.

Read only

0 Likes
431

TO TRIGGER an output event you need to give user-command to the radiobuttions:

PARAMETER : rb_dwld RADIOBUTTON GROUP radi USER-COMMAND flag DEFAULT 'X',