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

user command

Former Member
0 Likes
654

in radio button at the end we used user command usr..

why we are using this.eg,

SELECTION-SCREEN BEGIN OF BLOCK RB WITH FRAME TITLE text.

PARAMETERS : Import RADIOBUTTON GROUP RB user-command usr,

Export RADIOBUTTON GROUP RB DEFAULT 'X'.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
545

USER COMMAND will perform actions on radiobutton click

<b>chk this example first using USER-COMMAND USR</b>

REPORT ABC MESSAGE-ID ZZ.

PARAMETERS : IMPORT RADIOBUTTON GROUP RB USER-COMMAND USR,
EXPORT RADIOBUTTON GROUP RB DEFAULT 'X'.

PARAMETERS : P_MATNR LIKE MARA-MATNR.

AT SELECTION-SCREEN OUTPUT.


  IF IMPORT EQ 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME EQ 'P_MATNR'.
        SCREEN-INPUT = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF EXPORT EQ 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME EQ 'P_MATNR'.
        SCREEN-INPUT = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

<b>and then removing user-command , notice the difference</b>

REPORT ABC MESSAGE-ID ZZ.

PARAMETERS : IMPORT RADIOBUTTON GROUP RB 
EXPORT RADIOBUTTON GROUP RB DEFAULT 'X'.

PARAMETERS : P_MATNR LIKE MARA-MATNR.

AT SELECTION-SCREEN OUTPUT.


  IF IMPORT EQ 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME EQ 'P_MATNR'.
        SCREEN-INPUT = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF EXPORT EQ 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME EQ 'P_MATNR'.
        SCREEN-INPUT = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

4 REPLIES 4
Read only

Former Member
0 Likes
545

hi,

chk this.

report zchk.
 
 
tables: sscrfields.
 
PARAMETERS: p_hold AS RADIOBUTTON DEFAULT 'X' USER-COMMAND hold.
 
at selection-screen.
 
  PERFORM sscr_user_commands.
*---------------------------------------------------------------------*
*       FORM sscr_user_commands                                       *
*---------------------------------------------------------------------*
FORM sscr_user_commands.
  CASE sscrfields-ucomm.
    WHEN 'HOLD'.            " Make this uppercase.
 
      break-point.
 
  ENDCASE.
ENDFORM.

Regards

Reshma

Read only

Former Member
0 Likes
546

USER COMMAND will perform actions on radiobutton click

<b>chk this example first using USER-COMMAND USR</b>

REPORT ABC MESSAGE-ID ZZ.

PARAMETERS : IMPORT RADIOBUTTON GROUP RB USER-COMMAND USR,
EXPORT RADIOBUTTON GROUP RB DEFAULT 'X'.

PARAMETERS : P_MATNR LIKE MARA-MATNR.

AT SELECTION-SCREEN OUTPUT.


  IF IMPORT EQ 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME EQ 'P_MATNR'.
        SCREEN-INPUT = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF EXPORT EQ 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME EQ 'P_MATNR'.
        SCREEN-INPUT = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

<b>and then removing user-command , notice the difference</b>

REPORT ABC MESSAGE-ID ZZ.

PARAMETERS : IMPORT RADIOBUTTON GROUP RB 
EXPORT RADIOBUTTON GROUP RB DEFAULT 'X'.

PARAMETERS : P_MATNR LIKE MARA-MATNR.

AT SELECTION-SCREEN OUTPUT.


  IF IMPORT EQ 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME EQ 'P_MATNR'.
        SCREEN-INPUT = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF EXPORT EQ 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME EQ 'P_MATNR'.
        SCREEN-INPUT = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Read only

Former Member
0 Likes
545

hi,

in radio buttons USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly, and have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects any radio button of the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields.

Read only

Former Member
0 Likes
545

thanks for everyone for helping me

regards

vijay