• 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.
  • 相关阅读:
    IO流(读取键盘录入)
    IO 流 自定义字节流的缓冲区-read 和write 的特点
    IO流 字节流的缓冲区
    IO流 拷贝图片
    IO流-字节流File读写操作
    IO流 带行号的缓冲区
    IO流(装饰设计模式)
    IO流-ReadLine方法的原理 自定义BufferedReader
    IO流 Buffered 综合练习
    IO流 BufferedWriter
  • 原文地址:https://www.cnblogs.com/sapSB/p/5482721.html
Copyright © 2020-2023  润新知