parameters p_ckb1 radiobutton group radi.
parameters p_ckb2 radiobutton group radi.
Mais cette option n’est applicable qu’à des paramètres situés dans le même bloc d’un écran de sélection. En effet, le code suivant ne pourra être compilé :
*Définition d’un bloc b1 avec un radio bouton du groupe ‘RADI’
selection-screen begin of block b1 with frame.
parameters p_ckb1 radiobutton group radi.
selection-screen end of block b1.
*Définition d’un bloc b2 avec un radio bouton du groupe ‘RADI’
selection-screen begin of block b2 with frame.
parameters p_ckb2 radiobutton group radi.
selection-screen end of block b2.
(erreur de syntaxe : « A parameter of the radio button group « RADI » has already been defined in the block « B1 »).
La parade envisageable est la suivante : attribuer aux paramètres l’option checkbox et gérer leur comportement comme un radio bouton.
- Code: Tout sélectionner
report ztest.
TABLES SSCRFIELDS.
*Définition d’un bloc b1 avec case à cocher
selection-screen begin of block b1 with frame.
parameters p_ckb1 as checkbox default 'X' USER-COMMAND cb1.
selection-screen end of block b1.
*Définition d’un bloc b2 avec case à cocher
selection-screen begin of block b2 with frame.
parameters p_ckb2 as checkbox USER-COMMAND cb2.
selection-screen end of block b2.
*Définition d’un bloc b3 avec case à cocher
selection-screen begin of block b3 with frame.
parameters p_ckb3 as checkbox USER-COMMAND cb3.
selection-screen end of block b3.
* PBO de l'écran de sélection
AT SELECTION-SCREEN.
CASE SSCRFIELDS-UCOMM.
when 'CB1'.
if not p_ckb1 is initial.
clear : p_ckb2,
p_ckb3.
else.
p_ckb1 = 'X'.
endif.
when 'CB2'.
if not p_ckb2 is initial.
clear : p_ckb1,
p_ckb3.
else.
p_ckb2 = 'X'.
endif.
when 'CB3'.
if not p_ckb3 is initial.
clear : p_ckb1,
p_ckb2.
else.
p_ckb3 = 'X'.
endif.
endcase.


News