ABAP Code Sample to Report IDOCs in Error

Size: px
Start display at page:

Download "ABAP Code Sample to Report IDOCs in Error"

Transcription

1 Applies To: SAP 4.6 C and SAP 4.7 Enterprise Edition Summary This report displays all the error IDOCs for both INBOUND and OUTBOUND based on message type, it also having a provision to drill down the number of errors and error type for each message type and also display the current week as well as pervious 5 weeks of IDOCS. Provides a option to drill down for each message type, error message to find the root cause of the error By: Suresh S Revuru Company: INTELLIGROUP INC., Date: 09 March 2006 Code Sample Description Instead of using WE05 Transaction to list the IDOCS, we can use this report to display all the error records, Error descriptions. Normally we will goto WE05 and find the error record and double click the record to see the exact error message. It is very difficult to see each and every error IDOC. Lets think how it difficult to do it for a week. So this simple report extract all the error IDOCS for current week and also shows the past 5 weeks error IDOCS. REPORT ZIDOC_error_message MESSAGE-ID ID. * * * AUTHOR : SURESH REVURU * * * *Include Icons INCLUDE <ICON>. *Type pools for ALV data types TYPE-POOLS: SLIS. *********************************************************************** 1

2 *Declaration for Tables *********************************************************************** TABLES:EDIDC, EDIDS, "Control record (IDoc) "Status Record (IDOC) TEDS1, TEDS2, STACUST, STALIGHT, ZIDOC, FRUN. "To store the execution date. *********************************************************************** *-Declaration of Internal Tables *********************************************************************** DATA:BEGIN OF IT_STATUS OCCURS 0, STATUS LIKE STACUST-STATUS, COUNT TYPE I, END OF IT_STATUS. DATA: BEGIN OF IT_DOCNUM OCCURS 0, STATUS LIKE EDIDC-STATUS, MESTYP LIKE EDIDC-MESTYP, DOCNUM LIKE EDIDC-DOCNUM, END OF IT_DOCNUM. DATA:BEGIN OF IT_COUNT OCCURS 0, STATUS LIKE STACUST-STATUS, 2

3 COUNT LIKE SY-TABIX, END OF IT_COUNT. * Internal table for displaying the output. DATA:BEGIN OF IT_OUTPUT OCCURS 0, CHK, " Field for checkbox BASEWEEK LIKE SY-DATUM, ERROR LIKE EDIDC-STATUS, IDOC LIKE EDIDC-DOCNUM, MESSAGE LIKE EDIDC-MESTYP, WK1 LIKE EDIDC-MAXSEGNUM, WK2 LIKE EDIDC-MAXSEGNUM, WK3 LIKE EDIDC-MAXSEGNUM, WK4 LIKE EDIDC-MAXSEGNUM, WK5 LIKE EDIDC-MAXSEGNUM, END OF IT_OUTPUT. DATA: BEGIN OF IT_IDOCMESS OCCURS 0, SNO TYPE I, BASEWEEK LIKE SY-DATUM, MESSAGE LIKE EDIDC-MESTYP, ERROR LIKE EDIDC-STATUS, TEXT LIKE BDIDOCATTR-MESSAGE, NO_OF_ERR LIKE ZIPOPUP-NO_OF_ERR, WEEK LIKE ZIPOPUP-WEEK, WK1 LIKE EDIDC-MAXSEGNUM, WK2 LIKE EDIDC-MAXSEGNUM, WK3 LIKE EDIDC-MAXSEGNUM, WK4 LIKE EDIDC-MAXSEGNUM, 3

4 WK5 LIKE EDIDC-MAXSEGNUM, END OF IT_IDOCMESS. * Internal tables to store detailed errors of the idocs DATA: IT_IDOCMESS1 LIKE ZIPOPUP OCCURS 0 WITH HEADER LINE. DATA: IT_IDOCMESS2 LIKE IT_IDOCMESS OCCURS 0 WITH HEADER LINE, IT_IDOCMESS2_TEMP LIKE IT_IDOCMESS OCCURS 0 WITH HEADER LINE. * Internal table to hold all the baseweeks DATA:BEGIN OF IT_DATE OCCURS 0, LOW LIKE SY-DATUM, HIGH LIKE SY-DATUM, END OF IT_DATE. * Declaration of Variables DATA: NO_OF_ERR LIKE SY-TABIX. DATA: V_FLAG LIKE SY-TABIX, F_FLAG TYPE I. * Fieldcatalog for IT_OUTPUT DATA: IT_FIELDCAT_DATA TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE, * Events in ALV IT_EVENTS_DATA TYPE SLIS_T_EVENT WITH HEADER LINE, * Sorting IT_SORT_DATA TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE, IT_ZIDOC LIKE ZIDOC OCCURS 0 WITH HEADER LINE, * Storing properties for fields displayed in Popup. 4

5 IT_FIELDCAT_POPUP TYPE SLIS_T_FIELDCAT_ALV, X_FIEDLCAT TYPE SLIS_FIELDCAT_ALV. ******************************************************************* *- Declaration for Variables ******************************************************************* DATA: V_TABIX LIKE SY-TABIX, " For internal table index V_REPID LIKE SY-REPID, V_COUNT TYPE I, V_FLAG1 TYPE I, V_SNO TYPE I, V_MESSAGE TYPE BDIDOCATTR-MESSAGE,"EDIDC-MESTYP, V_ERROR TYPE EDIDC-STATUS, V_DOCNUM LIKE EDIDC-DOCNUM, X_LAYOUT_DATA X_EVENTS_DATA TYPE SLIS_LAYOUT_ALV, " Layout for data TYPE SLIS_ALV_EVENT. " " For events. ******************************************************************* *- Declaration for Constants ******************************************************************* ************************************************************************ * SELECTION-SCREEN * ************************************************************************ *Selection Screen for data extraction using order create date and *order change date. SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001. PARAMETERS: P_DATE LIKE EDIDC-CREDAT OBLIGATORY. 5

6 *SELECT-OPTIONS: P_DATE FOR EDIDC-CREDAT OBLIGATORY NO-EXTENSION. SELECTION-SCREEN END OF BLOCK B1. **************************************************************** *_ Initialization **************************************************************** V_REPID = SY-REPID. AT SELECTION-SCREEN. PERFORM DATE_EXTRACTION. **************************************************************** * Start of Selection **************************************************************** START-OF-SELECTION. **Logic to avoid the users action. *CLEAR V_SNO. * SELECT COUNT(*) FROM ZIDOC * INTO V_SNO * WHERE BASEWEEK = S_DATE-LOW OR BASEWEEK = S_DATE-HIGH. * IF SY-SUBRC = 0. * MESSAGE E001. * *frun table this will be usefull in selection variant for scheduling the 6

7 * batch jobs for delta runs. PERFORM UPDATE_LAST_RUN_TIME. *This subroutine extracts the date from the given dates and stores in * internal table it_date. * PERFORM DATE_EXTRACTION. *This subroutine extracts the data from EDIDIC table. PERFORM GET_DATA_BASIC_LIST. * This subroutine extracts the detail data from EDIDS table. PERFORM GET_DATA_DETAIL_LIST. * This subroutines gets the previous 4 weeks of data for comparison. PERFORM PREVIOUS_WEEK. SORT IT_OUTPUT BY BASEWEEK. DELETE ADJACENT DUPLICATES FROM IT_OUTPUT COMPARING BASEWEEK MESSAGE ERROR. *This subroutine displays the it_output internal table in screen PERFORM DISPLAY_DATA. **************************************************************** * End of Selection **************************************************************** END-OF-SELECTION. 7

8 * Top of list FORM TOP-OF-LIST. FORMAT COLOR COL_HEADING INTENSIFIED ON. * Display Steelcase header CALL FUNCTION 'Z_STEELCASE_HEADER'. FORMAT COLOR OFF. ENDFORM. *& * *& Form PF_STATUS_SET *& * * text: This subroutine sets the pf-status * * * --> p1 text * <-- p2 text * * FORM PF_STATUS_SET USING P_EXTAB TYPE SLIS_T_EXTAB. SET PF-STATUS 'STANDARD'. ENDFORM. " PF_STATUS_SET *& * *& Form DATE_EXTRACTION *& * * text * * * --> p1 text 8

9 * <-- p2 text * * FORM DATE_EXTRACTION. DATA: IT_DATES LIKE ZWKDATES OCCURS 0 WITH HEADER LINE. DATA: V_DATESTART LIKE SY-DATUM. DATA: CURRBASEWEEK LIKE SY-DATUM. DATA: NEXBASEWEEK LIKE SY-DATUM. *DATA: V_DATE LIKE SY-DATUM. *CLEAR V_DATE. *V_DATE = P_DATE. CALL FUNCTION 'Z_GET_WEEK_DATES' EXPORTING DATE = P_DATE NUMWEEKS = '000' DIRECT = '-' TABLES DATES = IT_DATES * EXCEPTIONS * CALC_ERROR = 1 * INC_DIRECT = 2 * OTHERS = 3. IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. CLEAR V_DATESTART. 9

10 LOOP AT IT_DATES. V_DATESTART = IT_DATES-WKSTART. ENDLOOP. CLEAR CURRBASEWEEK. CLEAR NEXBASEWEEK. IT_DATE-HIGH = V_DATESTART - 2. IT_DATE-LOW = IT_DATE-HIGH - 6. CURRBASEWEEK = IT_DATE-HIGH + 1. NEXBASEWEEK = CURRBASEWEEK + 7. SELECT SINGLE BASEWEEK FROM ZIDOC INTO CURRBASEWEEK WHERE BASEWEEK = NEXBASEWEEK. IF SY-SUBRC = 0. MESSAGE E002. * IT_DATE-LOW = S_DATE-LOW. * IT_DATE-HIGH = S_DATE-HIGH. F_FLAG = 1. WHILE F_FLAG < 6. APPEND IT_DATE. F_FLAG = F_FLAG + 1. IT_DATE-LOW = IT_DATE-LOW

11 IT_DATE-HIGH = IT_DATE-HIGH - 7. ENDWHILE. ENDFORM. " DATE_EXTRACTION *& * *& Form GET_DATA_BASIC_LIST *& * * text * * * --> p1 text * <-- p2 text * * FORM GET_DATA_BASIC_LIST. DATA: IT_ZIDOC LIKE ZIDOC OCCURS 0 WITH HEADER LINE. REFRESH IT_ZIDOC. SELECT STACUST~STATUS INTO TABLE IT_STATUS FROM STACUST JOIN STALIGHT ON STACUST~STATVA = STALIGHT~STATVA WHERE STALIGHT~STALIGHT = '03'. IF SY-SUBRC = 0. * To extract idocs for all the 5 weeks LOOP AT IT_DATE. SELECT STATUS COUNT(*) FROM EDIDC 11

12 INTO TABLE IT_COUNT WHERE CREDAT BETWEEN IT_DATE-LOW AND IT_DATE-HIGH GROUP BY STATUS. ENDLOOP. IF SY-SUBRC EQ 0. SORT IT_STATUS. SORT IT_COUNT. LOOP AT IT_COUNT. V_TABIX = SY-TABIX. READ TABLE IT_STATUS WITH KEY STATUS = IT_COUNT-STATUS. IF SY-SUBRC <> 0. DELETE IT_COUNT INDEX V_TABIX. CLEAR IT_COUNT. ENDLOOP. CLEAR V_TABIX. ******************FILLING THE IT_OUTPUT TABLE WITH THE REQUIRED DATA REFRESH IT_OUTPUT. SELECT COUNT(*) INTO V_SNO FROM ZIDOC WHERE SNO > 0. LOOP AT IT_COUNT. 12

13 IF IT_COUNT-COUNT > 20. CLEAR V_FLAG1. LOOP AT IT_DATE. V_FLAG1 = V_FLAG SELECT MESTYP COUNT( * ) FROM EDIDC INTO (IT_OUTPUT-MESSAGE, NO_OF_ERR) WHERE STATUS = IT_COUNT-STATUS AND CREDAT BETWEEN IT_DATE-LOW AND IT_DATE-HIGH GROUP BY MESTYP. IT_OUTPUT-BASEWEEK = IT_DATE-HIGH + 1. IT_OUTPUT-ERROR = IT_COUNT-STATUS. *This subroutine find out the previous erros for the perticular week * PERFORM PREVIOUS_WEEK USING IT_OUTPUT-BASEWEEK IT_OUTPUT-MESSAGE * IT_OUTPUT-ERROR. * CASE V_FLAG1. WHEN 1. IT_OUTPUT-WK1 = NO_OF_ERR. MOVE IT_OUTPUT-WK1 TO ZIDOC-NO_OF_ERR. MOVE 'WK1' TO ZIDOC-WEEK. IT_OUTPUT-WK2 = ''. IT_OUTPUT-WK3 = ''. IT_OUTPUT-WK4 = ''. IT_OUTPUT-WK5 = ''. 13

14 WHEN 2. IT_OUTPUT-WK2 = NO_OF_ERR. MOVE IT_OUTPUT-WK2 TO ZIDOC-NO_OF_ERR. MOVE 'WK2' TO ZIDOC-WEEK. IT_OUTPUT-WK1 = ''. IT_OUTPUT-WK3 = ''. IT_OUTPUT-WK4 = ''. IT_OUTPUT-WK5 = ''. WHEN 3. IT_OUTPUT-WK3 = NO_OF_ERR. MOVE IT_OUTPUT-WK3 TO ZIDOC-NO_OF_ERR. MOVE 'WK3' TO ZIDOC-WEEK. IT_OUTPUT-WK2 = ''. IT_OUTPUT-WK1 = ''. IT_OUTPUT-WK4 = ''. IT_OUTPUT-WK5 = ''. WHEN 4. IT_OUTPUT-WK4 = NO_OF_ERR. MOVE IT_OUTPUT-WK4 TO ZIDOC-NO_OF_ERR. MOVE 'WK4' TO ZIDOC-WEEK. IT_OUTPUT-WK2 = ''. IT_OUTPUT-WK3 = ''. IT_OUTPUT-WK1 = ''. IT_OUTPUT-WK5 = ''. 14

15 WHEN 5. IT_OUTPUT-WK5 = NO_OF_ERR. MOVE IT_OUTPUT-WK5 TO ZIDOC-NO_OF_ERR. MOVE 'WK5' TO ZIDOC-WEEK. IT_OUTPUT-WK2 = ''. IT_OUTPUT-WK3 = ''. IT_OUTPUT-WK4 = ''. IT_OUTPUT-WK1 = ''. ENDCASE. IF NO_OF_ERR > 20. APPEND IT_OUTPUT. CLEAR IT_OUTPUT. ENDSELECT. ENDLOOP. CLEAR NO_OF_ERR. CLEAR V_FLAG1. ENDLOOP. SORT IT_OUTPUT BY BASEWEEK. PERFORM UPDATE_DATABASE_TABLES. ENDFORM. " GET_DATA *& * 15

16 *& Form DISPLAY_DATA *& * * text: This subroutine displays the data in screen * * * --> p1 text * <-- p2 text * * FORM DISPLAY_DATA. *Build fieldcatalog internal table PERFORM BUILD_DATA_TABLE_CATALOG. *Displays the Alv Grid PERFORM DISPLAY_ALV_OUTPUT. ENDFORM. " DISPLAY_DATA *& * *& Form BUILD_DATA_TABLE_CATALOG *& * * text: This forms builds the fieldcatalog * * * --> p1 text * <-- p2 text * * FORM BUILD_DATA_TABLE_CATALOG. DATA: L_POS(2) TYPE N VALUE 1. REFRESH IT_FIELDCAT_DATA. CLEAR IT_FIELDCAT_DATA. 16

17 IT_FIELDCAT_DATA-FIELDNAME IT_FIELDCAT_DATA-TABNAME IT_FIELDCAT_DATA-COL_POS IT_FIELDCAT_DATA-SELTEXT_M IT_FIELDCAT_DATA-DDICTXT = 'BASEWEEK'. = 'IT_OUTPUT'. = L_POS. = 'BASE WEEK'(001). = 'M'. IT_FIELDCAT_DATA-OUTPUTLEN = 10. IT_FIELDCAT_DATA-FIX_COLUMN IT_FIELDCAT_DATA-EMPHASIZE = 'C700'. * IT_FIELDCAT_DATA-HOTSPOT IT_FIELDCAT_DATA-NO_ZERO APPEND IT_FIELDCAT_DATA. CLEAR IT_FIELDCAT_DATA. L_POS = L_POS + 1. IT_FIELDCAT_DATA-FIELDNAME IT_FIELDCAT_DATA-TABNAME IT_FIELDCAT_DATA-COL_POS IT_FIELDCAT_DATA-SELTEXT_M IT_FIELDCAT_DATA-DDICTXT = 'MESSAGE'. = 'IT_OUTPUT'. = L_POS. = 'MESSAGE'(002). = 'M'. IT_FIELDCAT_DATA-OUTPUTLEN = 10. IT_FIELDCAT_DATA-FIX_COLUMN IT_FIELDCAT_DATA-EMPHASIZE IT_FIELDCAT_DATA-NO_ZERO = 'C700'. APPEND IT_FIELDCAT_DATA. CLEAR IT_FIELDCAT_DATA. L_POS = L_POS

18 IT_FIELDCAT_DATA-FIELDNAME IT_FIELDCAT_DATA-TABNAME IT_FIELDCAT_DATA-COL_POS IT_FIELDCAT_DATA-SELTEXT_M IT_FIELDCAT_DATA-DDICTXT = 'ERROR'. = 'IT_OUTPUT'. = L_POS. = 'ERROR'(003). = 'M'. IT_FIELDCAT_DATA-OUTPUTLEN = 10. IT_FIELDCAT_DATA-FIX_COLUMN IT_FIELDCAT_DATA-EMPHASIZE IT_FIELDCAT_DATA-NO_ZERO = 'C700'. APPEND IT_FIELDCAT_DATA. CLEAR IT_FIELDCAT_DATA. L_POS = L_POS + 1. IT_FIELDCAT_DATA-FIELDNAME IT_FIELDCAT_DATA-TABNAME IT_FIELDCAT_DATA-COL_POS IT_FIELDCAT_DATA-SELTEXT_M IT_FIELDCAT_DATA-DDICTXT = 'WK1'. = 'IT_OUTPUT'. = L_POS. = 'WEEK1 ERROS'(004). = 'M'. IT_FIELDCAT_DATA-OUTPUTLEN = 10. IT_FIELDCAT_DATA-EMPHASIZE IT_FIELDCAT_DATA-DATATYPE IT_FIELDCAT_DATA-INTTYPE IT_FIELDCAT_DATA-INTLEN IT_FIELDCAT_DATA-FIX_COLUMN IT_FIELDCAT_DATA-NO_ZERO IT_FIELDCAT_DATA-DO_SUM = 'C600'. = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_DATA. 18

19 CLEAR IT_FIELDCAT_DATA. L_POS = L_POS + 1. IT_FIELDCAT_DATA-FIELDNAME IT_FIELDCAT_DATA-TABNAME IT_FIELDCAT_DATA-COL_POS IT_FIELDCAT_DATA-SELTEXT_M IT_FIELDCAT_DATA-DDICTXT = 'WK2'. = 'IT_OUTPUT'. = L_POS. = 'WEEK2 ERROS'(004). = 'M'. IT_FIELDCAT_DATA-OUTPUTLEN = 10. IT_FIELDCAT_DATA-FIX_COLUMN IT_FIELDCAT_DATA-EMPHASIZE IT_FIELDCAT_DATA-DATATYPE IT_FIELDCAT_DATA-INTTYPE IT_FIELDCAT_DATA-INTLEN IT_FIELDCAT_DATA-NO_ZERO IT_FIELDCAT_DATA-DO_SUM = 'C600'. = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_DATA. CLEAR IT_FIELDCAT_DATA. L_POS = L_POS + 1. IT_FIELDCAT_DATA-FIELDNAME IT_FIELDCAT_DATA-TABNAME IT_FIELDCAT_DATA-COL_POS IT_FIELDCAT_DATA-SELTEXT_M IT_FIELDCAT_DATA-DDICTXT = 'WK3'. = 'IT_OUTPUT'. = L_POS. = 'WEEK3 ERROS'(005). = 'M'. IT_FIELDCAT_DATA-OUTPUTLEN = 10. IT_FIELDCAT_DATA-FIX_COLUMN IT_FIELDCAT_DATA-EMPHASIZE = 'C600'. 19

20 IT_FIELDCAT_DATA-DATATYPE IT_FIELDCAT_DATA-INTTYPE IT_FIELDCAT_DATA-INTLEN IT_FIELDCAT_DATA-NO_ZERO IT_FIELDCAT_DATA-DO_SUM = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_DATA. CLEAR IT_FIELDCAT_DATA. L_POS = L_POS + 1. IT_FIELDCAT_DATA-FIELDNAME IT_FIELDCAT_DATA-TABNAME IT_FIELDCAT_DATA-COL_POS IT_FIELDCAT_DATA-SELTEXT_M IT_FIELDCAT_DATA-DDICTXT = 'WK4'. = 'IT_OUTPUT'. = L_POS. = 'WEEK4 ERRORS'(006). = 'M'. IT_FIELDCAT_DATA-OUTPUTLEN = 10. IT_FIELDCAT_DATA-FIX_COLUMN IT_FIELDCAT_DATA-EMPHASIZE IT_FIELDCAT_DATA-DATATYPE IT_FIELDCAT_DATA-INTTYPE IT_FIELDCAT_DATA-INTLEN IT_FIELDCAT_DATA-NO_ZERO IT_FIELDCAT_DATA-DO_SUM = 'C600'. = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_DATA. CLEAR IT_FIELDCAT_DATA. L_POS = L_POS + 1. IT_FIELDCAT_DATA-FIELDNAME IT_FIELDCAT_DATA-TABNAME = 'WK5'. = 'IT_OUTPUT'. 20

21 IT_FIELDCAT_DATA-COL_POS IT_FIELDCAT_DATA-SELTEXT_M IT_FIELDCAT_DATA-DDICTXT = L_POS. = 'WEEK5 ERROS'(005). = 'M'. IT_FIELDCAT_DATA-OUTPUTLEN = 10. IT_FIELDCAT_DATA-FIX_COLUMN IT_FIELDCAT_DATA-EMPHASIZE IT_FIELDCAT_DATA-DATATYPE IT_FIELDCAT_DATA-INTTYPE IT_FIELDCAT_DATA-INTLEN IT_FIELDCAT_DATA-NO_ZERO IT_FIELDCAT_DATA-DO_SUM = 'C600'. = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_DATA. CLEAR IT_FIELDCAT_DATA. L_POS = L_POS + 1. ENDFORM. " BUILD_DATA_TABLE_CATALOG *& * *& Form DISPLAY_ALV_OUTPUT *& * * text This form displays the ALV grid * * * --> p1 text * <-- p2 text * * FORM DISPLAY_ALV_OUTPUT. DATA: L_USER_FORMNAME TYPE SLIS_FORMNAME VALUE 'USER_COMMAND', 21

22 L_PF_STAT_FORNAME TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET'. * SET LAYOUT VARIABLE, EVENTS AND SORT FIELDS X_LAYOUT_DATA-ZEBRA " Zebra Layout X_LAYOUT_DATA-GET_SELINFOS IT_EVENTS_DATA-NAME = 'TOP_OF_LIST'. IT_EVENTS_DATA-FORM = 'TOP-OF-LIST'. APPEND IT_EVENTS_DATA. CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT' EXPORTING I_CALLBACK_PROGRAM = V_REPID I_CALLBACK_PF_STATUS_SET = L_PF_STAT_FORNAME I_CALLBACK_USER_COMMAND = L_USER_FORMNAME * IT_EXCLUDING =. X_LAYOUT_DATA-BOX_FIELDNAME = 'CHK'. X_LAYOUT_DATA-BOX_TABNAME = 'IT_OUTPUT'. * X_LAYOUT_DATA-SUBTOTALS_TEXT = '*'. X_LAYOUT_DATA-TOTALS_TEXT = 'Totals#'. CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND' EXPORTING IS_LAYOUT IT_FIELDCAT = X_LAYOUT_DATA = IT_FIELDCAT_DATA[] 22

23 I_TABNAME IT_EVENTS IT_SORT = 'IT_OUTPUT' = IT_EVENTS_DATA[] = IT_SORT_DATA[] * I_TEXT = ' ' TABLES T_OUTTAB = IT_OUTPUT EXCEPTIONS PROGRAM_ERROR = 1 MAXIMUM_OF_APPENDS_REACHED = 2 OTHERS = 3. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY' * EXPORTING * I_INTERFACE_CHECK = ' ' * 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 = EXCEPTIONS 23

24 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. ENDFORM. " DISPLAY_ALV_OUTPUT *& * *& Form IT_POPUP_DISPLAY *& * * text: Displays popup screen * * * --> p1 text * <-- p2 text * * FORM POPUP_DISPLAY. *variables DATA : L_POS(1) TYPE N VALUE 1. " Field pos * Fieldcatalog for popup DATA : IT_FIELDCAT_POP TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE. CLEAR IT_FIELDCAT_POP. REFRESH IT_FIELDCAT_POP. 24

25 SORT IT_IDOCMESS2. * Base Week # IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS IT_FIELDCAT_POP-SELTEXT_M = 'BASEWEEK'. = 'IT_IDOCMESS2'. = L_POS. = 'Base Week# '(030). IT_FIELDCAT_POP-OUTPUTLEN = 10. * IT_FIELDCAT_POP-DDICTXT = 'M'. * IT_FIELDCAT_POP-OUTPUTLEN = 50. * IT_FIELDCAT_POP-NO_ZERO APPEND IT_FIELDCAT_POP. CLEAR IT_FIELDCAT_POP. L_POS = L_POS + 1. * Message # IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS IT_FIELDCAT_POP-SELTEXT_M = 'MESSAGE'. = 'IT_IDOCMESS2'. = L_POS. = 'Message# '(030). IT_FIELDCAT_POP-OUTPUTLEN = 10. * IT_FIELDCAT_POP-DDICTXT = 'M'. * IT_FIELDCAT_POP-OUTPUTLEN = 50. * IT_FIELDCAT_POP-NO_ZERO APPEND IT_FIELDCAT_POP. CLEAR IT_FIELDCAT_POP. 25

26 L_POS = L_POS + 1. * Errors # IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS IT_FIELDCAT_POP-SELTEXT_M = 'ERROR'. = 'IT_IDOCMESS2'. = L_POS. = 'Errors# '(030). IT_FIELDCAT_POP-OUTPUTLEN = 7. * IT_FIELDCAT_POP-DDICTXT = 'M'. * IT_FIELDCAT_POP-OUTPUTLEN = 50. * IT_FIELDCAT_POP-NO_ZERO APPEND IT_FIELDCAT_POP. CLEAR IT_FIELDCAT_POP. L_POS = L_POS + 1. * Text # IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS IT_FIELDCAT_POP-SELTEXT_M = 'TEXT'. = 'IT_IDOCMESS2'. = L_POS. = 'Text Display# '(030). IT_FIELDCAT_POP-OUTPUTLEN = 50. * IT_FIELDCAT_POP-DDICTXT = 'M'. * IT_FIELDCAT_POP-OUTPUTLEN = 50. * IT_FIELDCAT_POP-NO_ZERO APPEND IT_FIELDCAT_POP. 26

27 CLEAR IT_FIELDCAT_POP. L_POS = L_POS + 1. *The code is added from here * Number of Erros # * IT_FIELDCAT_POP-FIELDNAME = 'WK1'. * IT_FIELDCAT_POP-TABNAME = 'IT_IDOCMESS2'. * IT_FIELDCAT_POP-COL_POS = L_POS. * IT_FIELDCAT_POP-SELTEXT_M = 'Number Of Errors#'(032). * IT_FIELDCAT_POP-DDICTXT = 'M'. * IT_FIELDCAT_POP-OUTPUTLEN = 20. ** IT_FIELDCAT_POP-FIX_COLUMN * IT_FIELDCAT_POP-EMPHASIZE = 'C600'. * IT_FIELDCAT_POP-DATATYPE = 'INT4'. * IT_FIELDCAT_POP-INTTYPE = 'I'. * IT_FIELDCAT_POP-INTLEN = '8'. * IT_FIELDCAT_POP-NO_ZERO * IT_FIELDCAT_POP-DO_SUM * APPEND IT_FIELDCAT_POP. * CLEAR IT_FIELDCAT_POP. * L_POS = L_POS + 1. IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS = 'WK1'. = 'IT_IDOCMESS2'. = L_POS. 27

28 IT_FIELDCAT_POP-SELTEXT_M IT_FIELDCAT_POP-DDICTXT = 'Wk1'(004). = 'M'. IT_FIELDCAT_POP-OUTPUTLEN = 8. IT_FIELDCAT_POP-EMPHASIZE IT_FIELDCAT_POP-DATATYPE IT_FIELDCAT_POP-INTTYPE IT_FIELDCAT_POP-INTLEN IT_FIELDCAT_POP-FIX_COLUMN IT_FIELDCAT_POP-NO_ZERO IT_FIELDCAT_POP-DO_SUM = 'C600'. = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_POP. CLEAR IT_FIELDCAT_POP. L_POS = L_POS + 1. IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS IT_FIELDCAT_POP-SELTEXT_M IT_FIELDCAT_POP-DDICTXT = 'WK2'. = 'IT_IDOCMESS2'. = L_POS. = 'Wk2'(004). = 'M'. IT_FIELDCAT_POP-OUTPUTLEN = 8. IT_FIELDCAT_POP-FIX_COLUMN IT_FIELDCAT_POP-EMPHASIZE IT_FIELDCAT_POP-DATATYPE IT_FIELDCAT_POP-INTTYPE IT_FIELDCAT_POP-INTLEN IT_FIELDCAT_POP-NO_ZERO IT_FIELDCAT_POP-DO_SUM = 'C600'. = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_POP. 28

29 CLEAR IT_FIELDCAT_POP. L_POS = L_POS + 1. IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS IT_FIELDCAT_POP-SELTEXT_M IT_FIELDCAT_POP-DDICTXT = 'WK3'. = 'IT_IDOCMESS2'. = L_POS. = 'Wk3'(005). = 'M'. IT_FIELDCAT_POP-OUTPUTLEN = 8. IT_FIELDCAT_POP-FIX_COLUMN IT_FIELDCAT_POP-EMPHASIZE IT_FIELDCAT_POP-DATATYPE IT_FIELDCAT_POP-INTTYPE IT_FIELDCAT_POP-INTLEN IT_FIELDCAT_POP-NO_ZERO IT_FIELDCAT_POP-DO_SUM = 'C600'. = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_POP. CLEAR IT_FIELDCAT_POP. L_POS = L_POS + 1. IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS IT_FIELDCAT_POP-SELTEXT_M IT_FIELDCAT_POP-DDICTXT = 'WK4'. = 'IT_IDOCMESS2'. = L_POS. = 'Wk4'(006). = 'M'. IT_FIELDCAT_POP-OUTPUTLEN = 8. IT_FIELDCAT_POP-FIX_COLUMN IT_FIELDCAT_POP-EMPHASIZE = 'C600'. 29

30 IT_FIELDCAT_POP-DATATYPE IT_FIELDCAT_POP-INTTYPE IT_FIELDCAT_POP-INTLEN IT_FIELDCAT_POP-NO_ZERO IT_FIELDCAT_POP-DO_SUM = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_POP. CLEAR IT_FIELDCAT_POP. L_POS = L_POS + 1. IT_FIELDCAT_POP-FIELDNAME IT_FIELDCAT_POP-TABNAME IT_FIELDCAT_POP-COL_POS IT_FIELDCAT_POP-SELTEXT_M IT_FIELDCAT_POP-DDICTXT = 'WK5'. = 'IT_IDOCMESS2'. = L_POS. = 'Wk5'(005). = 'M'. IT_FIELDCAT_POP-OUTPUTLEN = 8. IT_FIELDCAT_POP-FIX_COLUMN IT_FIELDCAT_POP-EMPHASIZE IT_FIELDCAT_POP-DATATYPE IT_FIELDCAT_POP-INTTYPE IT_FIELDCAT_POP-INTLEN IT_FIELDCAT_POP-NO_ZERO IT_FIELDCAT_POP-DO_SUM = 'C600'. = 'INT4'. = 'I'. = '8'. APPEND IT_FIELDCAT_POP. CLEAR IT_FIELDCAT_POP. L_POS = L_POS

31 CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT' EXPORTING I_TITLE = 'Errors For the Perticular Message'(050) * I_SELECTION = 'X' * I_ZEBRA = ' ' I_SCREEN_START_COLUMN = 1 I_SCREEN_START_LINE = 1 I_SCREEN_END_COLUMN = 100 I_SCREEN_END_LINE = 70 * I_CHECKBOX_FIELDNAME = * I_LINEMARK_FIELDNAME = * I_SCROLL_TO_SEL_LINE = 'X' I_TABNAME = 'IT_IDOCMESS2' * I_STRUCTURE_NAME = IT_FIELDCAT = IT_FIELDCAT_POP[] * IT_EXCLUDING = * I_CALLBACK_PROGRAM = * I_CALLBACK_USER_COMMAND = * IS_PRIVATE = * IMPORTING * ES_SELFIELD = * E_EXIT = TABLES T_OUTTAB = IT_IDOCMESS2 EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2. 31

32 IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. REFRESH IT_FIELDCAT_POP. CLEAR IT_FIELDCAT_POP. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDFORM. " IT_POPUP_DISPLAY *& * *& Form USER_COMMAND *& * * Processing User command * * * -->P_UCOMM Screens, function code triggered by PAI * -->P_SELFIELD information cursor position ALV * * FORM USER_COMMAND USING P_UCOMM LIKE SY-UCOMM P_SELFIELD TYPE SLIS_SELFIELD. CASE P_UCOMM. WHEN 'DISPLAY'. * P_SELFIELD-REFRESH PERFORM ERROR_LIST1. 32

33 PERFORM POPUP_DISPLAY. ENDCASE. ENDFORM. " USER_COMMAND *& * *& Form ERROR_LIST *& * * text: This subroutine displayes the errors of baseweek * * * --> p1 text * <-- p2 text * * FORM ERROR_LIST. DATA: BEGIN OF IT_IDOC_STATUS OCCURS 0. INCLUDE STRUCTURE EDIDS. DATA: END OF IT_IDOC_STATUS. DATA: IT_IDOCMESS_TEMP LIKE IT_IDOCMESS OCCURS 0 WITH HEADER LINE, V_DATE LIKE SY-DATUM. DATA: ERROR_COUNT TYPE I. CLEAR: V_MESSAGE, V_ERROR. LOOP AT IT_OUTPUT WHERE CHK CLEAR IT_IDOCMESS. REFRESH IT_IDOCMESS. 33

34 IT_DATE-LOW = IT_OUTPUT-BASEWEEK - 7. IT_DATE-HIGH = IT_OUTPUT-BASEWEEK - 1. SELECT STATUS MESTYP DOCNUM FROM EDIDC INTO TABLE IT_DOCNUM WHERE MESTYP = IT_OUTPUT-MESSAGE AND STATUS = IT_OUTPUT-ERROR AND CREDAT BETWEEN IT_DATE-LOW AND IT_DATE-HIGH. ERROR_COUNT = 1. LOOP AT IT_DOCNUM. *REFRESH IT_IDOC_STATUS. CLEAR IT_IDOC_STATUS. SELECT * FROM EDIDS INTO TABLE IT_IDOC_STATUS WHERE DOCNUM = IT_DOCNUM-DOCNUM AND STATUS = IT_DOCNUM-STATUS. * Get most recent status record SORT IT_IDOC_STATUS DESCENDING BY LOGDAT LOGTIM COUNTR. READ TABLE IT_IDOC_STATUS INDEX 2. IF SY-SUBRC <> 0 OR IT_IDOC_STATUS-STATXT = ''. READ TABLE IT_IDOC_STATUS INDEX 1. READ TABLE IT_IDOCMESS WITH KEY TEXT = IT_IDOC_STATUS-STATXT. 34

35 IF SY-SUBRC EQ 0. IT_IDOCMESS1-ERROR = IT_IDOCMESS-ERROR + 1. MODIFY IT_IDOCMESS1 TRANSPORTING ERROR WHERE TEXT = IT_IDOC_STATUS-STATXT. CONTINUE. ELSE. IT_IDOCMESS1-TEXT = IT_IDOC_STATUS-STATXT. IT_IDOCMESS1-ERROR = 1. APPEND IT_IDOCMESS1. CLEAR IT_IDOCMESS1. CLEAR IT_DOCNUM. ENDLOOP. SORT IT_IDOCMESS1 BY TEXT. LOOP AT IT_IDOCMESS1 WHERE TEXT EQ SPACE. SELECT SINGLE DESCRP FROM TEDS2 INTO TEDS2-DESCRP WHERE STATUS = V_ERROR AND LANGUA = 'EN'. IT_IDOCMESS1-TEXT = TEDS2-DESCRP. MODIFY IT_IDOCMESS1 INDEX SY-TABIX. ENDLOOP. LOOP AT IT_IDOCMESS1. WRITE:/5 IT_IDOCMESS1-TEXT, 80 IT_IDOCMESS1-ERROR. 35

36 * ENDLOOP. ENDLOOP. ENDFORM. " ERROR_LIST *& * *& Form UPDATE_DATABASE_TABLES *& * * text : This perform commits the database inserts * * * --> p1 text * <-- p2 text * * FORM UPDATE_DATABASE_TABLES. *********************************************************************** * Declaration of LOCAL Variables *********************************************************************** DATA: L_REPID LIKE SY-REPID, " Program Name. L_TIME LIKE SY-UZEIT, " Program Execution Time L_DATE LIKE SY-DATUM, " Program Execution Date. L_PRGID LIKE FRUN-PRGID."ABAP program name *_ assigning the report name, executed date and executed time to local *variables, which are used to insert in frun table L_REPID = SY-REPID. 36

37 L_DATE = SY-DATUM. L_TIME = SY-UZEIT. * Insert or Update FRUN record that was populated earlier MODIFY FRUN. * The insertion takes place only once for a day. * SELECT PRGID * INTO L_PRGID * FROM FRUN * WHERE PRGID = L_REPID AND LDATU = L_DATE. * * IF SY-SUBRC <> 0. * DELETE FROM ZIDOC WHERE SNO > 0. CLEAR V_SNO. SELECT COUNT( * ) FROM ZIDOC INTO V_SNO. LOOP AT IT_OUTPUT. IF IT_OUTPUT-WK1 <> 0. V_SNO = V_SNO + 1. MOVE IT_OUTPUT-BASEWEEK TO ZIDOC-BASEWEEK. MOVE IT_OUTPUT-ERROR TO ZIDOC-ERROR. MOVE IT_OUTPUT-MESSAGE TO ZIDOC-MESSAGE. MOVE V_SNO TO ZIDOC-SNO. MOVE IT_OUTPUT-WK1 TO ZIDOC-NO_OF_ERR. MOVE 'WK1' TO ZIDOC-WEEK. INSERT INTO ZIDOC VALUES ZIDOC. CLEAR ZIDOC. 37

38 IF IT_OUTPUT-WK2 <> 0. MOVE IT_OUTPUT-BASEWEEK TO ZIDOC-BASEWEEK. MOVE IT_OUTPUT-ERROR TO ZIDOC-ERROR. MOVE IT_OUTPUT-MESSAGE TO ZIDOC-MESSAGE. V_SNO = V_SNO + 1. MOVE V_SNO TO ZIDOC-SNO. MOVE IT_OUTPUT-WK2 TO ZIDOC-NO_OF_ERR. MOVE 'WK2' TO ZIDOC-WEEK. INSERT INTO ZIDOC VALUES ZIDOC. CLEAR ZIDOC. IF IT_OUTPUT-WK3 <> 0. MOVE IT_OUTPUT-BASEWEEK TO ZIDOC-BASEWEEK. MOVE IT_OUTPUT-ERROR TO ZIDOC-ERROR. MOVE IT_OUTPUT-MESSAGE TO ZIDOC-MESSAGE. V_SNO = V_SNO + 1. MOVE V_SNO TO ZIDOC-SNO. MOVE IT_OUTPUT-WK3 TO ZIDOC-NO_OF_ERR. MOVE 'WK3' TO ZIDOC-WEEK. INSERT INTO ZIDOC VALUES ZIDOC. CLEAR ZIDOC. 38

39 IF IT_OUTPUT-WK4 <> 0. MOVE IT_OUTPUT-BASEWEEK TO ZIDOC-BASEWEEK. MOVE IT_OUTPUT-ERROR TO ZIDOC-ERROR. MOVE IT_OUTPUT-MESSAGE TO ZIDOC-MESSAGE. V_SNO = V_SNO + 1. MOVE V_SNO TO ZIDOC-SNO. MOVE IT_OUTPUT-WK4 TO ZIDOC-NO_OF_ERR. MOVE 'WK4' TO ZIDOC-WEEK. INSERT INTO ZIDOC VALUES ZIDOC. CLEAR ZIDOC. IF IT_OUTPUT-WK5 <> 0. MOVE IT_OUTPUT-BASEWEEK TO ZIDOC-BASEWEEK. MOVE IT_OUTPUT-ERROR TO ZIDOC-ERROR. MOVE IT_OUTPUT-MESSAGE TO ZIDOC-MESSAGE. V_SNO = V_SNO + 1. MOVE V_SNO TO ZIDOC-SNO. MOVE IT_OUTPUT-WK5 TO ZIDOC-NO_OF_ERR. MOVE 'WK5' TO ZIDOC-WEEK. INSERT INTO ZIDOC VALUES ZIDOC. CLEAR ZIDOC. 39

40 * INSERT INTO ZIDOC VALUES ZIDOC. ENDLOOP. * ELSE. * MESSAGE S001 WITH 'Extraction Program is already excuted for this day' *. * * ENDSELECT. ENDFORM. " UPDATE_DATABASE_TABLES * * * FORM UPDATE_LAST_RUN_TIME * * * * Update last run date and time for the report * * * FORM UPDATE_LAST_RUN_TIME. *********************************************************************** * Declaration of LOCAL Variables *********************************************************************** DATA: L_REPID LIKE SY-REPID, " Program Name. L_TIME LIKE SY-UZEIT, " Program Execution Time L_DATE LIKE SY-DATUM, " Program Execution Date. L_PRGID LIKE FRUN-PRGID."ABAP program name 40

41 *_ assigning the report name, executed date and executed time to local *variables, which are used to insert in frun table L_REPID = SY-REPID. L_DATE = SY-DATUM. L_TIME = SY-UZEIT. SELECT SINGLE PRGID INTO L_PRGID FROM FRUN WHERE PRGID = L_REPID. MOVE:L_REPID TO FRUN-PRGID, L_DATE TO FRUN-LDATU, L_TIME TO FRUN-LZEIT. * FRUN is updated during commit work later in the program ENDFORM. *& * *& Form PREVIOUS_WEEK *& * * text * * * -->P_BASEWEEK text * * FORM PREVIOUS_WEEK. * USING P_BASEWEEK P_MESSAGE P_ERROR. 41

42 DATA: V_LINES TYPE I. CLEAR V_LINES. SELECT * INTO TABLE IT_ZIDOC FROM ZIDOC. * WHERE * BASEWEEK = P_BASEWEEK. * AND * MESSAGE = P_MESSAGE AND * ERROR = P_ERROR. IF SY-SUBRC = 0. CLEAR V_TABIX. LOOP AT IT_OUTPUT. V_TABIX = SY-TABIX. READ TABLE IT_ZIDOC WITH KEY BASEWEEK = IT_OUTPUT-BASEWEEK. IF SY-SUBRC = 0. LOOP AT IT_ZIDOC WHERE BASEWEEK = IT_OUTPUT-BASEWEEK AND MESSAGE = IT_OUTPUT-MESSAGE AND ERROR = IT_OUTPUT-ERROR. CASE IT_ZIDOC-WEEK. WHEN 'WK1'. IT_OUTPUT-WK1 = IT_ZIDOC-NO_OF_ERR. MODIFY IT_OUTPUT INDEX V_TABIX TRANSPORTING WK1. WHEN 'WK2'. IT_OUTPUT-WK2 = IT_ZIDOC-NO_OF_ERR. MODIFY IT_OUTPUT INDEX V_TABIX TRANSPORTING WK2. WHEN 'WK3'. 42

43 IT_OUTPUT-WK3 = IT_ZIDOC-NO_OF_ERR. MODIFY IT_OUTPUT INDEX V_TABIX TRANSPORTING WK3. WHEN 'WK4'. IT_OUTPUT-WK4 = IT_ZIDOC-NO_OF_ERR. MODIFY IT_OUTPUT INDEX V_TABIX TRANSPORTING WK4. WHEN 'WK5'. IT_OUTPUT-WK5 = IT_ZIDOC-NO_OF_ERR. MODIFY IT_OUTPUT INDEX V_TABIX TRANSPORTING WK5. ENDCASE. ENDLOOP. ELSE. IT_OUTPUT-MESSAGE = IT_ZIDOC-MESSAGE. IT_OUTPUT-ERROR = IT_ZIDOC-ERROR. IT_OUTPUT-BASEWEEK = IT_ZIDOC-BASEWEEK. CASE IT_ZIDOC-WEEK. WHEN 'WK1'. IT_OUTPUT-WK1 = IT_ZIDOC-NO_OF_ERR. WHEN 'WK2'. IT_OUTPUT-WK2 = IT_ZIDOC-NO_OF_ERR. WHEN 'WK3'. IT_OUTPUT-WK3 = IT_ZIDOC-NO_OF_ERR. WHEN 'WK4'. IT_OUTPUT-WK4 = IT_ZIDOC-NO_OF_ERR. 43

44 WHEN 'WK5'. IT_OUTPUT-WK5 = IT_ZIDOC-NO_OF_ERR. ENDCASE. APPEND IT_OUTPUT. CLEAR IT_OUTPUT. * MODIFY IT_OUTPUT INDEX V_TABIX TRANSPORTING WK1 WK2 WK3 WK4 WK5. CLEAR V_TABIX. ENDLOOP. * ELSE. * APPEND IT_OUTPUT. * CLEAR IT_OUTPUT. ENDFORM. " PREVIOUS_WEEK *& * *& Form GET_DATA_DETAIL_LIST *& * * text * * * --> p1 text * <-- p2 text * * FORM GET_DATA_DETAIL_LIST. 44

45 DATA: BEGIN OF IT_IDOC_STATUS OCCURS 0. INCLUDE STRUCTURE EDIDS. DATA: END OF IT_IDOC_STATUS. DATA: IT_IDOCMESS_TEMP LIKE IT_IDOCMESS OCCURS 0 WITH HEADER LINE, V_DATE LIKE SY-DATUM. DATA: ERROR_COUNT TYPE I. CLEAR: V_MESSAGE, V_ERROR. DATA: V_SNO TYPE I, V_VAR1(3) TYPE C. CLEAR V_SNO. LOOP AT IT_OUTPUT. CLEAR IT_IDOCMESS. * REFRESH IT_IDOCMESS. * IT_DATE-LOW = IT_OUTPUT-BASEWEEK - 7. IT_DATE-HIGH = IT_OUTPUT-BASEWEEK - 1. SELECT STATUS MESTYP DOCNUM FROM EDIDC INTO TABLE IT_DOCNUM WHERE MESTYP = IT_OUTPUT-MESSAGE AND STATUS = IT_OUTPUT-ERROR AND CREDAT BETWEEN IT_DATE-LOW AND IT_DATE-HIGH. ERROR_COUNT = 1. 45

46 LOOP AT IT_DOCNUM. *REFRESH IT_IDOC_STATUS. CLEAR IT_IDOC_STATUS. SELECT * FROM EDIDS INTO TABLE IT_IDOC_STATUS WHERE DOCNUM = IT_DOCNUM-DOCNUM AND STATUS = IT_DOCNUM-STATUS. * Get most recent status record SORT IT_IDOC_STATUS DESCENDING BY LOGDAT LOGTIM COUNTR. READ TABLE IT_IDOC_STATUS INDEX 2. IF SY-SUBRC <> 0 OR IT_IDOC_STATUS-STATXT = ''. READ TABLE IT_IDOC_STATUS INDEX 1. IF IT_OUTPUT-WK5 <> 0. V_VAR1 = 'WK5'. IF IT_OUTPUT-WK4 <> 0. V_VAR1 = 'WK4'. IF IT_OUTPUT-WK3 <> 0. V_VAR1 = 'WK3'. IF IT_OUTPUT-WK2 <> 0. V_VAR1 = 'WK2'. IF IT_OUTPUT-WK1 <> 0. V_VAR1 = 'WK1'. 46

47 READ TABLE IT_IDOCMESS WITH KEY TEXT = IT_IDOC_STATUS-STATXT BASEWEEK = IT_OUTPUT-BASEWEEK MESSAGE = IT_OUTPUT-MESSAGE ERROR = IT_OUTPUT-ERROR. IF SY-SUBRC EQ 0. IT_IDOCMESS-NO_OF_ERR = IT_IDOCMESS-NO_OF_ERR + 1. MODIFY IT_IDOCMESS TRANSPORTING NO_OF_ERR WHERE TEXT = IT_IDOC_STATUS-STATXT AND BASEWEEK = IT_OUTPUT-BASEWEEK AND MESSAGE = IT_OUTPUT-MESSAGE AND ERROR = IT_OUTPUT-ERROR. CONTINUE. ELSE. IT_IDOCMESS-BASEWEEK = IT_OUTPUT-BASEWEEK. IT_IDOCMESS-MESSAGE = IT_OUTPUT-MESSAGE. IT_IDOCMESS-ERROR = IT_OUTPUT-ERROR. IT_IDOCMESS-TEXT = IT_IDOC_STATUS-STATXT. IT_IDOCMESS-NO_OF_ERR = 1. IT_IDOCMESS-WEEK = V_VAR1. IT_IDOCMESS-SNO = V_SNO + 1. V_SNO = V_SNO + 1. APPEND IT_IDOCMESS. CLEAR IT_IDOCMESS. CLEAR IT_DOCNUM. 47

48 ENDLOOP. * LOOP AT IT_IDOCMESS. * WRITE:/5 IT_IDOCMESS-TEXT, 80 IT_IDOCMESS-ERROR. * ENDLOOP. ENDLOOP. SORT IT_IDOCMESS BY TEXT. LOOP AT IT_IDOCMESS WHERE TEXT EQ SPACE OR TEXT EQ '&'. SELECT SINGLE DESCRP FROM TEDS2 INTO TEDS2-DESCRP WHERE STATUS = V_ERROR AND LANGUA = 'EN'. IT_IDOCMESS-TEXT = TEDS2-DESCRP. MODIFY IT_IDOCMESS INDEX SY-TABIX. ENDLOOP. PERFORM UPDATE_ZIPOPUP. ENDFORM. " GET_DATA_DETAIL_LIST *& * *& Form UPDATE_ZIPOPUP *& * 48

49 * text * * * --> p1 text * <-- p2 text * * FORM UPDATE_ZIPOPUP. DATA: IT_ZIPOPUP LIKE ZIPOPUP OCCURS 0 WITH HEADER LINE. CLEAR V_SNO. SORT IT_IDOCMESS BY BASEWEEK. SELECT COUNT(*) FROM ZIPOPUP INTO V_SNO. LOOP AT IT_IDOCMESS. V_SNO = V_SNO + 1. MOVE V_SNO TO IT_ZIPOPUP-SNO. MOVE IT_IDOCMESS-BASEWEEK TO IT_ZIPOPUP-BASEWEEK. MOVE IT_IDOCMESS-MESSAGE TO IT_ZIPOPUP-MESSAGE. MOVE IT_IDOCMESS-ERROR TO IT_ZIPOPUP-ERROR. MOVE IT_IDOCMESS-TEXT TO IT_ZIPOPUP-TEXT. MOVE IT_IDOCMESS-NO_OF_ERR TO IT_ZIPOPUP-NO_OF_ERR. MOVE IT_IDOCMESS-WEEK TO IT_ZIPOPUP-WEEK. APPEND IT_ZIPOPUP. CLEAR IT_ZIPOPUP. ENDLOOP. INSERT ZIPOPUP FROM TABLE IT_ZIPOPUP. 49

50 ENDFORM. " UPDATE_ZIPOPUP *& * *& Form ERROR_LIST *& * * text: This subroutine displayes the errors of baseweek * * * --> p1 text * <-- p2 text * * FORM ERROR_LIST1. DATA: BEGIN OF IT_IDOC_STATUS OCCURS 0. INCLUDE STRUCTURE EDIDS. DATA: END OF IT_IDOC_STATUS. DATA: IT_IDOCMESS_TEMP LIKE IT_IDOCMESS OCCURS 0 WITH HEADER LINE, V_DATE LIKE SY-DATUM. DATA: ERROR_COUNT TYPE I. CLEAR: V_MESSAGE, V_ERROR. REFRESH IT_IDOCMESS1. READ TABLE IT_OUTPUT WITH KEY CHK 50

51 IF SY-SUBRC <> 0. MESSAGE W003. LOOP AT IT_OUTPUT WHERE CHK SELECT SNO BASEWEEK MESSAGE ERROR TEXT NO_OF_ERR WEEK APPENDING TABLE IT_IDOCMESS1 FROM ZIPOPUP WHERE BASEWEEK = IT_OUTPUT-BASEWEEK AND MESSAGE = IT_OUTPUT-MESSAGE AND ERROR = IT_OUTPUT-ERROR. SORT IT_IDOCMESS1 BY BASEWEEK MESSAGE ERROR. LOOP AT IT_IDOCMESS1 WHERE TEXT EQ SPACE. SELECT SINGLE DESCRP FROM TEDS2 INTO TEDS2-DESCRP WHERE STATUS = V_ERROR AND LANGUA = 'EN'. IT_IDOCMESS1-TEXT = TEDS2-DESCRP. 51

52 MODIFY IT_IDOCMESS1 INDEX SY-TABIX. ENDLOOP. LOOP AT IT_IDOCMESS. WRITE:/5 IT_IDOCMESS-TEXT, 80 IT_IDOCMESS-ERROR. ENDLOOP. ENDLOOP. *// Here the code CLEAR IT_IDOCMESS2. REFRESH IT_IDOCMESS2. LOOP AT IT_IDOCMESS1. CLEAR V_TABIX. V_TABIX = SY-TABIX. MOVE: IT_IDOCMESS1-BASEWEEK TO IT_IDOCMESS2-BASEWEEK, IT_IDOCMESS1-MESSAGE TO IT_IDOCMESS2-MESSAGE, IT_IDOCMESS1-ERROR TO IT_IDOCMESS2-ERROR, IT_IDOCMESS1-TEXT TO IT_IDOCMESS2-TEXT. READ TABLE IT_IDOCMESS2 WITH KEY BASEWEEK = IT_IDOCMESS1-BASEWEEK MESSAGE = IT_IDOCMESS1-MESSAGE ERROR = IT_IDOCMESS1-ERROR TEXT = IT_IDOCMESS1-TEXT. IF SY-SUBRC = 0. 52

53 CASE IT_IDOCMESS1-WEEK. WHEN 'WK1'. IT_IDOCMESS2-WK1 = IT_IDOCMESS1-NO_OF_ERR. MODIFY IT_IDOCMESS2 TRANSPORTING WK1 WHERE BASEWEEK = IT_IDOCMESS1-BASEWEEK AND MESSAGE = IT_IDOCMESS1-MESSAGE AND ERROR = IT_IDOCMESS1-ERROR AND TEXT = IT_IDOCMESS1-TEXT. WHEN 'WK2'. IT_IDOCMESS2-WK2 = IT_IDOCMESS1-NO_OF_ERR. MODIFY IT_IDOCMESS2 TRANSPORTING WK2 WHERE BASEWEEK = IT_IDOCMESS1-BASEWEEK AND MESSAGE = IT_IDOCMESS1-MESSAGE AND ERROR = IT_IDOCMESS1-ERROR AND TEXT = IT_IDOCMESS1-TEXT. WHEN 'WK3'. IT_IDOCMESS2-WK3 = IT_IDOCMESS1-NO_OF_ERR. MODIFY IT_IDOCMESS2 TRANSPORTING WK3 WHERE BASEWEEK = IT_IDOCMESS1-BASEWEEK AND MESSAGE = IT_IDOCMESS1-MESSAGE AND ERROR = IT_IDOCMESS1-ERROR AND TEXT = IT_IDOCMESS1-TEXT. WHEN 'WK4'. 53

54 IT_IDOCMESS2-WK4 = IT_IDOCMESS1-NO_OF_ERR. MODIFY IT_IDOCMESS2 TRANSPORTING WK4 WHERE BASEWEEK = IT_IDOCMESS1-BASEWEEK AND MESSAGE = IT_IDOCMESS1-MESSAGE AND ERROR = IT_IDOCMESS1-ERROR AND TEXT = IT_IDOCMESS1-TEXT. WHEN 'WK5'. IT_IDOCMESS2-WK5 = IT_IDOCMESS1-NO_OF_ERR. MODIFY IT_IDOCMESS2 TRANSPORTING WK5 WHERE BASEWEEK = IT_IDOCMESS1-BASEWEEK AND MESSAGE = IT_IDOCMESS1-MESSAGE AND ERROR = IT_IDOCMESS1-ERROR AND TEXT = IT_IDOCMESS1-TEXT. ENDCASE. ELSE. CASE IT_IDOCMESS1-WEEK. WHEN 'WK1'. IT_IDOCMESS2-WK1 = IT_IDOCMESS1-NO_OF_ERR. WHEN 'WK2'. IT_IDOCMESS2-WK2 = IT_IDOCMESS1-NO_OF_ERR. WHEN 'WK3'. IT_IDOCMESS2-WK3 = IT_IDOCMESS1-NO_OF_ERR. 54

55 WHEN 'WK4'. IT_IDOCMESS2-WK4 = IT_IDOCMESS1-NO_OF_ERR. WHEN 'WK5'. IT_IDOCMESS2-WK5 = IT_IDOCMESS1-NO_OF_ERR. ENDCASE. APPEND IT_IDOCMESS2. CLEAR IT_IDOCMESS2. ENDLOOP. CLEAR V_TABIX. SORT IT_IDOCMESS2 BY BASEWEEK MESSAGE ERROR. LOOP AT IT_IDOCMESS2. V_TABIX = SY-TABIX. V_TABIX = V_TABIX + 1. READ TABLE IT_IDOCMESS2 INTO IT_IDOCMESS2_TEMP INDEX V_TABIX. 55

56 IF IT_IDOCMESS2-BASEWEEK = IT_IDOCMESS2_TEMP-BASEWEEK. IT_IDOCMESS-BASEWEEK = ''. CLEAR IT_IDOCMESS2-BASEWEEK. MODIFY IT_IDOCMESS2 INDEX V_TABIX TRANSPORTING BASEWEEK. ENDLOOP. ENDFORM. " ERROR_LIST This is a sample of a hyper link in a document. Author Bio Mr. Suresh Revuru is an SAP System Analyst working for INTELLIGROUP INC., for more than 3 years. Disclaimer & Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document. 56

A Simple search program for Dictionary objects

A Simple search program for Dictionary objects A Simple search program for Dictionary objects Applies To: ABAP Programming Article Summary This Code sample is a simple search utility for the dictionary objects. This has three kinds of search functionality

More information

SAP BW - PSA/Change Log Deletion Governance

SAP BW - PSA/Change Log Deletion Governance SAP BW - PSA/Change Log Deletion Governance Applies to: SAP Net Weaver 2004s BI 7.0 Ehp1 SP 05. For more information, visit EDW homepage Summary This article suggests importance of PSA/Change log deletion

More information

Program to Find Where used List of a Query for Web Template (3.5), Work Books and RRI

Program to Find Where used List of a Query for Web Template (3.5), Work Books and RRI Program to Find Where used List of a Query for Web Template (3.5), Work Books and RRI Applies to: SAP BW (3.5) / SAP BI(7.0) For more information, visit Business Intelligence Homepage. Summary This article

More information

REPORT z_tablestcode. *ALV type pools declarations. TYPE-POOLS : slis. *Internal table and work area declarations for dd02l / dd02t /tstc

REPORT z_tablestcode. *ALV type pools declarations. TYPE-POOLS : slis. *Internal table and work area declarations for dd02l / dd02t /tstc *& Report ZALV_TABLESTCODE * *& Author Swarna.S. *& AS : ALV report to display the dictionary objects *& (tables/structures/views of all types of delivery classes) *& used by a TRANSACTION.The ALV is made

More information

ABAP Code Sample to Attach F1 and F4 Help Fields in ALV Grid

ABAP Code Sample to Attach F1 and F4 Help Fields in ALV Grid ABAP Code Sample to Attach F1 and F4 Help Fields in ALV Grid Code samples are intended for educational use only, not deployment They are untested and unsupported by SAP SAP disclaims all liability to any

More information

Triggering the Process Chains at Particular Date using Events

Triggering the Process Chains at Particular Date using Events Triggering the Process Chains at Particular Date using Events Applies to: SAP BW 3.5, Will also work on SAP BI 7 For more information, visit the Business Intelligence homepage Summary This document discusses

More information

Applies To:...1. Summary...1. Table of Contents...1. Procedure..2. Code... Error! Bookmark not defined.0

Applies To:...1. Summary...1. Table of Contents...1. Procedure..2. Code... Error! Bookmark not defined.0 Applies To: Usage of Table Control in ABAP Summary Normally we use wizard if we are working with table control. This document helps us how to create a table control without using a wizard and how to manipulate

More information

SAP COMMUNITY NETWORK

SAP COMMUNITY NETWORK SAP How-To Guide for MDG-F ALE Replication using the same Client Applies to Master Data Governance for Financials (MDG-F) with release versions 7.0 and newer. For more information, visit the Master Data

More information

SDN Community Contribution

SDN Community Contribution SDN Community Contribution (This is not an official SAP document.) Disclaimer & Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces

More information

ZIBASIS_U_ROLES_CREATE

ZIBASIS_U_ROLES_CREATE *& Report ZBASIS_U_ROLES_CREATE * PROGRAM TITLE : Derive Role Creation * MODULE : BASIS * PROGRAM TYPE : Conversion Program(BAPI) * INPUT : Selection Screen/Excel Upload * OUTPUT : Alv Success/Error Report

More information

ABAP Code Sample to Display Data in ALV Grid Using Object-Oriented Programming

ABAP Code Sample to Display Data in ALV Grid Using Object-Oriented Programming ABAP Code Sample to Display Data in ALV Grid Using Object-Oriented Programming Code samples are intended for educational use only, not deployment. They are untested and unsupported by SAP. SAP disclaims

More information

SDN Community Contribution

SDN Community Contribution SDN Community Contribution (This is not an official SAP document.) Disclaimer & Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces

More information

SAP BW Copy Existing DTP for Data Targets

SAP BW Copy Existing DTP for Data Targets SAP BW Copy Existing DTP for Data Targets Applies to: SAP BI Consultants with ABAP Knowledge. For more information, visit the EDW HomePage. Summary Copy existing DTP to a new one in not possible in SAP

More information

Step by Step Guide to Enhance a Data Source

Step by Step Guide to Enhance a Data Source Step by Step Guide to Enhance a Data Source Applies to: SAP BI 7.0. For more information, visit the Business Intelligence homepage Summary This article provides a step by step guide to enhance a Standard

More information

To Check the Files/Reports in Application Server and Trigger Mail Alerts

To Check the Files/Reports in Application Server and Trigger Mail Alerts To Check the Files/Reports in Application Server and Trigger Mail Alerts Applies to: SAP BW 3.0b, SAP BW 3.5, Will also work on SAP BI 7 For more information, visit the Business Intelligence homepage Summary

More information

Dynamically Enable / Disable Fields in Table Maintenance Generator

Dynamically Enable / Disable Fields in Table Maintenance Generator Dynamically Enable / Disable Fields in Table Maintenance Generator Applies to: SAP ABAP. For more information, visit the ABAP homepage. Summary This article demonstrates on how to Enable / Disable fields

More information

REPORT zalv_fcat. * Output table T006 structure declaration. TYPES : BEGIN OF ty_t006. INCLUDE STRUCTURE t006. TYPES : END OF ty_t006.

REPORT zalv_fcat. * Output table T006 structure declaration. TYPES : BEGIN OF ty_t006. INCLUDE STRUCTURE t006. TYPES : END OF ty_t006. *& Report ZALV_FCAT * *& Author : Swarna.S *& AS : ALV report which displays the contents of the table T006 *& (as a docking container in the bottom) along with the *& editable ALV which contains the ALV

More information

ABAP Program to Read/Populate Selection Screen Parameters Dynamically

ABAP Program to Read/Populate Selection Screen Parameters Dynamically ABAP Program to Read/Populate Selection Screen Parameters Dynamically Applies to: SAP 4.6c Summary The main purpose of this article is to focus on dynamic read and dynamic population of selection screen

More information

Reporting Duplicate Entries

Reporting Duplicate Entries Applies to: SAP BI 7.0 and above. For more information, visit the Business Intelligence Homepage. Summary It is a common reporting requirement to display duplicate entries based on a characteristic. This

More information

Using Customer Exit Variables in BW/BI Reports: Part - 14

Using Customer Exit Variables in BW/BI Reports: Part - 14 Using Customer Exit Variables in BW/BI Reports: Part - 14 Applies to: SAP NetWeaver Business Warehouse (Formerly BI), Will also work on SAP BI 3.5. EDW homepage. Summary This article gives clear picture

More information

How to Write Inverse Routine with Expert Routine

How to Write Inverse Routine with Expert Routine How to Write Inverse Routine with Expert Routine Applies to: Development and support based on SAP BI 7.0 For more information, visit the Business Intelligence homepage. Summary The article shows the example

More information

Procedure to Trigger Events in Remote System Using an ABAP Program

Procedure to Trigger Events in Remote System Using an ABAP Program Procedure to Trigger Events in Remote System Using an ABAP Program Applies to: SAP BW 3.x, SAP BI 7.x, SAP ECC, APO Systems. Summary This document gives the procedure to trigger events in a Remote System

More information

Function Module to Create Logo

Function Module to Create Logo Applies To: SAP 4.0-4.7 Summary Utilities Function Module to create a Logo on a Custom Control Container. By: Arpit Nigam Company and Title: Hexaware Tech. Ltd., SAP Consultant Date: 26 Sep 2005 Table

More information

Step by Step Guide to Creating a Process Type to Close an Open Request in a Cube in BI 7.0

Step by Step Guide to Creating a Process Type to Close an Open Request in a Cube in BI 7.0 Step by Step Guide to Creating a Process Type to Close an Open Request in a Cube in BI 7.0 Applies to: SAP BI 7.0. For more information, visit the Business Intelligence homepage. Summary You want to create

More information

How to Copy Test Data Set from One Function Module to Another (Comes Handy While Renaming Functions)

How to Copy Test Data Set from One Function Module to Another (Comes Handy While Renaming Functions) SDN Contribution How to Copy Test Data Set from One Function Module to Another (Comes Handy While Renaming Functions) Applies to: SAP R/3 Release 4.6 onwards (might work for earlier versions as well, but

More information

Creation of Sets in SAP-ABAP, How to Read them INI SAP-ABAP Reports

Creation of Sets in SAP-ABAP, How to Read them INI SAP-ABAP Reports Creation of Sets in SAP-ABAP, How to Read them INI SAP-ABAP Reports Applies to: This Article is intended for all those ABAPers who are interested in creating SAP-SETS and use them in ABAP. For more information,

More information

Selection-Screen Design

Selection-Screen Design Applies To: SAP R/3, ABAP/4 Summary This program illustrates some of the selection-screen design features, simple use of field symbols and the various events associated with a report program. And one good

More information

Using Customer Exit Variables in BW/BI Reports: Part - 4

Using Customer Exit Variables in BW/BI Reports: Part - 4 Using Customer Exit Variables in BW/BI Reports: Part - 4 Applies to: SAP NetWeaver Business Warehouse (Formerly BI), Will also work on SAP BI 3.5. Business Intelligence homepage. Summary This article gives

More information

How to Extend an Outbound IDoc

How to Extend an Outbound IDoc Applies to: Developing and configuring SAP Intermediate Documents (IDocs) for data transfer. Related till version ECC 6.0. For more information, visit the Idoc homepage and the ABAP homepage. Summary This

More information

Custom Process types Remote Trigger and End Time

Custom Process types Remote Trigger and End Time SDN Contribution Custom Process types Remote Trigger and End Time Applies to: SAP BW 3.1C and Above. Summary Development 1: We sometimes have loads in our process chains whose status and runtime don t

More information

Customized Transaction to Trigger Process Chain from Failed Step

Customized Transaction to Trigger Process Chain from Failed Step Customized Transaction to Trigger Process Chain from Failed Step Applies to: SAP BW 3.x & SAP BI NetWeaver 2004s. For more information, visit the Business Intelligence homepage. Summary There are multiple

More information

Easy Application Integration: How to use the Records Management Call Handler Framework

Easy Application Integration: How to use the Records Management Call Handler Framework Easy Application Integration: How to use the Records Management Call Handler Framework Applies to: SAP NetWeaver > 7.0 For more information, visit the Data Management and Integration homepage. Summary

More information

Table Row Popup in Web Dynpro Component

Table Row Popup in Web Dynpro Component Table Row Popup in Web Dynpro Component Applies to Web Dynpro for ABAP, NW 7.0. For more information, visit the Web Dynpro ABAP homepage. Summary This document helps to create Table Rowpopin in a Web Dynpro

More information

How to Attach Documents to Any Custom Program Using Generic Object Services

How to Attach Documents to Any Custom Program Using Generic Object Services SDN Contribution How to Attach Documents to Any Custom Program Using Generic Object Services Applies to: SAP R/3 4.6C Summary This sample code describes the steps needed to easily add file attachment feature

More information

Implementing a BAdI in an Enhancement Project (CMOD)

Implementing a BAdI in an Enhancement Project (CMOD) Applies To: SAP R3 v4.70, however can be adapted for other releases, including Netweaver 2004 v7. Summary This tutorial explains how to implement a Business Add In (BAdI), in a Customer Modification CMOD,

More information

How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP

How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP Applies to: SAP Netweaver 2004S: Web Dynpro for ABAP. For more information, visit the User Interface Technology homepage.

More information

SDN Community Contribution

SDN Community Contribution SDN Community Contribution (This is not an official SAP document.) Disclaimer & Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces

More information

Offsetting Account Description in FBL3N & FAGLL03 GL Line Item Display Reports

Offsetting Account Description in FBL3N & FAGLL03 GL Line Item Display Reports Offsetting Account Description in FBL3N & FAGLL03 GL Line Item Display Reports Applies to: Organizations using SAP which need an additional field to be displayed in FBL3N & FAGLL03 reports. Below configuration

More information

SDN Community Contribution

SDN Community Contribution SDN Community Contribution (This is not an official SAP document.) Disclaimer & Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces

More information

Using Radio Buttons in Web Template

Using Radio Buttons in Web Template Using Radio Buttons in Web Template Applies to: SAP BW 3.5. For more information, visit the Business Intelligence homepage. Summary One of the ideal requirements in the BW Web Reporting is the user wants

More information

A Step-by-Step Guide on IDoc-ALE between Two SAP Servers

A Step-by-Step Guide on IDoc-ALE between Two SAP Servers A Step-by-Step Guide on IDoc-ALE between Two SAP Servers Applies to: All modules of SAP where data need to transfer from one SAP System to another SAP System using ALE IDoc Methodology. For more information,

More information

REPORT zsscr. *TYPE POOLS DECLARATIONS FOR VALUE REQUEST MANAGER AND ICONS TYPE-POOLS : vrm, icon. *SELECTION SCREEN FIELDS TABLES : sscrfields.

REPORT zsscr. *TYPE POOLS DECLARATIONS FOR VALUE REQUEST MANAGER AND ICONS TYPE-POOLS : vrm, icon. *SELECTION SCREEN FIELDS TABLES : sscrfields. *& Report Z_sscr * *& * *& AS : DYNAMIC Selection screen based on user clicks on the radiobutton* *& * REPORT zsscr. *TYPE POOLS DECLARATIONS FOR VALUE REQUEST MANAGER AND ICONS TYPE-POOLS : vrm, icon.

More information

Recreating BIA Indexes to Address the Growth of Fact Index Table

Recreating BIA Indexes to Address the Growth of Fact Index Table Recreating BIA Indexes to Address the Growth of Fact Index Table Applies to: Software Component: SAP_BW.Release: 700 BIA version: 53 Summary In this article we would learn the application of recreating

More information

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable Applies to: This article applies to SAP BI 7.0 and SAP BW 3.X. For more information visit EDW Homepage. Summary This article explains

More information

Easy Lookup in Process Integration 7.1

Easy Lookup in Process Integration 7.1 Easy Lookup in Process Integration 7.1 Applies to: SAP NetWeaver Process Integration 7.1 For more information, visit the SOA Management homepage. Summary Unlike previous version of PI (7.0) / XI (3.0,

More information

ABAP Code Sample for Data Browser Using ALV Grid

ABAP Code Sample for Data Browser Using ALV Grid ABAP Code Sample for Data Browser Using ALV Grid Applies To: ABAP Summary : Here is a code sample that performs the operation similar to Data Browser. This adopts the simplest way to display any table

More information

Material Master Archiving in Simple Method

Material Master Archiving in Simple Method Material Master Archiving in Simple Method Applies to: This article is applicable for SAP MM Module of SAP Version SAP 4.7 till SAP ECC 6.0 Summary This article describes a process called Material Master

More information

Batch History: How to Guide on getting Batch information from non SAP systems using SAP MII

Batch History: How to Guide on getting Batch information from non SAP systems using SAP MII Batch History: How to Guide on getting Batch information from non SAP systems using SAP MII Applies to: Batch History functionality (EhP4 release) Summary Today s manufacturing scenario, customers store

More information

Customizing Characteristic Relationships in BW-BPS with Function Modules

Customizing Characteristic Relationships in BW-BPS with Function Modules Customizing Characteristic Relationships in BW-BPS with Function Modules Applies to: BW-BPS (Ver. 3.5 and BI 7.0) SEM-BPS (Ver 3.2 onwards) Summary This paper discusses the definition of a exit type characteristic

More information

ABAP Code - Recipients (Specific Format) SAP BW Process Chain

ABAP Code -  Recipients (Specific Format) SAP BW Process Chain ABAP Code - Email Recipients (Specific Format) SAP BW Process Chain Applies to: This article is applicable to all the SAP BI consultants who are accustomed with SAP ABAP skills. For more information, visit

More information

Routines in SAP BI 7.0 Transformations

Routines in SAP BI 7.0 Transformations Routines in SAP BI 7.0 Transformations Applies to: SAP BI 7.0. For more information, visit the Business Intelligence homepage. Summary This paper gives an overview about the different routines available

More information

Common Production Failures Encountered at BW Production Support

Common Production Failures Encountered at BW Production Support Common Production Failures Encountered at BW Production Support Applies to: For more information, visit the Business Intelligence homepage. Summary This Knowledge brief helps BW Consultants as Quick reference

More information

qwertyuiopasdfghjklzxcvbnmqwertyui opasdfghjklzxcvbnmqwertyuiopasdfgh jklzxcvbnmqwertyuiopasdfghjklzxcvb nmqwertyuiopasdfghjklzxcvbnmqwer

qwertyuiopasdfghjklzxcvbnmqwertyui opasdfghjklzxcvbnmqwertyuiopasdfgh jklzxcvbnmqwertyuiopasdfghjklzxcvb nmqwertyuiopasdfghjklzxcvbnmqwer qwertyuiopasdfghjklzxcvbnmqwertyui opasdfghjklzxcvbnmqwertyuiopasdfgh jklzxcvbnmqwertyuiopasdfghjklzxcvb nmqwertyuiopasdfghjklzxcvbnmqwer ABAP Interview Questions & Answers Set 4 tyuiopasdfghjklzxcvbnmqwertyuiopas

More information

Tracking Zero Record Loads

Tracking Zero Record Loads Applies To: SAP BW 3.0 and Above. Summary Sometimes when we extract data from source systems such as R3, flat files, or databases, we see the load finish successfully but deliver no new records to BW.

More information

Freely Programmed Help- Web Dynpro

Freely Programmed Help- Web Dynpro Freely Programmed Help- Web Dynpro Applies to: SAP ABAP Workbench that supports Web dynpro development. For more information, visit the Web Dynpro ABAP homepage. Summary In addition to the Dictionary Search

More information

Open Text DocuLink Configuration - To Access Documents which are Archived using SAP

Open Text DocuLink Configuration - To Access Documents which are Archived using SAP Open Text DocuLink Configuration - To Access Documents which are Archived using SAP Applies to: Open Text DocuLink for SAP Solutions 9.6.2. For more information, visit http://www.opentext.com Summary Open

More information

Financial Statement Version into PDF Reader

Financial Statement Version into PDF Reader Financial Statement Version into PDF Reader Applies to: SAP release 4.7EE, ECC 5.0 and ECC 6.0. For more information, visit the Enterprise Resource Planning homepage Summary: The objective of this article

More information

Developing Crystal Reports on SAP BW

Developing Crystal Reports on SAP BW Developing Crystal Reports on SAP BW Applies to: SAP BusinessObjects Crystal Reports. Summary This white paper explores various methods of accessing SAP BW data through Crystal Reports. Author: Arka Roy

More information

Material Listing and Exclusion

Material Listing and Exclusion Material Listing and Exclusion Applies to: Applies to ECC 6.0. For more information, visit the Enterprise Resource Planning homepage Summary This document briefly explains how to restrict customers from

More information

How to Create and Schedule Publications from Crystal Reports

How to Create and Schedule Publications from Crystal Reports How to Create and Schedule Publications from Crystal Reports Applies to: SAP BusinessObjects Enterprise. For more information, visit the Business Objects homepage. Summary This white paper describes how

More information

Extractor for Multi Value Class Characteristic Values using Function Module

Extractor for Multi Value Class Characteristic Values using Function Module Extractor for Multi Value Class Characteristic Values using Function Module Applies to: SAP BI 7.0, BW 3.5. For more information, visit the EDW homepage. Summary This article explains how to develop generic

More information

Totals in Adobe forms

Totals in Adobe forms Applies to: Adobe Print forms designer version 8.0 in ECC6 For more information, visit the ABAP homepage. Summary This tutorial explains about Step-By-Step procedure to display subtotals and grand totals

More information

POWL: Infoset Generation with Web Dynpro ABAP

POWL: Infoset Generation with Web Dynpro ABAP POWL: Infoset Generation with Web Dynpro ABAP Applies to: WebDynpro ABAP Developer. For more information, visit the Web Dynpro ABAP homepage. Summary: This document explains how to create an Infoset, generate

More information

DB Connect with Delta Mechanism

DB Connect with Delta Mechanism Applies to: SAP BI/BW. For more information, visit the EDW homepage Summary This Article demonstrates the steps for handling Delta mechanism with Relational Database Management System (RDBMS) like SQL,

More information

Step By Step: the Process of Selective Deletion from a DSO

Step By Step: the Process of Selective Deletion from a DSO Step By Step: the Process of Selective Deletion from a DSO Applies to: SAP NetWeaver BW. For more information, visit the EDW homepage. Summary Selective deletion from DSO refers to deleting specific values

More information

Database Statistics During ODS Activation

Database Statistics During ODS Activation Database Statistics During ODS Activation Applies to: SAP BW (3.5) / SAP BI (7.0). For more information, visit the EDW homepage Summary ODS Activation step periodically recalculates the statistics. This

More information

Setting up Connection between BW and R/3 for Data Load

Setting up Connection between BW and R/3 for Data Load Setting up Connection between BW and R/3 for Data Load Applies to: SAP BI 7.0. For more information, visit the Business Intelligence homepage. Summary This document guides to establish connection between

More information

Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal

Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal Applies to: Web Dynpro ABAP. Summary This tutorial explains how to display Web Dynpro ABAP Application in Microsoft Share

More information

MDM Syndication and Importing Configurations and Automation

MDM Syndication and Importing Configurations and Automation MDM Syndication and Importing Configurations and Automation Applies to: SAP MDM SP 05 Summary This document was written primarily for syndication and import of records into SAP NetWeaver MDM from different

More information

MDM Syndicator: Custom Items Tab

MDM Syndicator: Custom Items Tab MDM Syndicator: Custom Items Tab Applies to: SAP NetWeaver Master Data Management (MDM) SP04, SP05 and SP06. For more information, visit the Master Data Management homepage. Summary This article provides

More information

PI Monitoring Functionality Fetching Data from SXMB_MONI Standard Tables

PI Monitoring Functionality Fetching Data from SXMB_MONI Standard Tables PI Monitoring Functionality Fetching Data from SXMB_MONI Standard Tables Applies to: SAP Exchange Infrastructure (SAP NetWeaver Process Integration 7.0). For more information, visit the ABAP homepage.

More information

Purpose of Goods Receipt Message indicator in Purchase Orders

Purpose of Goods Receipt Message indicator in Purchase Orders Purpose of Goods Receipt Message indicator in Purchase Orders Applies to: This article is applicable for SAP MM Module of SAP for version SAP 4.7 till SAP ECC 6.O. For more information, visit the Supply

More information

Loading the Data for Time Dependent Hierarchy in SAP BI

Loading the Data for Time Dependent Hierarchy in SAP BI Loading the Data for Time Dependent Hierarchy in SAP BI Applies to: Time dependent hierarchies are often used by organizations to help them organize their master data which changes like employee hierarchies,

More information

Enhancement Technique: How-To-Guide on the usage of Validations

Enhancement Technique: How-To-Guide on the usage of Validations Enhancement Technique: How-To-Guide on the usage of Validations Applies to: SAP 4.6C and higher Summary This article provides a step-by-step guide on the usage of Validations, an Enhancement technique

More information

Convert the Spool into PDF and send to External ID

Convert the Spool into PDF and send to External  ID Convert the Spool into PDF and send to External Email ID Applies To: SAP 4.7/Above Article Summary This report program will execute the given program with the specified variant in background and convert

More information

Implementation and Usage of Transformation End Routine in SAP BI 7.0

Implementation and Usage of Transformation End Routine in SAP BI 7.0 Implementation and Usage of Transformation End Routine in SAP BI 7.0 Applies to: This article applies to SAP BI 7.0. For more information, visit the Business Intelligence homepage. Summary This document

More information

SUBHENDU MAJUMDAR Technical Consultant, IBM

SUBHENDU MAJUMDAR Technical Consultant, IBM 1.1.1. SUBHENDU MAJUMDAR Technical Consultant, IBM Author : Subhendu Majumdar Page 1 12/1/2005 Contents 1. Preface...6 2. Client to Client ALE Setup...7 2.1. Introduction...7 2.2. Steps...8 2.2.1. Defining

More information

Standalone BW System Refresh

Standalone BW System Refresh Applies to: Software Component: SAP_BW. For more information, visit the EDW homepage Summary BW relevant steps/scenarios during refresh of an existing non-productive BW system from productive BW system

More information

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons Creating Custom SU01 Transaction Code with Display and Password Reset Buttons Applies to: All versions of SAP. Summary This article will explain you the process of creating custom SU01 transaction code

More information

This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts.

This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts. Applies to: SAP IS-Utilities 4.6 and above. Summary This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts. Author: Company: Hiral M Dedhia L & T Infotech Ltd.

More information

BPM Multi Line Container in Integration Process

BPM Multi Line Container in Integration Process BPM Multi Line Container in Integration Process Applies to: SAP XI 3.0. For more information, visit the SOA Management homepage. Summary The requirement is that individual employee details are to for a

More information

How to Default Variant Created for Report Developed In Report Painter/Writer

How to Default Variant Created for Report Developed In Report Painter/Writer How to Default Variant Created for Report Developed In Report Painter/Writer Applies to: Any business organization having reports developed using Report Painter/Report Writer. This is applicable from R/3

More information

SMT (Service Mapping Tool)

SMT (Service Mapping Tool) Applies to: This document applies to SAP versions ECC 6.0. For more information, visit the ABAP homepage. Summary This article contains the guidelines for using the SMT (Service mapping Tool) Mapping.

More information

Extraction of Hierarchy into Flat File from R/3 and Loading in BW System

Extraction of Hierarchy into Flat File from R/3 and Loading in BW System Extraction of Hierarchy into Flat File from R/3 and Loading in BW System Applies to: This article applies to SAP R/3 (any version) and SAP B/W (any version).for more information, visit the Business Intelligence

More information

Information Broadcasting Part 3 Scheduling the First Report

Information Broadcasting Part 3 Scheduling the First Report Information Broadcasting Part 3 Scheduling the First Report Applies to: SAP BW 3.5 Summary This is part-3 article in the Information broadcasting (IB) series. Some things have already been discussed like

More information

Explore to the Update Tab of Data Transfer Process in SAP BI 7.0

Explore to the Update Tab of Data Transfer Process in SAP BI 7.0 Explore to the Update Tab of Data Transfer Process in SAP BI 7.0 Applies to: SAP BI 2004s or SAP BI 7.x. For more information visit the Enterprise Data Warehousing. Summary This article will explain about

More information

Can be used in diverse languages / Development Environments

Can be used in diverse languages / Development Environments 1 BAPI: A Business Application Programming Interface is a precisely defined interface providing access process and data in Business Applications Systems Such as SAP R/3 Benefits of BAPI: Can be used in

More information

Combining Multiple Smartform Outputs Into One PDF File

Combining Multiple Smartform Outputs Into One PDF File SDN Contribution Combining Multiple Smartform Outputs Into One PDF File Applies to: SAP R/3 46C ABAP / SMARTFORMS Summary This program code would help those who want to combine multiple smartform outputs

More information

Xcelsius Tricks Part 5 Create a Loading Bar in SAP Crystal Dashboard and Presentation Design (Xcelsius 2008)

Xcelsius Tricks Part 5 Create a Loading Bar in SAP Crystal Dashboard and Presentation Design (Xcelsius 2008) Xcelsius Tricks Part 5 Create a Loading Bar in SAP Crystal Dashboard and Presentation Design (Xcelsius 2008) Applies to: SAP Crystal Dashboard and Presentation Design (Xcelsius 2008). For more information,

More information

Implementing Customer Exit Reporting Variables as Methods

Implementing Customer Exit Reporting Variables as Methods Implementing Customer Exit Reporting Variables as Methods Applies to: SAP BI 7.0 For more information, visit the Business Intelligence homepage. Summary This article describes how we can implement customer

More information

Add /Remove Links on ESS Home Page in Business Package 1.5

Add /Remove Links on ESS Home Page in Business Package 1.5 Add /Remove Links on ESS Home Page in Business Package 1.5 Applies to: SAP ECC EHP5. For more information, visit the Enterprise Resource Planning homepage. Summary Customizing links on ESS Overview page

More information

Restricting F4 (Input Help) Values While Running a SAP BW Query

Restricting F4 (Input Help) Values While Running a SAP BW Query Restricting F4 (Input Help) Values While Running a SAP BW Query Applies to: SAP BI 7.01 Summary This article briefs out the way to restrict F4 values (Input help values) while running a SAP BW query with

More information

Cut Over Activities Specific for LIS* Data Sources

Cut Over Activities Specific for LIS* Data Sources Cut Over Activities Specific for LIS* Data Sources Applies to: SAP BW 3.5/SAP BI 7.0. For more information visit the Enterprise Data Warehousing Homepage Summary The basic purpose of this document is to

More information

Using Customer Exit Variables in BW/BI Reports Part - 1

Using Customer Exit Variables in BW/BI Reports Part - 1 Using Customer Exit Variables in BW/BI Reports Part - 1 Applies to: SAP BW 3.5, Will also work on SAP BI 7. For more information, visit the Business Intelligence homepage. Summary This article gives clear

More information

List of Values in BusinessObjects Web Intelligence Prompts

List of Values in BusinessObjects Web Intelligence Prompts List of Values in BusinessObjects Web Intelligence Prompts Applies to: This solution is implemented for a combination of SAP NW BI 7.0 and SAP BO XI 3.1. For more information visit Business Objects Home

More information

Limitation in BAPI Scheduling Agreement (SA) Create or Change

Limitation in BAPI Scheduling Agreement (SA) Create or Change Limitation in BAPI Scheduling Agreement (SA) Create or Change Applies to: SAP ECC 6.0.For more information, visit the ABAP homepage. Summary The article describes the limitations in standard SAP BAPIs

More information

Step by Step Method for File Archival in BW

Step by Step Method for File Archival in BW Step by Step Method for File Archival in BW Applies to: SAP BW 3.x & SAP BI Net Weaver 2004s. For more information, visit the EDW homepage. Summary This document will give the reader step by step approach

More information

Complete Guide for Events in Workflows in SAP ECC 6.0

Complete Guide for Events in Workflows in SAP ECC 6.0 Complete Guide for Events in Workflows in SAP ECC 6.0 Applies to: SAP ECC 6.0 and upwards Summary This tutorial covers the basics of events and their properties. It also covers adding events to Business

More information

Complete Guide to Learn ALE Error Handling Through Workflow and Implementation

Complete Guide to Learn ALE Error Handling Through Workflow and Implementation Complete Guide to Learn ALE Error Handling Through Workflow and Implementation Applies to: ECC 6.0. Summary Through this document the reader will be able to get a detailed idea about the working of the

More information

Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure

Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure Applies to: ECC 6.0 and BI 3.x and 7.0 For more information, visit the Business Intelligence homepage. Summary Many

More information