DATA: IT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
W_REPID LIKE SY-REPID,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
alv_sort type slis_sortinfo_alv occurs 1 with header line,
IT_EVENTS TYPE SLIS_T_EVENT,
user_command type slis_formname.
DATA: W_GT_SORT TYPE SLIS_SORTINFO_ALV OCCURS 1 WITH HEADER LINE .
CONSTANTS: C_TOP_OF_PAGE_DB TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE_DB'.
PERFORM EVENTTAB_BUILD USING IT_EVENTS[].
FORM EVENTTAB_BUILD USING LT_EVENTS TYPE SLIS_T_EVENT.
DATA: WA_EVENT TYPE SLIS_ALV_EVENT.
DATA: C_TOP_OF_PAGE TYPE SLIS_FORMNAME.
C_TOP_OF_PAGE = C_TOP_OF_PAGE_DB.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO WA_EVENT.
IF SY-SUBRC = 0.
MOVE C_TOP_OF_PAGE TO WA_EVENT-FORM.
APPEND WA_EVENT TO LT_EVENTS.
ELSE.
MOVE C_TOP_OF_PAGE TO WA_EVENT-FORM.
MODIFY LT_EVENTS FROM WA_EVENT INDEX SY-TABIX .
ENDIF.
endform. "EVENTTAB_BUILD
BEFORE DISPALY
W_GT_SORT-FIELDNAME = 'VBELN1'.
W_GT_SORT-UP = 'X'.
APPEND W_GT_SORT.
W_GT_SORT-FIELDNAME = 'REFER'.
W_GT_SORT-UP = 'X'.
APPEND W_GT_SORT.
W_GT_SORT-FIELDNAME = 'KUNNR'.
W_GT_SORT-UP = 'X'.
APPEND W_GT_SORT.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
read table wa_itab2 index rs_selfield-tabindex into wa_itab3.
CASE R_UCOMM.
WHEN '&IC1'.
SET PARAMETER ID 'VF' FIELD wa_itab3-vbeln1.
call transaction 'VF02' and skip first screen.
ENDCASE.
ENDFORM. "USER_COMMAND.
FORM TOP-OF-PAGE.
DATA : T_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER,
T_LINE LIKE WA_HEADER-INFO,
LD_LINES TYPE I,
LD_LINESC(10) TYPE C.
*TITLE
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = 'EXPORT REPORT'.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
*DATE
WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = 'DATE'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM+4(2) INTO WA_HEADER-INFO.
APPEND WA_HEADER TO T_HEADER .
CLEAR :WA_HEADER.
**TOTAL NO OF RECORDS
DESCRIBE TABLE IT_OBD2 LINES LD_LINES.
LD_LINESC = LD_LINES.
CONCATENATE 'TOTAL NO OF RECORDS SELECTED' LD_LINESC INTO T_LINE separated BY SPACE.
WA_HEADER-TYP = 'A'.
WA_HEADER-INFO = T_LINE.
APPEND WA_HEADER TO T_HEADER.
CLEAR : WA_HEADER, T_LINE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER[]
* I_LOGO =
* I_END_OF_LIST_GRID =
.
ENDFORM.
No comments:
Post a Comment