ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 增强

增强

原创 Linux操作系统 作者:103104521 时间:2013-01-08 10:32:09 0 删除 编辑

MCS50001

 
EXIT_SAPLMCS5_001 :SIS: User Exit for Deliveries - Header Data
EXIT_SAPLMCS5_002 :SIS: User Exit for Deliveries - Item Data
 
例子:
EXIT_SAPLMCS5_002 :
 
DATA: wa_werks LIKE zsd0004_td.
SELECT SINGLE * INTO wa_werks
  FROM zsd0004_td
    WHERE werks = i_xmclips-werks
      AND budat <= sy-datum.
IF sy-subrc = 0.
  IF sy-tcode = ‘VL01N’ OR sy-tcode = ‘VL01′.
    IF sy-ucomm = ‘WABU_T’.
      MESSAGE a398(00) WITH ‘VL01N不能发货过帐,只能保存!’.
    ENDIF.
  ENDIF.
  IF sy-tcode = ‘VL01N’ OR
     sy-tcode = ‘VL01′ .
    IF i_xmclikp-wadat_ist = ‘00000000′.
      MESSAGE a398(00) WITH ‘请填写–实际发货日期’.
    ENDIF.
  ENDIF.
ENDIF.
 
 
DATA: s_cmpre LIKE vbap-cmpre,    “订单金额
      o_zflag TYPE c.
DATA:BEGIN OF lt_vbap OCCURS 0,
        kwmeng LIKE vbap-kwmeng,
        cmpre LIKE vbap-cmpre,
     END OF lt_vbap.
DATA: BEGIN OF it_konv OCCURS 0,
        knumv LIKE konv-knumv,
        kposn LIKE konv-kposn,
        kawrt LIKE konv-kawrt,
END OF it_konv.
** SO 的金额
CLEAR: s_cmpre, lt_vbap[].
SELECT kwmeng cmpre INTO TABLE lt_vbap FROM vbap
                    WHERE vbeln = i_xmcvbap-vbeln.
*LOOP AT lt_vbap.
*  s_cmpre = s_cmpre + lt_vbap-kwmeng * lt_vbap-cmpre.
*ENDLOOP.
DATA: l_knumv LIKE konv-knumv.
CLEAR l_knumv.
SELECT SINGLE knumv INTO l_knumv
  FROM vbak
    WHERE vbeln = i_xmcvbap-vbeln.
SELECT knumv kposn kawrt
  INTO TABLE it_konv
    FROM konv
      WHERE knumv = l_knumv
        AND kschl = ‘MWSI’.
LOOP AT it_konv.
  s_cmpre = s_cmpre + it_konv-kawrt.
ENDLOOP.
CALL FUNCTION ‘Z_CHECK_SO’
     EXPORTING
          i_vbeln = i_xmcvbap-vbeln
          i_kunnr = i_xmclikp-kunnr
          i_werks = i_xmclips-werks
          i_gjahr = i_xmclikp-lfdat(4)
          i_datum = i_xmcvbap-erdat
          i_dmbtr = s_cmpre
     IMPORTING
          o_zflag = o_zflag.
IF o_zflag = ‘X’.
  MESSAGE a398(00) WITH ‘订单’ i_xmcvbap-vbeln
                   ‘订金没有完全交付,不能保存过账!’.
ENDIF.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13973563/viewspace-752287/,如需转载,请注明出处,否则将追究法律责任。

上一篇: alv跟值变动
下一篇: sap fi学习
请登录后发表评论 登录
全部评论

注册时间:2011-03-30

  • 博文量
    18
  • 访问量
    21280