Drunken Lion

I_CALLBACK_USER_COMMAND 본문

SAP/ALV

I_CALLBACK_USER_COMMAND

DrkLion 2007. 10. 4. 10:35
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
*         I_INTERFACE_CHECK        = ' '
          i_callback_program       = pgm
          i_callback_pf_status_set =
          i_callback_user_command  = 'USER_COMMAND'
*         I_STRUCTURE_NAME         =
*         IS_LAYOUT                =
          it_fieldcat              = fieldcat
*         it_excluding             = pf_extab
*         IT_SPECIAL_GROUPS        =
*         IT_SORT                  =
*         IT_FILTER                =
*         IS_SEL_HIDE              =
*         I_DEFAULT                = 'X'
*         I_SAVE                   = ' '
*         IS_VARIANT               = ' '
*         IT_EVENTS                =
*         IT_EVENT_EXIT            =
*         IS_PRINT                 =
*         I_SCREEN_START_COLUMN    = 0
*         I_SCREEN_START_LINE      = 0
*         I_SCREEN_END_COLUMN      = 0
*         I_SCREEN_END_LINE        = 0
*    IMPORTING
*         E_EXIT_CAUSED_BY_CALLER  =
*         ES_EXIT_CAUSED_BY_USER   =
       TABLES
            t_outtab                 = download
       EXCEPTIONS
            program_error            = 1
            OTHERS                   = 2.

  Function Code에 대한 Exit routine 을 제공한다, 사용자 입력에 대해 어떤 이벤트를 발생시킬지 결정할수 있다.

 1. data 선언
DATA: G_USER_COMMAND TYPE SLIS_FORMNAE VALUE 'USER_COMMAND'.
 2. Form 문 구성
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                                    RS_SELFIELD TYPE SLIS_SELFIELD.
  CASE R_UCOMM.
    WHEN '&IC1'.  
* EVENT 구현
  ENDCASE.


RS_SELFIELD STRUCTURE 에는 아래와 같은 정보가 포함되어 있다.

FIELD NAME DESCRTIPTION
TABNAME Internal output table name
TABINDEX internal output table index
FIELDNAME field name of cursor position
ENDSUM cursor is on the final total row
SUMINDEX cursor is on a subtatal row
VALUE field value on the list
REFRESH (exporting) list to be refreshed
COL_STABLE (exporting) keep column positions in refresh
ROW_STABLE (exporting) keep row position in refresh
EXIT (exporting) leave list
BEFORE_ACTION jump before performing standard action
AFTER_ACTION jump after performing stadard action , before creating list
IGNORE_MULTI internal use

3. 적용

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
*         I_INTERFACE_CHECK        = ' '
          i_callback_program       = pgm
          i_callback_pf_status_set =
        i_callback_user_command  = 'USER_COMMAND'   "Form Name
.
.
.



'SAP > ALV' 카테고리의 다른 글

IT_FIELDCAT  (0) 2007.10.04
IS_LAYOUT  (0) 2007.10.04
I_STRUCTURE_NAME  (0) 2007.10.04
I_CALLBACK_PF_STATUS_SET  (0) 2007.10.02
I_callback_program  (0) 2007.09.27