REPORT ZVVF_MM008_FRM_TRACK1 .
*---------------------------------------------------------------------*
* *
* MODULE : Material Management *
* *
*---------------------------------------------------------------------*
* Objective : Tracking C-Forms, H-Forms, Form-51 & Form 14B *
* *
* Program : Update Tables (X) Download Data ( ) Outputs List ( )*
* Technical Specs No : *
* Date Created : *
* Author : *
* Location : *
* LDB : *
* *
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
* TYPES *
*---------------------------------------------------------------------*
TYPE-POOLS : SLIS.
*---------------------------------------------------------------------*
* Tables *
*---------------------------------------------------------------------*
TABLES : SSCRFIELDS,
ZVVF_MT008_FRMTR. "Data For Form Tracking
*---------------------------------------------------------------------*
* Internal Tables *
*---------------------------------------------------------------------*
DATA : IT_ZVVF_MT008_FRMTR TYPE STANDARD TABLE OF ZVVF_MT008_FRMTR WITH
HEADER LINE.
*---------------------------------------------------------------------*
* Data Variables Begin with w_
*
*---------------------------------------------------------------------*
*-----FOR ALV
DATA: W_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
W_LISTHEADER TYPE SLIS_T_LISTHEADER,
W_EVENTS TYPE SLIS_T_EVENT,
W_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
W_REPID TYPE SY-REPID.
*----------------------------------------------------------------------*
* DATA : Begin with W_ *
*----------------------------------------------------------------------*
DATA : SAVE_OK LIKE SY-UCOMM,
OK_CODE LIKE SY-UCOMM.
*----------------------------------------------------------------------*
*Constants Begin with C_
*----------------------------------------------------------------------*
CONSTANTS: C_DESC(60) TYPE C VALUE 'FORM TRACKING DATA'.
*---------------------------------------------------------------------*
* INITIALIZATION *
*---------------------------------------------------------------------*
INITIALIZATION.
W_REPID = SY-REPID.
REFRESH : IT_ZVVF_MT008_FRMTR.
CLEAR : IT_ZVVF_MT008_FRMTR.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'ZM008_FORM'.
CALL TRANSACTION 'ZM008_FORM'.
WHEN 'ZM008_FRMTRK'.
CALL TRANSACTION 'ZM008_FRMTRK'.
WHEN 'ZM008_REP'.
CALL TRANSACTION 'ZM008_REP'.
WHEN 'EXP'.
W_REPID = SY-REPID.
PERFORM F001_EVENTTAB_BUILD_TEMP USING W_EVENTS[].
PERFORM F002_FIELDCAT_INIT.
PERFORM F004_EXPORT_DATA.
PERFORM F003_DISPLAY_DATA USING W_LISTHEADER[].
PERFORM F005_DISPLAY_EXPORT_DATA.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
CLEAR SAVE_OK.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR 'TITLE-100'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Form F001_eventtab_build_temp
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_W_EVENTS[] text
*----------------------------------------------------------------------*
FORM F001_EVENTTAB_BUILD_TEMP USING RT_EVENTS TYPE SLIS_T_EVENT.
DATA : LW_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = RT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE RT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LW_EVENT
.
IF SY-SUBRC = 0.
MOVE W_TOP_OF_PAGE TO LW_EVENT-FORM.
APPEND LW_EVENT TO RT_EVENTS.
ENDIF.
ENDFORM. " F001_eventtab_build_temp
*&--------------------------------------------------------------------*
*& Form F002_FIELDCAT_INIT
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM F002_FIELDCAT_INIT .
DATA : LW_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
REFRESH W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'EBELN'.
LW_FIELDCAT-SELTEXT_M = 'Purchase Order No'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'EBELP'.
LW_FIELDCAT-SELTEXT_M = 'Item No'.
LW_FIELDCAT-OUTPUTLEN = 5.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MBLNR'.
LW_FIELDCAT-SELTEXT_M = 'GRN No'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'BELNR'.
LW_FIELDCAT-SELTEXT_M = 'Invoice No'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MJAHR'.
LW_FIELDCAT-SELTEXT_M = 'Material Doc. Year'.
LW_FIELDCAT-OUTPUTLEN = 4.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'GBLDAT'.
LW_FIELDCAT-SELTEXT_M = 'GRN Date'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'GJAHR'.
LW_FIELDCAT-SELTEXT_M = 'Inv. Year'.
LW_FIELDCAT-OUTPUTLEN = 4.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'IBLDAT'.
LW_FIELDCAT-SELTEXT_M = 'Inv. Date'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'LIFNR'.
LW_FIELDCAT-SELTEXT_M = 'Vendor No.'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'NAME1'.
LW_FIELDCAT-SELTEXT_M = 'Vendor Name'.
LW_FIELDCAT-OUTPUTLEN = 35.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MWSKZ'.
LW_FIELDCAT-SELTEXT_M = 'Tax Code'.
LW_FIELDCAT-OUTPUTLEN = 2.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'GMENGE'.
LW_FIELDCAT-SELTEXT_M = 'GRN Quantity'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'IMENGE'.
LW_FIELDCAT-SELTEXT_M = 'INV Quantity'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'RMWWR'.
LW_FIELDCAT-SELTEXT_M = 'Invoice Amount'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'XBLNR'.
LW_FIELDCAT-SELTEXT_M = 'Reference Document No.'.
LW_FIELDCAT-OUTPUTLEN = 16.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'FRMTYPE'.
LW_FIELDCAT-SELTEXT_M = 'Form Type'.
LW_FIELDCAT-OUTPUTLEN = 16.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'FRMNO'.
LW_FIELDCAT-SELTEXT_M = 'Form Number'.
LW_FIELDCAT-OUTPUTLEN = 20.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'FRMDATE'.
LW_FIELDCAT-SELTEXT_M = 'Form Date'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
ENDFORM. " F002_FIELDCAT_INIT
*&---------------------------------------------------------------------*
*& Form F004_EXPORT_DATA
*&---------------------------------------------------------------------*
FORM F004_EXPORT_DATA .
SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_ZVVF_MT008_FRMTR
FROM ZVVF_MT008_FRMTR.
ENDFORM. " F004_EXPORT_DATA
*&---------------------------------------------------------------------*
*& Form F003_DISPLAY_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_W_LISTHEADER[] text
*----------------------------------------------------------------------*
FORM F003_DISPLAY_DATA USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER .
DATA: LW_LINE TYPE SLIS_LISTHEADER.
CLEAR LW_LINE.
REFRESH LT_TOP_OF_PAGE.
LW_LINE-TYP = 'H'.
LW_LINE-INFO = C_DESC.
APPEND LW_LINE TO LT_TOP_OF_PAGE.
CLEAR LW_LINE.
ENDFORM. " F003_DISPLAY_DATA
*&--------------------------------------------------------------------*
*& Form F005_DISPLAY_EXPORT_DATA
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM F005_DISPLAY_EXPORT_DATA .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = W_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'ALV_BACKGROUND'
* I_GRID_TITLE =
* I_GRID_SETTINGS =
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = W_FIELDCATALOG[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = W_EVENTS
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_ZVVF_MT008_FRMTR
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F005_DISPLAY_EXPORT_DATA
*&--------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&--------------------------------------------------------------------*
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = W_LISTHEADER
I_LOGO = ' '.
ENDFORM. "top_of_page
No comments:
Post a Comment