Wednesday, August 27, 2014

ABAP TIP Radio button, List Box & User command

ABAP Radio button, List Box  &  User command

When user click radio button, there is need like setting some field disable on the screen.
In order to implement this, you need to trigger some event as like user input enter command. This effects is possible to add USER-COMMAND option in radio button.

<ex 1>
REPORT  zradio_01.


PARAMETERS PARAMETERS p_r1 TYPE c RADIOBUTTON GROUP 
rad1
USER-COMMAND test DEFAULT 'X',
             p_r2 TYPE c RADIOBUTTON GROUP rad1.

PARAMETERS p_date TYPE d.

AT SELECTION-SCREEN OUTPUT.
  IF p_r2 EQ 'X'.
    LOOP AT SCREEN.
      IF screen-name 'P_DATE'.
        screen-input '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
















Seen as radio button, this is applicable to the LIST BOX.

PARAMETERS P_L1 TYPE SCARR-CARRID 
AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND TEST2.

<EX 2> set the p_data field disable when user select 'AA'.

<ex 2>
REPORT  zradio_02.


PARAMETERS P_L1 TYPE SCARR-CARRID AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND TEST2.

PARAMETERS p_date TYPE d.

AT SELECTION-SCREEN OUTPUT.
  IF P_L1 EQ 'AA'.
    LOOP AT SCREEN.
      IF screen-name 'P_DATE'.
        screen-input '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

 

No comments:

Post a Comment