Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7189423
  • 博文数量: 655
  • 博客积分: 10264
  • 博客等级: 上将
  • 技术积分: 8278
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-04 17:47
个人简介

ABAP顾问

文章分类

全部博文(655)

文章存档

2017年(2)

2014年(8)

2013年(3)

2012年(2)

2011年(18)

2010年(102)

2009年(137)

2008年(274)

2007年(134)

分类:

2007-11-22 10:09:01

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.
阅读(15281) | 评论(8) | 转发(1) |
给主人留下些什么吧!~~

chinaunix网友2008-01-09 17:37:25

errrr, 二楼的老兄正解