首页 > 其他分享 >ABAP:VA02销售订单保存前增强

ABAP:VA02销售订单保存前增强

时间:2022-12-19 12:55:43浏览次数:50  
标签:zsdt008 SINGLE lv 订单 ABAP ls ENDIF VA02 SELECT

VA02销售订单保存前增强:

SE38:MV45AFZZ

ENHANCEMENT 2  ZCD_SO_SAVE_CHECK.    "active version
***** ADD BY ZJ 20221026 START 检查非源头订单禁止修改
  DATA:ls_zsdt031 TYPE zsdt031,
       lv_zrfcid TYPE zrfcid,
       lt_zsdt008 TYPE TABLE OF zsdt008,
       ls_zsdt008 TYPE zsdt008.
  IF ( sy-tcode = 'VA02' OR sy-tcode = 'VA03' ).
    SELECT SINGLE * INTO ls_zsdt008 FROM zsdt008 WHERE objkey = vbak-vbeln
                                                          AND objtype = 'SO'.

    IF sy-subrc = 0.

      SELECT SINGLE objkey INTO @DATA(lv_objkey) FROM zsdt008 WHERE zrfcid = @ls_zsdt008-zrfcid
                                                                AND canum = '0010'.
      IF sy-subrc = 0.
        SELECT SINGLE bukrs INTO @DATA(lv_bukrs) FROM ekko WHERE ebeln = @lv_objkey.
        IF sy-subrc = 0.
          SELECT SINGLE zbs INTO @DATA(lv_zbs) FROM zsdt031 WHERE bukrs = @lv_bukrs
                                                              AND objtype = 'PO'.
          IF lv_zbs = 'Y'.
             IF ls_zsdt008-canum > 10.
               MESSAGE '非源头订单不能够更改' TYPE 'E'.
             ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.

*    SELECT SINGLE * FROM zsdt031 INTO ls_zsdt031 WHERE bukrs = vbak-vkorg
*                                                 AND objtype = 'SO'.
*    IF ls_zsdt031-zbs = 'Y'.
*      SELECT SINGLE * INTO ls_zsdt008 FROM zsdt008 WHERE objkey = vbak-vbeln
*                                                   AND objtype = 'SO'.
*      IF sy-subrc = 0.
*        IF ls_zsdt008-canum > 10.
*          MESSAGE '非源头订单不能够更改' TYPE 'E'.
*        ENDIF.
*      ENDIF.
*    ENDIF.
  ENDIF.

***** ADD BY ZJ 20221026 END 检查非源头订单禁止修改
ENDENHANCEMENT.

 

标签:zsdt008,SINGLE,lv,订单,ABAP,ls,ENDIF,VA02,SELECT
From: https://www.cnblogs.com/ap-ad-java-abap/p/16991891.html

相关文章

  • ABAP:VL01N增强
    VL01N增强:VL01N保存前增强:   METHODif_ex_le_shp_delivery_proc~save_document_prepare.DATA:lt_xlikpLIKELINEOFct_xlikp,"lt......
  • ABAP:MIGO收货冲销BAPI
    MIGO收货冲销BAPIFUNCTIONzsdfu014.*"----------------------------------------------------------------------*"*"本地接口:*"IMPORTING*"VALUE(I_ID)TYP......
  • ABAP:ME22N采购订单修改BAPI
    ME22N采购订单修改BAPI:FUNCTIONzsdfu015.*"----------------------------------------------------------------------*"*"本地接口:*"IMPORTING*"VALUE(I_I......
  • ABAP:VF01销售开票BAPI
    VF01销售开票BAPI:FUNCTIONzsdfu007.*"----------------------------------------------------------------------*"*"本地接口:*"IMPORTING*"VALUE(I_ID)TY......
  • ABAP:ME22N采购订单修改增强
    ME22N采购订单修改增强:BADI名称:ME_PROCESS_PO_CUST SE18找到BADI创建实施        找到对应的方法:PROCESS_HEADER:methodIF_EX_ME_PROCES......
  • ABAP:VA02销售订单修改BAPI
    VA02销售订单修改BAPIFUNCTIONzsdfu016.*"----------------------------------------------------------------------*"*"本地接口:*"IMPORTING*"VALUE(I_ID)......
  • ABAP:销售订单审批及反审函数
    销售订单审批及反审函数:DATA:ls_zsdt028TYPEzsdt028,lt_zsdt028TYPETABLEOFzsdt028,ls_zsdt008TYPEzsdt008,lt_zsdt008TYPETABLE......
  • ABAP:MIGO收货BAPI
    MIGO收货BAPI:DATA:lt_zsdt008TYPETABLEOFzsdt008,ls_zsdt008LIKELINEOFlt_zsdt008,ls_zsdt008_2LIKELINEOFlt_zsdt008,ls_z......
  • SAP ABAP CDS view 里 INNER JOIN 和 Association 的区别
    最近有朋友在我的知识星球里向我提问,SAPABAPCDSview的INNERJOIN和Association的功能可以理解为一样吗?(关于加入我的知识星球的方式,请移步本文文末)本文就来聊一......
  • Python数据分析5大经典练手项目之项目一(餐厅订单数据分析)【待完结】
    环境:shell工具:gitbash(自行下载),对比cmd:几乎接近linux命令jupyterlab是jupyternotebook升级版实操:桌面右键点击gitbashhere进入mingw64界面输入jupyterlab进入......