博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
内表数据量过大时,拆分内表,分批次处理。
阅读量:5348 次
发布时间:2019-06-15

本文共 11470 字,大约阅读时间需要 38 分钟。

*&---------------------------------------------------------------------**& Report  ZDM_ICM_POLICY_WITH_POL*&Created  by James on 2018/07/16*&---------------------------------------------------------------------**& the report for query the dirty data with policy*& 1 policy has been been released but doesn't have POL/PAC*& 2 policy haven't be released but have POL/PAC*& 3 policy have pol/pac but no policy released.*&---------------------------------------------------------------------*REPORT ZDM_ICM_POLICY_WITH_POL.*&---------------------------------------------------------------------**&  DATA DEFINE*&---------------------------------------------------------------------*TYPES:  BEGIN OF TY_RANGE,    SIGN(1)   type C,    OPTION(2) type C,    LOW       type MATNR,    HIGH      type MATNR,  END OF TY_RANGE,  BEGIN OF TY_POLNR_RFC,    POLICYNR_TT TYPE CHAR30,    TMP_DEL_FG  TYPE CHAR3,  END OF TY_POLNR_RFC,  BEGIN OF TY_POLNR_RFC_PM,    POLICYNR_TT  TYPE CHAR17,    TMP_DEL_FG   TYPE CHAR1,  END OF TY_POLNR_RFC_PM,  BEGIN OF TY_CAS,    BUSOBJ_TYPE  TYPE CHAR3,    BUSOBJ_ID    TYPE CHAR30,  END OF TY_CAS.DATA:  GT_CAS_NO_RE    TYPE TABLE OF TY_CAS,  GT_CAS_YE_RE    TYPE TABLE OF TY_CAS,  GT_CAS_HAVE_PO    TYPE TABLE OF TY_CAS,  GT_FIELDCAT     TYPE lVC_T_FCAT,  GS_FIELDCAT     TYPE lVC_S_FCAT,  GS_LAYOUT       TYPE lVC_S_LAYO,* temporary storage  GT_POLNR_YE_RFC TYPE TABLE OF TY_POLNR_RFC,  GT_POLNR_NO_RFC TYPE TABLE OF TY_POLNR_RFC.*&---------------------------------------------------------------------**&  PARAMETERS DEFINITION*&---------------------------------------------------------------------*SELECTION-SCREEN BEGIN OF BLOCK B01 WITH FRAME TITLE TEXT-B01.PARAMETERS:  P_RELE RADIOBUTTON GROUP RD1 TYPE CHAR1,  P_NULL RADIOBUTTON GROUP RD1 TYPE CHAR1 DEFAULT 'X',  P_POL  RADIOBUTTON GROUP RD1 TYPE CHAR1,  P_DEST  TYPE RFCDES-RFCDEST.SELECTION-SCREEN END OF BLOCK B01.*&---------------------------------------------------------------------**&  INITIALIZATION*&---------------------------------------------------------------------*INITIALIZATION.CLEAR:  GT_CAS_NO_RE,  GT_CAS_YE_RE,  GT_CAS_HAVE_PO,  GT_FIELDCAT,  GS_FIELDCAT,  GS_LAYOUT.*&---------------------------------------------------------------------**&  START-OF-SELECTION*&---------------------------------------------------------------------*START-OF-SELECTION.PERFORM CALL_RFC.PERFORM EDIT_POLNR.IF GT_CAS_NO_RE    IS INITIAL AND   GT_CAS_YE_RE    IS INITIAL AND   GT_CAS_HAVE_PO  IS INITIAL.  EXIT.ENDIF.PERFORM ALV_SHOW.*&---------------------------------------------------------------------**&      Form  CALL_RFC*&---------------------------------------------------------------------**       text*----------------------------------------------------------------------**  <--  GT_POLNR_YE_RFC        Released yes*  <--  GT_POLNR_NO_RFC        Released no*----------------------------------------------------------------------*FORM CALL_RFC .  DATA:    LT_RFC          TYPE TABLE OF TY_POLNR_RFC_PM,    LT_POLNR_YE_RFC TYPE TABLE OF TY_POLNR_RFC,    LT_POLNR_NO_RFC TYPE TABLE OF TY_POLNR_RFC,    LS_POLNR_YE_RFC TYPE TY_POLNR_RFC,    LS_POLNR_NO_RFC TYPE TY_POLNR_RFC.  FIELD-SYMBOLS:    
TYPE TY_POLNR_RFC_PM. CLEAR: LT_RFC, LT_POLNR_YE_RFC, LT_POLNR_NO_RFC, LS_POLNR_YE_RFC, LS_POLNR_NO_RFC. UNASSIGN:
.* Call RFC CALL FUNCTION 'ZDM_ICM_GET_POLICY' DESTINATION P_DEST TABLES TT_POLNR_RCF = LT_RFC.* divide policy as released and not yet IF LT_RFC IS NOT INITIAL.* has been released IF P_RELE = ABAP_TRUE. SORT LT_RFC BY TMP_DEL_FG DESCENDING. LOOP AT LT_RFC ASSIGNING
WHERE TMP_DEL_FG = ABAP_TRUE. LS_POLNR_YE_RFC-POLICYNR_TT =
-POLICYNR_TT. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING INPUT = LS_POLNR_YE_RFC-POLICYNR_TT IMPORTING OUTPUT = LS_POLNR_YE_RFC-POLICYNR_TT. LS_POLNR_YE_RFC-TMP_DEL_FG =
-TMP_DEL_FG. APPEND LS_POLNR_YE_RFC TO LT_POLNR_YE_RFC. CLEAR LS_POLNR_YE_RFC. ENDLOOP. MOVE-CORRESPONDING LT_POLNR_YE_RFC TO GT_POLNR_YE_RFC. IF GT_POLNR_YE_RFC IS INITIAL. MESSAGE 'Can not find Policy which already be released from /PM0/ABDQMIGJOUR ' TYPE 'E'. EXIT. ENDIF.* hasn't be released ELSEIF P_NULL = ABAP_TRUE OR P_POL = ABAP_TRUE. SORT LT_RFC BY TMP_DEL_FG ASCENDING. LOOP AT LT_RFC ASSIGNING
WHERE TMP_DEL_FG = ABAP_FALSE. LS_POLNR_NO_RFC-POLICYNR_TT =
-POLICYNR_TT. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING INPUT = LS_POLNR_NO_RFC-POLICYNR_TT IMPORTING OUTPUT = LS_POLNR_NO_RFC-POLICYNR_TT. LS_POLNR_NO_RFC-TMP_DEL_FG =
-TMP_DEL_FG. APPEND LS_POLNR_NO_RFC TO LT_POLNR_NO_RFC. CLEAR LS_POLNR_NO_RFC. ENDLOOP. MOVE-CORRESPONDING LT_POLNR_NO_RFC TO GT_POLNR_NO_RFC. IF GT_POLNR_NO_RFC IS INITIAL. MESSAGE 'Can not find Policy which has not be released from /PM0/ABDQMIGJOUR ' TYPE 'E'. EXIT. ENDIF. ENDIF. ELSE. MESSAGE 'Can not get any Polict from /PM0/ABDQMIGJOUR ' TYPE 'E'. EXIT. ENDIF.ENDFORM.*&---------------------------------------------------------------------**& Form EDIT_POLNR*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> GT_POLNR_YE_RFC Released yes* --> GT_POLNR_NO_RFC Released no* <-- GT_CAS_YE_RE policy has been been released but doesn't have POL/PAC* <-- GT_CAS_NO_RE policy haven't be released but have POL/PAC* <-- GT_CAS_HAVE_PO policy have pol/pac but no policy released.*----------------------------------------------------------------------*FORM EDIT_POLNR . DATA: LT_CAS_NO_RE TYPE TABLE OF TY_CAS, LT_CAS_YE_RE TYPE TABLE OF TY_CAS, LT_CAS_HAVE_PO TYPE TABLE OF TY_CAS, LT_RANGE TYPE TABLE OF TY_RANGE, LS_RANGE TYPE TY_RANGE, LT_POLNR_NO_RE TYPE TABLE OF TY_POLNR_RFC, " Released yes LT_POLNR_YE_RE TYPE TABLE OF TY_POLNR_RFC, " Released no LS_POLNR_YE_RE TYPE TY_CAS,*----------start add by james in 2018/08/02 DE1K9A028J----------- LV_PACKGE TYPE I VALUE '500000', LV_COUNT TYPE i, LV_START TYPE i VALUE '1', LV_END TYPE I.*----------end add by james in 2018/08/02 DE1K9A028J----------- FIELD-SYMBOLS:
TYPE TY_POLNR_RFC,
TYPE TY_CAS. CLEAR: LT_CAS_NO_RE, LT_CAS_YE_RE, LT_CAS_HAVE_PO, LT_RANGE, LS_RANGE, LT_POLNR_NO_RE, LT_POLNR_YE_RE. UNASSIGN:
,
.* define range LS_RANGE-sign = 'I'. LS_RANGE-option = 'EQ'. LS_RANGE-low = 'POL'. APPEND LS_RANGE TO LT_RANGE. CLEAR LS_RANGE. LS_RANGE-sign = 'I'. LS_RANGE-option = 'EQ'. LS_RANGE-low = 'PAC'. APPEND LS_RANGE TO LT_RANGE.* case1 for released IF P_RELE = ABAP_TRUE.*----------start add by james in 2018/08/02 DE1K9A028J----------- DESCRIBE TABLE GT_POLNR_YE_RFC LINES LV_COUNT. WHILE LV_START <= LV_COUNT. LV_END = LV_START + LV_PACKGE - 1 . APPEND LINES OF GT_POLNR_YE_RFC FROM LV_START TO LV_END TO LT_POLNR_YE_RE . LV_START = LV_END + 1.* IF SY-TABIX MOD LV_PACKGE = 0 OR SY-TABIX = LV_COUNT. IF LT_POLNR_YE_RE IS NOT INITIAL. SELECT BUSOBJ_TYPE BUSOBJ_ID INTO CORRESPONDING FIELDS OF TABLE LT_CAS_YE_RE FROM ZICNSL_CAS FOR ALL ENTRIES IN LT_POLNR_YE_RE WHERE BUSOBJ_ID = LT_POLNR_YE_RE-POLICYNR_TT AND BUSOBJ_TYPE IN LT_RANGE.* policy has been been released but doesn't have POL/PAC IF LT_CAS_YE_RE IS NOT INITIAL. SORT LT_CAS_YE_RE BY BUSOBJ_ID. DELETE ADJACENT DUPLICATES FROM LT_CAS_YE_RE COMPARING BUSOBJ_ID. SORT LT_POLNR_YE_RE BY POLICYNR_TT. SORT LT_CAS_YE_RE BY BUSOBJ_ID . LOOP AT LT_POLNR_YE_RE ASSIGNING
. READ TABLE LT_CAS_YE_RE ASSIGNING
WITH KEY BUSOBJ_ID =
-POLICYNR_TT BINARY SEARCH. IF SY-SUBRC <> 0. LS_POLNR_YE_RE-BUSOBJ_ID =
-POLICYNR_TT. LS_POLNR_YE_RE-BUSOBJ_TYPE = 'No'. APPEND LS_POLNR_YE_RE TO GT_CAS_YE_RE. CLEAR:LS_POLNR_YE_RE. ENDIF. ENDLOOP. ENDIF. ENDIF. CLEAR: LT_POLNR_YE_RE, LT_CAS_YE_RE. ENDWHILE. IF GT_CAS_YE_RE IS INITIAL . MESSAGE 'according to released policy, haven not find pol/pac' TYPE 'E'. EXIT. ENDIF.*----------end add by james in 2018/08/02 DE1K9A028J----------- ENDIF.* case2 for haven't be released IF P_NULL = ABAP_TRUE.*----------start add by james in 2018/08/02 DE1K9A028J----------- DESCRIBE TABLE GT_POLNR_NO_RFC LINES LV_COUNT. WHILE LV_START <= LV_COUNT. LV_END = LV_START + LV_PACKGE - 1 . APPEND LINES OF GT_POLNR_NO_RFC FROM LV_START TO LV_END TO LT_POLNR_NO_RE . LV_START = LV_END + 1.* IF SY-TABIX MOD LV_PACKGE = 0 OR SY-TABIX = LV_COUNT. IF LT_POLNR_NO_RE IS NOT INITIAL. SELECT BUSOBJ_TYPE BUSOBJ_ID INTO CORRESPONDING FIELDS OF TABLE LT_CAS_NO_RE FROM ZICNSL_CAS FOR ALL ENTRIES IN LT_POLNR_NO_RE WHERE BUSOBJ_ID = LT_POLNR_NO_RE-POLICYNR_TT AND BUSOBJ_TYPE IN LT_RANGE.* policy haven't be released but have POL/PAC IF LT_CAS_NO_RE IS NOT INITIAL. SORT LT_CAS_NO_RE BY BUSOBJ_TYPE BUSOBJ_ID. DELETE ADJACENT DUPLICATES FROM LT_CAS_NO_RE COMPARING BUSOBJ_TYPE BUSOBJ_ID. APPEND LINES OF LT_CAS_NO_RE TO GT_CAS_NO_RE . ENDIF. ENDIF. CLEAR: LT_POLNR_NO_RE, LT_CAS_NO_RE. ENDWHILE. IF GT_CAS_NO_RE IS INITIAL. MESSAGE ' do not have the policy already be released but still have POL/PAC' TYPE 'S'. EXIT. ENDIF.*----------end add by james in 2018/08/02 DE1K9A028J----------- ENDIF.* case3 for have pol/pac but no policy released. IF P_POL = ABAP_TRUE. LT_POLNR_NO_RE = GT_POLNR_NO_RFC. FREE:GT_POLNR_NO_RFC. SELECT BUSOBJ_TYPE BUSOBJ_ID INTO CORRESPONDING FIELDS OF TABLE LT_CAS_HAVE_PO FROM ZICNSL_CAS FOR ALL ENTRIES IN LT_POLNR_NO_RE WHERE BUSOBJ_ID = LT_POLNR_NO_RE-POLICYNR_TT AND BUSOBJ_TYPE IN LT_RANGE. IF LT_CAS_HAVE_PO IS NOT INITIAL. SORT LT_CAS_HAVE_PO BY BUSOBJ_TYPE BUSOBJ_ID. DELETE ADJACENT DUPLICATES FROM LT_CAS_HAVE_PO COMPARING BUSOBJ_TYPE BUSOBJ_ID. GT_CAS_HAVE_PO = LT_CAS_NO_RE. ENDIF. ENDIF.ENDFORM.*&---------------------------------------------------------------------**& Form ALV_SHOW*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> GT_CAS_YE_RE policy has been been released but doesn't have POL/PAC* --> GT_CAS_NO_RE policy haven't be released but have POL/PAC* --> GT_CAS_HAVE_PO policy have pol/pac but no policy released.*----------------------------------------------------------------------*FORM ALV_SHOW . GS_LAYOUT-CWIDTH_OPT = 'X'. GS_LAYOUT-ZEBRA = 'X'. GS_LAYOUT-SEL_MODE = 'D'. gs_fieldcat-fieldname = 'BUSOBJ_TYPE'. gs_fieldcat-coltext = 'BUSOBJ_TYPE'. gs_fieldcat-outputlen = '20'. APPEND gs_fieldcat TO gt_fieldcat. CLEAR gs_fieldcat. gs_fieldcat-fieldname = 'BUSOBJ_ID'. gs_fieldcat-coltext = 'BUSOBJ_ID'. gs_fieldcat-outputlen = '20'. APPEND gs_fieldcat TO gt_fieldcat. CLEAR gs_fieldcat. IF P_RELE = ABAP_TRUE . CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' EXPORTING i_callback_program = sy-repid is_layout_lvc = gs_layout it_fieldcat_lvc = gt_fieldcat I_SAVE = 'A' TABLES t_outtab = GT_CAS_YE_RE EXCEPTIONS program_error = 1 OTHERS = 2. ELSEIF P_NULL = ABAP_TRUE. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' EXPORTING i_callback_program = sy-repid is_layout_lvc = gs_layout it_fieldcat_lvc = gt_fieldcat I_SAVE = 'A' TABLES t_outtab = GT_CAS_NO_RE EXCEPTIONS program_error = 1 OTHERS = 2. ELSEIF P_POL = ABAP_TRUE. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' EXPORTING i_callback_program = sy-repid is_layout_lvc = gs_layout it_fieldcat_lvc = gt_fieldcat I_SAVE = 'A' TABLES t_outtab = GT_CAS_HAVE_PO EXCEPTIONS program_error = 1 OTHERS = 2. ENDIF.ENDFORM.

 

转载于:https://www.cnblogs.com/HARU/p/9407051.html

你可能感兴趣的文章
Ubuntu改坏sudoers后无法使用sudo的解决办法
查看>>
NEYC 2017 游记
查看>>
[搬运] 写给 C# 开发人员的函数式编程
查看>>
Python之旅Day14 JQuery部分
查看>>
core--线程池
查看>>
redux-effect
查看>>
Android轻量级的开源缓存框架ASimpleCache
查看>>
他山之石:加载图片的一个小问题
查看>>
shell - 常识
查看>>
mssql sqlserver 使用sql脚本 清空所有数据库表数据的方法分享
查看>>
分层图最短路【bzoj2763】: [JLOI2011]飞行路线
查看>>
linux下编译复数类型引发的错误:expected unqualified-id before '(' token
查看>>
codeforces 1041A Heist
查看>>
Spring Cloud Stream消费失败后的处理策略(三):使用DLQ队列(RabbitMQ)
查看>>
bzoj1048 [HAOI2007]分割矩阵
查看>>
Java中的编码
查看>>
PKUWC2018 5/6
查看>>
As-If-Serial 理解
查看>>
洛谷P1005 矩阵取数游戏
查看>>
在Silverlight中使用HierarchicalDataTemplate为TreeView实现递归树状结构
查看>>