MM Enhancement ZXM06U42 之二

*for COD can not input the same material No. in one PO
    if i_ekpo-werks = 'PLCC' or i_ekpo-werks = 'PLCD' or
       i_ekpo-werks = 'PXEA' or i_ekpo-werks = 'PXEB'  .
      loop at tekpo .
        if tekpo-matnr eq i_ekpo-matnr and
           tekpo-ebelp ne i_ekpo-ebelp  .
          message e004(zmm) with
           ' Can not input the same part No. in one PO items!' .
        endif .
      endloop.
 
    data : l_userip like usr41-terminal.
    data : l_ekgrp like zmmidip-ekgrp,
           l_werks1 like ekpo-werks.
    data : l_ip like usr41-terminal,
           l_name like usr41-terminal.
    case syst-tcode.
    when 'ME22N' or 'ME32L' or 'ME38' or 'ME31L' or 'ME21N'.
        select single werks into l_werks1 from ekpo
           where ebeln = i_ekko-ebeln.
        select single * from zmmplant where
           werks = l_werks1 and zzflag1 = 'Y'.
        if sy-subrc eq 0.
          call function 'TERMINAL_ID_GET'
               exporting
                    username             = sy-uname
               importing
                    terminal             = l_userip
               exceptions
                    multiple_terminal_id = 1
                    no_terminal_found    = 2
                    others               = 3.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          else.
            split l_userip at '-' into l_ip l_name.
          endif.
          translate l_name to upper case.
          select single * from zmmidip
              where ekgrp = i_ekko-ekgrp.
          if sy-subrc eq 0.
            select single * from zmmidip
               where ekgrp = i_ekko-ekgrp and
                 zuserip = l_name and zzflag = 'Y'.
            if sy-subrc ne 0.
              message e004(zmm) with l_name i_ekko-ekgrp
                        'has no auth to change PO,please check it!' .
            endif.
          endif.
        endif.

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

转载于:http://blog.itpub.net/15117617/viewspace-618331/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值