Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[ABAP] Activate and deactivate input fields via radiobuttons

*-----------------------------------------------------------------------
* SELEKTIONSBILD
*-----------------------------------------------------------------------
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

* Radiobutton 1 -> Deactivate Fields
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_radio1 RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND rad.
SELECTION-SCREEN COMMENT 6(37) text-t01 FOR FIELD p_radio1.  
SELECTION-SCREEN : END OF LINE.

* Radiobutton 2 -> Activate Fields
SELECTION-SCREEN : BEGIN OF LINE.
PARAMETERS: p_radio2 RADIOBUTTON GROUP rad1.
SELECTION-SCREEN COMMENT 6(37) text-t02 FOR FIELD p_radio2.
SELECTION-SCREEN : END OF LINE.

* Input fields
PARAMETERS:
  p_vorna TYPE vorna OBLIGATORY DEFAULT 'Max',
  p_nachn TYPE nachn OBLIGATORY DEFAULT 'Mustermann'.

SELECTION-SCREEN END OF BLOCK b1.


*----------------------------------------------------------------------
* AT SELECTION-SCREEN
*----------------------------------------------------------------------
AT SELECTION-SCREEN OUTPUT. " PBO
  LOOP AT SCREEN.
    CASE screen-name.
      WHEN 'P_VORNA' OR 'P_NACHN'.
        screen-input = COND #( WHEN p_radio2 = abap_true THEN 1 ELSE 0 ).
        MODIFY SCREEN.
    ENDCASE.
  ENDLOOP.

[ABAP] Radiobutton with label (comment) and input field

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-b01.

* Schnittstelle
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_server RADIOBUTTON GROUP rad1.
SELECTION-SCREEN COMMENT 6(26) text-t01 FOR FIELD p_server.
PARAMETERS: p_sname(8) TYPE c DEFAULT ''. 
SELECTION-SCREEN END OF LINE.

* Filename (optional)
PARAMETERS: p_fname TYPE j_3sdsn.

* Lokale Datei
PARAMETERS: p_local  RADIOBUTTON GROUP rad1 DEFAULT 'X'.
* Dateiauswahl
PARAMETERS: p_up     TYPE dxfile-filename DEFAULT ''.

SELECTION-SCREEN END OF BLOCK b1.