• 调用一系列的程序,去完成日常的工作内容


    *&---------------------------------------------------------------------*
    *& Report  ZDM_TEST_MIGRATE_PM
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    
    REPORT  zdm_migrate_pm_pfo.
    DATA: polnr TYPE char10,
          p_client2 TYPE char5,
          p_mc2 type char7.
    *screen definition
    SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
    PARAMETERS: p_mc TYPE char5 OBLIGATORY DEFAULT 'GT500',
                p_client TYPE char3 DEFAULT '003',
                p_ap TYPE numc5.
    SELECT-OPTIONS:p_pol FOR polnr.
    PARAMETERS: p_pconv AS CHECKBOX DEFAULT 'X',
                p_pfo AS CHECKBOX DEFAULT 'X',
                p_pload AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK b01.
    
    START-OF-SELECTION.
    
    
    CONCATENATE '''' p_client '''' INTO p_client2.
    CONCATENATE '''' p_mc '''' INTO p_mc2.
    
      PERFORM delete_ap.
      IF p_pconv = 'X'.
        PERFORM policy_conv.
      ENDIF.
    
      IF p_pfo = 'X'.
        PERFORM pfo_conv_load.
      ENDIF.
    
      IF p_pload = 'X'.
        PERFORM policy_load.
      ENDIF.
    
    *&---------------------------------------------------------------------*
    *&      Form  DELETE_AP
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM delete_ap.
    
      DATA: g_cobj         TYPE REF TO cl_dmc_conv_object,
            g_acplan         TYPE REF TO cl_dmc_access_plan,
            g_acplan_list    TYPE REF TO cl_dmc_access_plan_list.
    
      DATA: wl_log_handler TYPE REF TO cl_dmc_log_handler,
            wl_root        TYPE REF TO cx_root,
            wl_error       TYPE string.
      cl_dmc_log_handler=>initialize( ).
      wl_log_handler = cl_dmc_log_handler=>create_loghandler(
                       im_subobject   = cl_dmc_log_handler=>co_cobj_mnt
                       im_behaviour   = cl_dmc_log_handler=>co_mode_specific
                       im_external_id = ' ' ).
    
      TYPES: BEGIN OF ty_moname,
                mo TYPE char20,
                sp TYPE char20,
              END OF ty_moname.
      DATA:
        lt_moname TYPE TABLE OF ty_moname,
        lw_moname TYPE ty_moname.
    
      CLEAR lw_moname.
      lw_moname-mo = 'Z_SLO_PM_I_D6H'.
      lw_moname-sp = 'ZSLO_DM_D6H'.
      APPEND lw_moname TO lt_moname.
    
      CLEAR lw_moname.
      lw_moname-mo = 'Z_SLO_PM_L_D6H'.
      lw_moname-sp = 'ZSLO_DM_D6H'.
      APPEND lw_moname TO lt_moname.
    
      CLEAR lw_moname.
      lw_moname-mo = 'Z_SLO_ICM_LB_PFO_DDH'.
      lw_moname-sp = 'ZSLO_DM_DDH'.
      APPEND lw_moname TO lt_moname.
    
      CLEAR lw_moname.
      lw_moname-mo = 'Z_SLO_ICM_S2_SSA_DDH'.
      lw_moname-sp = 'ZSLO_DM_DDH'.
      APPEND lw_moname TO lt_moname.
    
      CLEAR lw_moname.
      lw_moname-mo = 'Z_SLO_PFO_00IP_H6X'.
      lw_moname-sp = 'ZSLO_DM_H6X'.
      APPEND lw_moname TO lt_moname.
    
      CLEAR lw_moname.
      lw_moname-mo = 'Z_SLO_PFO_00IS_H6X'.
      lw_moname-sp = 'ZSLO_DM_H6X'.
      APPEND lw_moname TO lt_moname.
    
      CLEAR lw_moname.
      lw_moname-mo = 'Z_SLO_PFO_GZO_H6X'.
      lw_moname-sp = 'ZSLO_DM_H6X'.
      APPEND lw_moname TO lt_moname.
    
      CLEAR lw_moname.
      lw_moname-mo = 'Z_SLO_PM_I_H6Y'.
      lw_moname-sp = 'ZSLO_DM_H6Y'.
      APPEND lw_moname TO lt_moname.
    
      FIELD-SYMBOLS <fs_mo> TYPE ty_moname.
      LOOP AT lt_moname ASSIGNING <fs_mo>.
        CALL METHOD cl_dmc_conv_object=>load
          EXPORTING
            im_c_name            = <fs_mo>-mo
            im_project_name      = 'ZSLO_DM'
            im_subproject_name   = <fs_mo>-sp
            im_applic            = 'SLO'
    *       im_light_load        = 'X'
          RECEIVING
            conv_obj             = g_cobj
          EXCEPTIONS
            conv_obj_not_valid   = 1
            not_found            = 2
            project_not_valid    = 3
            subproject_not_valid = 4
            not_productive       = 5
            OTHERS               = 6.
        IF g_cobj IS NOT INITIAL.
          g_acplan_list = g_cobj->acplan_list.
          CLEAR g_acplan.
          g_acplan = g_acplan_list->get_element_by_id( p_ap ).
    
          IF g_acplan IS NOT INITIAL.
            CALL METHOD g_acplan->delete.
            TRY.
                CALL METHOD g_acplan->save.
              CATCH cx_root INTO wl_root.
            ENDTRY.
    
            CALL METHOD g_acplan_list->delete_element_by_ref
              EXPORTING
                im_ref = g_acplan.
    
            TRY.
                CALL METHOD g_acplan_list->save.
              CATCH cx_root INTO wl_root.
            ENDTRY.
          ENDIF.
        ENDIF.
      ENDLOOP.
    
    ENDFORM.                    " DELETE_AP
    *&---------------------------------------------------------------------*
    *&      Form  POLICY_CONV
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM policy_conv .
      SUBMIT zdm_fast_access_plan AND RETURN
        WITH p_cobj    = 'Z_SLO_PM_I_D6H'
        WITH p_dmcid   = p_ap
        WITH p_tabnam  = 'ZSLO_ING_POL_V'
        WITH p_keyfld  = 'POL_ID'
        WITH p_add4f   = 'POL_ID'
        WITH so_add4v  IN p_pol[].
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_D6H'
        WITH p_cobj    = 'Z_SLO_PM_I_D6H'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_rstrt   = '-'.
    
      SUBMIT zdm_fast_access_plan AND RETURN
       WITH p_cobj    = 'Z_SLO_PM_L_D6H'
       WITH p_dmcid   = p_ap
       WITH p_tabnam  = 'ZSLO_LFCM_POL_V'
       WITH p_keyfld  = 'PCNTR_AES_NUMBER'
       WITH p_add4f   = 'PCNTR_AES_NUMBER'
       WITH so_add4v  IN p_pol[].
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_D6H'
        WITH p_cobj    = 'Z_SLO_PM_L_D6H'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_rstrt   = '-'.
    ENDFORM.                    " POLICY_CONV
    *&---------------------------------------------------------------------*
    *&      Form  PFO_CONV_LOAD
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM pfo_conv_load .
      SUBMIT zdm_fast_access_plan  AND RETURN
        WITH p_cobj    = 'Z_SLO_ICM_LB_PFO_DDH'
        WITH p_dmcid   = p_ap
        WITH p_tabnam  = 'ZLC_PL_SERV_AGNT'
        WITH p_keyfld  = 'POLNO'
        WITH p_add4f   = 'POLNO'
        WITH p_add1f   = 'MANDT'
        WITH p_add1c   = '='
        WITH p_add1v   = p_client2
        WITH so_add4v  IN p_pol[].
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_DDH'
        WITH p_cobj    = 'Z_SLO_ICM_LB_PFO_DDH'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_behav   = '3'
        WITH p_rstrt   = '-'.
    
      SUBMIT zdm_fast_access_plan  AND RETURN
        WITH p_cobj    = 'Z_SLO_ICM_S2_SSA_DDH'
        WITH p_dmcid   = p_ap
        WITH p_tabnam  = 'ZODS_V_AGNTROLEI'
        WITH p_keyfld  = 'POLICYNO'
        WITH p_add4f   = 'POLICYNO'
        WITH p_add1f   = 'MANDT'
        WITH p_add1c   = '='
        WITH p_add1v   = p_client2
        WITH so_add4v  IN p_pol[].
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_DDH'
        WITH p_cobj    = 'Z_SLO_ICM_S2_SSA_DDH'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_behav   = '3'
        WITH p_rstrt   = '-'.
    
      SUBMIT zdm_fast_access_plan  AND RETURN
        WITH p_cobj    = 'Z_SLO_PFO_00IP_H6X'
        WITH p_dmcid   = p_ap
        WITH p_tabnam  = 'ZPM_ABQAPOLICY'
        WITH p_keyfld  = 'POLICYNR_TT'
        WITH p_add4f   = 'POLICYNR_TT'
        WITH p_add1f   = 'VERSION_ID'
        WITH p_add1c   = '='
        WITH p_add1v   = '1'
        WITH p_add2f   = 'MC'
        WITH p_add2c   = '='
        WITH p_add2v   = p_mc2
        WITH so_add4v  IN p_pol[].
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_H6X'
        WITH p_cobj    = 'Z_SLO_PFO_00IP_H6X'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_rstrt   = '-'.
    
    
      SUBMIT zdm_fast_access_plan  AND RETURN
        WITH p_cobj    = 'Z_SLO_PFO_00IS_H6X'
        WITH p_dmcid   = p_ap
        WITH p_tabnam  = 'ZPM_ABQAPOLICY'
        WITH p_keyfld  = 'POLICYNR_TT'
        WITH p_add4f   = 'POLICYNR_TT'
        WITH p_add1f   = 'MC'
        WITH p_add1c   = '='
        WITH p_add1v   = p_mc2
        WITH so_add4v  IN p_pol[].
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_H6X'
        WITH p_cobj    = 'Z_SLO_PFO_00IS_H6X'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_rstrt   = '-'.
    
      SUBMIT zdm_fast_access_plan  AND RETURN
        WITH p_cobj    = 'Z_SLO_PFO_GZO_H6X'
        WITH p_dmcid   = p_ap
        WITH p_tabnam  = 'ZPM_ABQAPOLICY'
        WITH p_keyfld  = 'POLICYNR_TT'
        WITH p_add4f   = 'POLICYNR_TT'
        WITH p_add1f   = 'VERSION_ID'
        WITH p_add1c   = '='
        WITH p_add1v   = '1'
        WITH p_add2f   = 'MC'
        WITH p_add2c   = '='
        WITH p_add2v   = p_mc2
        WITH so_add4v  IN p_pol[].
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_H6X'
        WITH p_cobj    = 'Z_SLO_PFO_GZO_H6X'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_rstrt   = '-'.
    
      DATA: ls_fixchange TYPE dmc_fixedvaluec,
            ls_temp      TYPE dmc_fixedvalue.
    
      CLEAR: ls_temp,
             ls_fixchange.
    
      SELECT * UP TO 1 ROWS
        INTO ls_temp
        FROM dmc_fixedvalue
        WHERE IDENT = 'ZSLO_XX_OBJTYPE'
        ORDER BY versio DESCENDING.
      ENDSELECT.
    
      SELECT * UP TO 1 ROWS
        INTO ls_fixchange
        FROM dmc_fixedvaluec
        WHERE guid = ls_temp-guid
        ORDER BY versio DESCENDING.
      ENDSELECT.
    
      IF ls_fixchange-fvvalue = '00IP'.
        ls_fixchange-fvvalue = '00IS'.
      ELSEIF ls_fixchange-fvvalue = '00IS'.
        ls_fixchange-fvvalue = '00IP'.
      ENDIF.
    
      MODIFY dmc_fixedvaluec FROM ls_fixchange.
      IF sy-subrc <> 0.
        MESSAGE 'Update fixvaule fail.' TYPE 'E'.
        EXIT.
      ENDIF.
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_H6X'
        WITH p_cobj    = 'Z_SLO_PFO_GZO_H6X'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_rstrt   = '-'.
    ENDFORM.                    " PFO_CONV_LOAD
    *&---------------------------------------------------------------------*
    *&      Form  POLICY_LOAD
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM policy_load .
    
      SUBMIT zdm_fast_access_plan  AND RETURN
        WITH p_cobj    = 'Z_SLO_PM_I_H6Y'
        WITH p_dmcid   = p_ap
        WITH p_tabnam  = 'ZPM_ABQAPOLICY_V'
        WITH p_keyfld  = 'POLICYNR_TT'
        WITH p_add4f   = 'POLICYNR_TT'
        WITH p_add1f   = 'MC'
        WITH p_add1c   = '='
        WITH p_add1v   = p_mc2
        WITH so_add4v  IN p_pol[].
    
      SUBMIT dmc_starter AND RETURN
        WITH p_proj    = 'ZSLO_DM'
        WITH p_sproj   = 'ZSLO_DM_H6Y'
        WITH p_cobj    = 'Z_SLO_PM_I_H6Y'
        WITH p_acplan  = p_ap
        WITH p_test    = '-'
        WITH p_rstrt   = '-'.
    ENDFORM.                    " POLICY_LOAD
  • 相关阅读:
    HttpServletRequest和HttpServletResponse
    JavaWeb核心之Servlet
    XML,,DTD
    类加载器,,,,,反射,,,,,泛型擦除,,,,, 反射配置文件
    TCP通信(单线程多线程)
    UDP与TCP协议
    多线程和线程池 和线程安全
    python os.environ 读取和设置环境变量
    Python+Pytest+Allure+Git+Jenkins接口自动化框架(纯干货)
    idea解决activiti流程图bpmn文件乱码问题
  • 原文地址:https://www.cnblogs.com/HARU/p/9635924.html
Copyright © 2020-2023  润新知