* Global data declaration
INCLUDE VSD11TOP.
* Initialization fieldcatalog
INITIALIZATION.
G_REPID = SY-REPID.
PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].
* Data selection
START-OF-SELECTION.
PERFORM SELECT_DATA TABLES GT_OUTTAB.
* Display list
END-OF-SELECTION.
* Set options: Save variants userspecific or general
* A = U & X, U = userspecific, X = general user
G_SAVE = 'A'.
PERFORM VARIANT_INIT.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = G_STATUS
I_CALLBACK_USER_COMMAND = G_USER_COMMAND
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_FIELDCAT = GT_FIELDCAT[]
TABLES
T_OUTTAB = GT_OUTTAB.
*-----------------------------------------------------------------------
* FORM PF_STATUS_SET
*-----------------------------------------------------------------------
FORM STANDARD_02 USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDA02' EXCLUDING EXTAB.
ENDFORM.
*-----------------------------------------------------------------------
* FORMS
*-----------------------------------------------------------------------
* Initialization fieldcatalog
FORM FIELDCAT_INIT
USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-FIELDNAME = 'CARRID'.
LS_FIELDCAT-KEY = 'X'. "sets key field
APPEND LS_FIELDCAT TO RT_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = G_REPID
I_INTERNAL_TABNAME = G_TABNAME
I_STRUCTURE_NAME = 'SIMLISTRUC'
I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
CT_FIELDCAT = RT_FIELDCAT.
ENDFORM. "fieldcat_init
* Data selection
FORM SELECT_DATA
TABLES RT_OUTTAB LIKE GT_OUTTAB[].
SELECT DISTINCT SCARR~CARRID SCARR~CARRNAME
SPFLI~CONNID SPFLI~CITYFROM
SPFLI~AIRPFROM SPFLI~CITYTO
SPFLI~AIRPTO SPFLI~DEPTIME
SPFLI~ARRTIME SPFLI~DISTANCE
SPFLI~DISTID
INTO (RT_OUTTAB-CARRID, RT_OUTTAB-CARRNAME,
RT_OUTTAB-CONNID, RT_OUTTAB-CITYFROM,
RT_OUTTAB-AIRPFROM, RT_OUTTAB-CITYTO,
RT_OUTTAB-AIRPTO, RT_OUTTAB-DEPTIME,
RT_OUTTAB-ARRTIME, RT_OUTTAB-DISTANCE,
RT_OUTTAB-DISTID)
FROM SCARR INNER JOIN SPFLI
ON SCARR~CARRID = SPFLI~CARRID
WHERE SCARR~CARRID BETWEEN 'AA' AND 'LH'.
APPEND RT_OUTTAB.
ENDSELECT.
ENDFORM.
*---------------------------------------------------------------------*
* FORM USER_COMMAND *
*---------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: L_TA TYPE SY-TCODE VALUE 'SLIS_DUMMY'.
*
CASE R_UCOMM.
WHEN 'WAHL'. "menubutton
READ TABLE GT_OUTTAB INDEX RS_SELFIELD-TABINDEX. "cursorposit.
IF SY-SUBRC = 0.
SUBMIT SLIS_DUMMY WITH P_CARRID EQ GT_OUTTAB-CARRID
WITH P_CONNID EQ GT_OUTTAB-CONNID.
ENDIF.
CLEAR R_UCOMM.
WHEN '&IC1'. "doubleclick
READ TABLE GT_OUTTAB INTO GT_OUTTAB INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SUBMIT SLIS_DUMMY WITH P_CARRID EQ GT_OUTTAB-CARRID
WITH P_CONNID EQ GT_OUTTAB-CONNID.
ENDIF.
CLEAR R_UCOMM.
ENDCASE.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form VARIANT_INIT
*&---------------------------------------------------------------------*
FORM VARIANT_INIT.
CLEAR G_VARIANT.
G_VARIANT-REPORT = G_REPID.
ENDFORM. " VARIANT_INIT
댓글 9
-
kkamui
2008.01.07 20:33
좋은정보 감사합니다. -
달식이
2008.02.26 23:14
좋은정보 잘 보겠습니다.
-
오향
2008.02.28 22:21
좋은정보 감사합니다.
-
카카오예~
2008.03.04 03:36
도움이 됐습니다 감사해요 ^^
-
pcj
2008.03.30 06:18
감사합니다~ -
hccpi
2008.06.02 20:53
좋은정보 감사합니다.
-
컨설팅
2008.08.22 02:40
감사합니다
-
indianhead
2009.12.23 00:56
좋은정보 감사합니다~~^^ -
DIB
2010.07.23 17:36
좋은 정보 유용하게 쓸게요~