zoukankan      html  css  js  c++  java
  • SAP采购订单审批记录增强

    采购订单审核函数:

    BAPI_PO_RELEASE

    结尾加上

    ENHANCEMENT 1  ZME28_PO.    "active version
    DATA:LS_EKKO TYPE EKKO.
    DATA:LS_ZEKKOADD TYPE ZEKKOADD.
    CLEAR:LS_EKKO,LS_ZEKKOADD.
    SELECT SINGLE * INTO LS_ZEKKOADD FROM ZEKKOADD WHERE EBELN = PURCHASEORDER.
    SELECT SINGLE * INTO LS_EKKO FROM EKKO WHERE EBELN = PURCHASEORDER.
      IF SY-SUBRC = 0.
        IF LS_ZEKKOADD IS INITIAL.
          LS_ZEKKOADD-EBELN = LS_EKKO-EBELN.
          LS_ZEKKOADD-FRGGR = LS_EKKO-FRGGR.
          LS_ZEKKOADD-FRGSX = LS_EKKO-FRGSX.
           IF LS_EKKO-FRGSX = 'ZB'."三级审批
              IF PO_REL_CODE = 'ZY'.
                LS_ZEKKOADD-FRGKE = '2'.
                LS_ZEKKOADD-BNAME = SY-UNAME.
                LS_ZEKKOADD-BDATE = SY-DATUM.
                LS_ZEKKOADD-BTIME = SY-UZEIT.
              ELSEIF PO_REL_CODE = 'ZZ'.
                LS_ZEKKOADD-FRGKE = '3'.
                LS_ZEKKOADD-CNAME = SY-UNAME.
                LS_ZEKKOADD-CDATE = SY-DATUM.
                LS_ZEKKOADD-CTIME = SY-UZEIT.
              ELSEIF PO_REL_CODE = 'ZX'.
                LS_ZEKKOADD-FRGKE = '1'.
                LS_ZEKKOADD-ANAME = SY-UNAME.
                LS_ZEKKOADD-ADATE = SY-DATUM.
                LS_ZEKKOADD-ATIME = SY-UZEIT.
              ENDIF.
           ELSEIF LS_EKKO-FRGSX = 'ZC'."2级审批
              IF PO_REL_CODE = 'ZX'.
                LS_ZEKKOADD-FRGKE = '1'.
                LS_ZEKKOADD-ANAME = SY-UNAME.
                LS_ZEKKOADD-ADATE = SY-DATUM.
                LS_ZEKKOADD-ATIME = SY-UZEIT.
              ELSEIF PO_REL_CODE = 'ZY'.
                LS_ZEKKOADD-FRGKE = '3'.
                LS_ZEKKOADD-CNAME = SY-UNAME.
                LS_ZEKKOADD-CDATE = SY-DATUM.
                LS_ZEKKOADD-CTIME = SY-UZEIT.
              ENDIF.
            ENDIF.
             MODIFY ZEKKOADD FROM LS_ZEKKOADD.
          ELSE.
            IF LS_EKKO-FRGSX = 'ZB'."三级审批
                IF PO_REL_CODE = 'ZY'.
                UPDATE ZEKKOADD SET FRGKE = '2'
                                    BNAME = SY-UNAME
                                    BDATE = SY-DATUM
                                    BTIME = SY-UZEIT
                                    WHERE EBELN = PURCHASEORDER.
                ELSEIF PO_REL_CODE = 'ZZ'.
                UPDATE ZEKKOADD SET FRGKE = '3'
                                    CNAME = SY-UNAME
                                    CDATE = SY-DATUM
                                    CTIME = SY-UZEIT
                                    WHERE EBELN = PURCHASEORDER.
                ELSEIF PO_REL_CODE = 'ZX'.
                UPDATE ZEKKOADD SET FRGKE = '1'
                                    ANAME = SY-UNAME
                                    ADATE = SY-DATUM
                                    ATIME = SY-UZEIT
                                    WHERE EBELN = PURCHASEORDER.
                ENDIF.
    
              ELSEIF LS_EKKO-FRGSX = 'ZC'."2级审批
              IF PO_REL_CODE = 'ZX'.
                UPDATE ZEKKOADD SET FRGKE = '1'
                                    ANAME = SY-UNAME
                                    ADATE = SY-DATUM
                                    ATIME = SY-UZEIT
                                    WHERE EBELN = PURCHASEORDER.
                ELSEIF PO_REL_CODE = 'ZY'.
                UPDATE ZEKKOADD SET FRGKE = '3'
                                    CNAME = SY-UNAME
                                    CDATE = SY-DATUM
                                    CTIME = SY-UZEIT
                                    WHERE EBELN = PURCHASEORDER.
              ENDIF.
              ENDIF.
            ENDIF.
      ENDIF.
    
    ENDENHANCEMENT.
  • 相关阅读:
    每天学习算法二
    每天学习算法 一
    数据量基础
    SQL server数据库创建代码,filegroup文件组修改,
    SQL学习笔记之 数据库基础(一)
    Oracle的查询-条件表达式
    Oracle的查询-单行查询
    Oracle 的查询-scott用户介绍
    Oracle的基本操作-序列的使用
    Oracle的基本操作-修改表结构、数据的增删改查
  • 原文地址:https://www.cnblogs.com/sapSB/p/5482721.html
Copyright © 2011-2022 走看看