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

Enable/Disable radiobutton with condition

Former Member
0 Likes
4,743


Hi all,

I have to set two radiobuttons (session and ctu) that are disabled/enabled by other two radiobutton (p_rad1 --> session and ctu are disable; p_rad2 --> session and ctu are enable).

In the window where I've to set these parameters if I change from radiobutton p_rad1 to p_rad2 and then i change from p_rad2 to p_rad1 my program dump.

This is my code:

   SELECTION-SCREEN BEGIN OF BLOCK one WITH FRAME TITLE text-000.
PARAMETERS: pa_file TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK one.

   SELECTION-SCREEN BEGIN OF BLOCK two WITH FRAME TITLE text-001.
PARAMETERS: p_rad1 RADIOBUTTON GROUP g DEFAULT 'X' USER-COMMAND BUT,
            p_rad2 RADIOBUTTON GROUP g.
SELECTION-SCREEN END OF BLOCK two.

   SELECTION-SCREEN BEGIN OF BLOCK three WITH FRAME TITLE text-004.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS session RADIOBUTTON GROUP ctu MODIF ID b1"create session
SELECTION-SCREEN COMMENT 3(20) text-s07 FOR FIELD session.
SELECTION-SCREEN POSITION 45.
PARAMETERS ctu RADIOBUTTON GROUP  ctu MODIF ID b2.     "call transaction
SELECTION-SCREEN COMMENT 48(20) text-s08 FOR FIELD ctu.
SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN.

    IF pa_file IS INITIAL.
    MESSAGE e000(su) WITH text-001.
  ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_file.

  CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
      def_filename     = '*'
      mode             = 'O'
      title            = text-002
    IMPORTING
      filename         = pa_file
    EXCEPTIONS
      inv_winsys       = 1
      no_batch         = 2
      selection_cancel = 3
      selection_error  = 4
      OTHERS           = 5.

AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.         "PROVA 1
    IF p_rad1 = 'X'.
      IF screen-name = 'SESSION'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
      IF screen-name = 'CTU'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ELSEIF p_rad2 = 'X'.
      IF screen-name = 'SESSION'.
        screen-input = '1'.
        MODIFY SCREEN.
      ENDIF.
      IF screen-name = 'CTU'.
        screen-input = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.

And another problem of my program is that before I can select the radiobutton I've to upload a file, I can't do it at last.

Thank you all.

Regards,

Andrea

1 ACCEPTED SOLUTION
Read only

Kiran_Valluru
Active Contributor
0 Likes
1,326

Hi,

There is no dump occurring as you mentioned and its working fine. Except , you missed to close the selection screen block three.

  SELECTION-SCREEN BEGIN OF BLOCK three WITH FRAME TITLE text-004.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS session RADIOBUTTON GROUP ctu MODIF ID b1.  "create session

SELECTION-SCREEN COMMENT 3(20) text-s07 FOR FIELD session.

SELECTION-SCREEN POSITION 45.

PARAMETERS ctu RADIOBUTTON GROUP  ctu MODIF ID b2.     "call transaction

SELECTION-SCREEN COMMENT 48(20) text-s08 FOR FIELD ctu.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK three.

And another problem of my program is that before I can select the radiobutton I've to upload a file, I can't do it at last.

That's because, you have made the File as mandatory. remove the obligatory from p_file parameter

PARAMETERS: pa_file TYPE rlgrap-filename. " No Obligatory.


Than you can select the radio buttons and upload file at last.

hope this helps,

Regards,

Kiran

3 REPLIES 3
Read only

Former Member
0 Likes
1,326

The error in dump is this: "Insert fieldname and user name"

Read only

Kiran_Valluru
Active Contributor
0 Likes
1,327

Hi,

There is no dump occurring as you mentioned and its working fine. Except , you missed to close the selection screen block three.

  SELECTION-SCREEN BEGIN OF BLOCK three WITH FRAME TITLE text-004.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS session RADIOBUTTON GROUP ctu MODIF ID b1.  "create session

SELECTION-SCREEN COMMENT 3(20) text-s07 FOR FIELD session.

SELECTION-SCREEN POSITION 45.

PARAMETERS ctu RADIOBUTTON GROUP  ctu MODIF ID b2.     "call transaction

SELECTION-SCREEN COMMENT 48(20) text-s08 FOR FIELD ctu.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK three.

And another problem of my program is that before I can select the radiobutton I've to upload a file, I can't do it at last.

That's because, you have made the File as mandatory. remove the obligatory from p_file parameter

PARAMETERS: pa_file TYPE rlgrap-filename. " No Obligatory.


Than you can select the radio buttons and upload file at last.

hope this helps,

Regards,

Kiran

Read only

0 Likes
1,326

Thank you Kiran !

Regards,

Andrea