zoukankan      html  css  js  c++  java
  • ABAP触发BW处理链

    *&---------------------------------------------------------------------*
    *& Report ZWEIGHT
    *&---------------------------------------------------------------------*
    *&
    *&---------------------------------------------------------------------*
    REPORT zweight.
    DATA:e_msg(255).
    DATA:rt_domvalues TYPE RANGE OF matnr.
    DATA: lv_return    TYPE sy-subrc,
          i_dom_apstt  TYPE STANDARD TABLE OF dd07v,
          lv_wa_domtab TYPE dd07v.
    DATA: e_logid  TYPE    rspc_logid.
    DATA: rs_status  TYPE    rspc_state.
    DATA: p_chain TYPE rspc_chain .
    DATA:e_manual_abort TYPE rspc_manual_abort.
    DATA:e_message TYPE so_text255.
    DATA:e_s_message TYPE rspc_s_msg.
    DATA:lv_result(255).
    PARAMETERS: p_run   RADIOBUTTON GROUP sr1.
    PARAMETERS: p_check RADIOBUTTON GROUP sr1.
    *&---------------------------------------------------------------------*
    IF i_dom_apstt IS INITIAL.
      CALL FUNCTION 'DD_DOMVALUES_GET'
        EXPORTING
          domname        = 'RSPC_STATE'   "域名
          text           = 'X'
          langu          = sy-langu
        IMPORTING
          rc             = lv_return
        TABLES
          dd07v_tab      = i_dom_apstt
        EXCEPTIONS
          wrong_textflag = 1
          OTHERS         = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDIF.
    rt_domvalues = VALUE #( FOR line IN i_dom_apstt ( sign = 'I' option = 'EQ' low = line-domvalue_l high = line-ddtext ) ).
    *&---------------------------------------------------------------------*
    p_chain  = 'ZBPC_WM_IM' .
    
    IF p_run EQ 'X'.
      CALL FUNCTION 'RSPC_API_CHAIN_START'
        EXPORTING
          i_chain = p_chain
    *     I_T_FOR_PROCESS          =
    *     I_T_VARIABLES            =
    *     I_SYNCHRONOUS            =
    *     I_SIMULATE               =
    *     I_NOPLAN                 =
    *     I_DONT_WAIT              =
    *     I_POLL  =
    *     I_GUI   =
        IMPORTING
          e_logid = e_logid
    *     E_T_PROCESS_FAILED       =
        EXCEPTIONS
          failed  = 1
          OTHERS  = 2.
      IF sy-subrc <> 0.
    * Implement suitable error handling here
      ENDIF.
    ENDIF.
    *&---------------------------------------------------------------------*
    IF p_check EQ 'X'.
      CALL FUNCTION 'RSPC_API_CHAIN_GET_STATUS'
        EXPORTING
          i_chain        = p_chain
          i_logid        = e_logid
    *     I_DONT_UPDATE  =
    *     I_DONT_POLL    =
        IMPORTING
          e_status       = rs_status
          e_manual_abort = e_manual_abort
          e_message      = e_message
          e_s_message    = e_s_message.
      IF sy-subrc <> 0.
        lv_result = e_manual_abort && e_message  .
      ELSE.
        IF line_exists( rt_domvalues[ low =  rs_status ] ).
          lv_result = rt_domvalues[ line_index( rt_domvalues[ low = rs_status ] ) ]-high  .
        ENDIF.
      ENDIF.
        WRITE:  lv_result.
    ENDIF.
    *&---------------------------------------------------------------------*
    *e_msg = REDUCE bapi_msg( INIT s = CONV string( e_msg )
    *         FOR  ls_return IN i_dom_apstt
    *         NEXT s = s && |{ ls_return-ddtext };| ) .
    BREAK-POINT.
  • 相关阅读:
    图的最大匹配算法
    二分图的最小顶点覆盖 最大独立集 最大团
    后缀数组:倍增法和DC3的简单理解
    后缀自动机浅析
    微积分学习笔记一:极限 导数 微分
    微积分学习笔记二
    微积分学习笔记三:定积分
    微积分学习笔记四:空间向量基础
    微积分学习笔记五:多元函数微积分
    程序员之路--回顾2015,展望2016
  • 原文地址:https://www.cnblogs.com/ckstock/p/12107487.html
Copyright © 2011-2022 走看看