1. 程式人生 > >the comparison report with policy in different MC.(不同系統之間的RFC調用)

the comparison report with policy in different MC.(不同系統之間的RFC調用)

ear des text lec dup orm div ssi pre

*&---------------------------------------------------------------------*
*& Report  ZDM_ICM_PFO_COMPARISON
*&---------------------------------------------------------------------*
*&Created by James on 2018/05/30
*&---------------------------------------------------------------------*
*& the comparison report with policy in different MC. *&---------------------------------------------------------------------* REPORT ZDM_ICM_PFO_COMPARISON. TABLES:ZDM_COMM_CONTR. *&---------------------------------------------------------------------* *& DATA DEFINE *&---------------------------------------------------------------------*
TYPES: BEGIN OF TY_POLNR, POLNR TYPE CHAR10, END OF TY_POLNR, TT_POLNR TYPE TABLE OF TY_POLNR, BEGIN OF TY_COMM_CONTR, POLNR TYPE CHAR10, COVNR TYPE CHAR10, COMM_CONTRNR TYPE CHAR20, COMM_ROLE TYPE CHAR4, MC TYPE CHAR5, DIR_PERC
TYPE DEC5, INDIR_PERC TYPE DEC5, VALID_FR TYPE DATS, VALID_TO TYPE DATS, OWNER_FLG TYPE CHAR1, PREV_CONTRNR TYPE CHAR20, END OF TY_COMM_CONTR, TT_COMM_CONTR TYPE SORTED TABLE OF TY_COMM_CONTR WITH UNIQUE KEY POLNR COMM_CONTRNR COMM_ROLE. DATA: POLNR TYPE CHAR10, GT_I TYPE TABLE OF TY_COMM_CONTR, GT_D TYPE TABLE OF TY_COMM_CONTR. *&---------------------------------------------------------------------* *& PARAMETERS DEFINITION *&---------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF BLOCK B01 WITH FRAME TITLE TEXT-B01. SELECT-OPTIONS: P_POLNR FOR POLNR OBLIGATORY. PARAMETERS: P_MC_D TYPE CHAR10 OBLIGATORY, P_MC_I TYPE CHAR10 OBLIGATORY, P_DEST TYPE RFCDES-RFCDEST. SELECTION-SCREEN END OF BLOCK B01. *&---------------------------------------------------------------------* *& INITIALIZATION *&---------------------------------------------------------------------* INITIALIZATION. CLEAR: GT_I, GT_D. *&---------------------------------------------------------------------* *& START-OF-SELECTION *&---------------------------------------------------------------------* START-OF-SELECTION. PERFORM GET_DATA. PERFORM COMPARE_DATA. *&---------------------------------------------------------------------* *& Form GET_DATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM GET_DATA . DATA: LT_MC_D TYPE TT_COMM_CONTR, LT_MC_I TYPE TT_COMM_CONTR. SELECT POLNR COVNR COMM_CONTRNR COMM_ROLE MC DIR_PERC INDIR_PERC VALID_FR VALID_TO OWNER_FLG PREV_CONTRNR INTO CORRESPONDING FIELDS OF TABLE LT_MC_D FROM ZDM_COMM_CONTR WHERE MC = P_MC_D AND POLNR IN P_POLNR. SELECT POLNR COVNR COMM_CONTRNR COMM_ROLE MC DIR_PERC INDIR_PERC VALID_FR VALID_TO OWNER_FLG PREV_CONTRNR INTO CORRESPONDING FIELDS OF TABLE LT_MC_I FROM ZDM_COMM_CONTR WHERE MC = P_MC_I AND POLNR IN P_POLNR. IF LT_MC_I IS NOT INITIAL AND LT_MC_D IS NOT INITIAL. GT_I = LT_MC_I. GT_D = LT_MC_D. ELSE. MESSAGE Can not found any data TYPE E. ENDIF. ENDFORM. " GET_DATA *&---------------------------------------------------------------------* *& Form COMPARE_DATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM COMPARE_DATA . DATA: LT_MC_D TYPE TT_COMM_CONTR, LT_MC_I TYPE TT_COMM_CONTR, LT_POLNR TYPE TABLE OF TY_POLNR, LS_POLNR TYPE TY_POLNR. FIELD-SYMBOLS: <FS_D> TYPE TY_COMM_CONTR, <FS_I> TYPE TY_COMM_CONTR. CLEAR: LT_MC_D, LT_MC_I, LT_POLNR, LS_POLNR. UNASSIGN: <FS_D>, <FS_I>. LT_MC_I = GT_I. LT_MC_D = GT_D. LOOP AT LT_MC_I ASSIGNING <FS_I>. READ TABLE LT_MC_D ASSIGNING <FS_D> WITH TABLE KEY POLNR = <FS_I>-POLNR COMM_CONTRNR = <FS_I>-COMM_CONTRNR COMM_ROLE = <FS_I>-COMM_ROLE. IF SY-SUBRC = 0 . * Has difference IF <FS_I>-COVNR <> <FS_D>-COVNR OR <FS_I>-DIR_PERC <> <FS_D>-DIR_PERC OR <FS_I>-INDIR_PERC <> <FS_D>-INDIR_PERC OR <FS_I>-VALID_FR <> <FS_D>-VALID_FR OR <FS_I>-VALID_TO <> <FS_D>-VALID_TO OR <FS_I>-OWNER_FLG <> <FS_D>-OWNER_FLG OR <FS_I>-PREV_CONTRNR <> <FS_D>-PREV_CONTRNR . LS_POLNR-POLNR = <FS_I>-POLNR. APPEND LS_POLNR TO LT_POLNR. ENDIF. ELSE. LS_POLNR-POLNR = <FS_I>-POLNR. APPEND LS_POLNR TO LT_POLNR. ENDIF. CLEAR LS_POLNR. ENDLOOP. LOOP AT LT_MC_D ASSIGNING <FS_D>. READ TABLE LT_MC_I ASSIGNING <FS_I> WITH TABLE KEY POLNR = <FS_D>-POLNR COMM_CONTRNR = <FS_D>-COMM_CONTRNR COMM_ROLE = <FS_D>-COMM_ROLE. IF SY-SUBRC = 0 . * Has difference IF <FS_I>-COVNR <> <FS_D>-COVNR OR <FS_I>-DIR_PERC <> <FS_D>-DIR_PERC OR <FS_I>-INDIR_PERC <> <FS_D>-INDIR_PERC OR <FS_I>-VALID_FR <> <FS_D>-VALID_FR OR <FS_I>-VALID_TO <> <FS_D>-VALID_TO OR <FS_I>-OWNER_FLG <> <FS_D>-OWNER_FLG OR <FS_I>-PREV_CONTRNR <> <FS_D>-PREV_CONTRNR . LS_POLNR-POLNR = <FS_I>-POLNR. APPEND LS_POLNR TO LT_POLNR. ENDIF. ELSE. LS_POLNR-POLNR = <FS_D>-POLNR. APPEND LS_POLNR TO LT_POLNR. ENDIF. CLEAR LS_POLNR. ENDLOOP. DELETE ADJACENT DUPLICATES FROM LT_POLNR COMPARING POLNR. * Call RFC CALL FUNCTION ZDM_PM_UPDATE_DELTA_SCOPE DESTINATION p_dest EXPORTING mc = P_MC_D * so_polnr = s_polnr[] TABLES T_POLICY = LT_POLNR. ENDFORM. " COMPARE_DATA

the comparison report with policy in different MC.(不同系統之間的RFC調用)