码迷,mamicode.com
首页 > 其他好文 > 详细

SAP采购订单审批记录增强

时间:2016-05-11 18:02:49      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:

 

 

 

采购订单审核函数:

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.

 

SAP采购订单审批记录增强

标签:

原文地址:http://www.cnblogs.com/sapSB/p/5482721.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!