ITPub博客

首页 > Linux操作系统 > Linux操作系统 > MM Enhancement ZXM06U42 之二

MM Enhancement ZXM06U42 之二

原创 Linux操作系统 作者:ytfsrs2008 时间:2009-11-07 10:34:06 0 删除 编辑
*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博客 ” ,链接:https://blog.itpub.net/15117617/viewspace-618331/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: OLE上传EXCEL
请登录后发表评论 登录
全部评论

注册时间:2008-10-31

  • 博文量
    52
  • 访问量
    63015