首页 > 其他分享 >采购信息记录

采购信息记录

时间:2024-07-10 16:57:50浏览次数:15  
标签:einex gt 记录 信息 lt ls tab 采购 eine

1、前台创建

事务代码:ME11

采购信息记录一般数据

采购组织数据

条件

2、BAPI创建

调用BAPI:ME_INFORECORD_MAINTAIN

"--------------------@斌将军--------------------

DATA: lv_flag      TYPE char1,
      ls_eina      TYPE mewieina,
      ls_eine      TYPE mewieine,
      ls_einax     TYPE mewieinax,
      ls_einex     TYPE mewieinex,
      lt_txt       TYPE mewipirtext_t,
      ls_txt       TYPE mewipirtext,
      lt_validity  TYPE TABLE OF mewivalidity,
      ls_validity  TYPE  mewivalidity,
      lt_condition TYPE TABLE OF mewicondition,
      ls_condition TYPE  mewicondition,
      lt_value     TYPE TABLE OF mewiscaleval,
      ls_value     TYPE  mewiscaleval,
      lt_quan      TYPE TABLE OF mewiscalequan,
      ls_quan      TYPE  mewiscalequan,
      ls_eina1     LIKE mewieina,
      ls_eine1     LIKE mewieine,
      ls_return    TYPE bapireturn,
      lt_return    TYPE mewi_t_return.

DATA: lv_infnr   TYPE infnr,
      lv_check   TYPE char1,
      lv_message TYPE char255.

CLEAR: lv_flag,ls_eina,ls_einax,ls_eine,ls_einex,
       lt_txt,ls_txt,lt_validity,ls_validity,lt_condition,ls_condition,
       lt_value,ls_value,lt_quan,ls_quan,
       ls_eina1,ls_eine1,ls_return,lt_return.

"查询采购信息记录是否存在
SELECT SINGLE
  eina~infnr
INTO lv_infnr
FROM eina
JOIN eine ON eina~infnr = eine~infnr
WHERE eina~lifnr = '0010000792'
  AND eina~matnr = '000000001010008955'
  AND eine~ekorg = '3060'
  AND eine~esokz = '0'
  AND eine~werks = '3060'.
IF sy-subrc <> 0.
  lv_flag = 'I'.

  "查看是否有信息记录基础数据
  SELECT SINGLE
    infnr
  FROM eina
  INTO lv_infnr
  WHERE lifnr = '0010000792'
    AND matnr = '000000001010008955'.
  IF sy-subrc = 0.
    ls_eina-info_rec  = lv_infnr.
  ENDIF.

ELSE.
  lv_flag = 'U'.
  ls_eina-info_rec  = lv_infnr.
  ls_eine-info_rec  = lv_infnr.
  ls_einex-info_rec = 'X'.
ENDIF.

*采购信息记录 - 一般数据
ls_eina-vendor    = '0010000792'."gt_tab-lifnr. "供应商
ls_eina-material  = '000000001010008955'."gt_tab-matnr. "物料
ls_eina-po_unit   = 'BOT'."gt_tab-meins. "订单计量单位
*ls_eina-conv_num1 = ''."gt_tab-umrez. "单位转换的分子
*ls_eina-conv_den1 = ''."gt_tab-umren. "单位转换的分母

ls_einax-vendor     = 'X'.
ls_einax-material   = 'X'.
ls_einax-po_unit   = 'X'.
*ls_einax-conv_num1   = 'X'.
*ls_einax-conv_den1   = 'X'.


*采购信息记录 - 采购组织数据
ls_eine-info_type  = '0'."gt_tab-esokz. "信息记录类别
ls_eine-purch_org  = '3060'."gt_tab-ekorg. "采购组织
ls_eine-plant      = '3060'."gt_tab-werks. "工厂
ls_eine-pur_group  = '100'."gt_tab-ekgrp. "采购组
ls_eine-gr_basediv = 'X'."gt_tab-webre. "标识:基于收货的发票验证
ls_eine-nrm_po_qty = '1'."gt_tab-norbm. "标准采购订单数量
ls_eine-min_po_qty = ''."gt_tab-minbm. "最小订单数量
ls_eine-max_po_qty = ''."gt_tab-bstma. "最大订单数量
ls_eine-net_price  = '10'."gt_tab-netpr. "净价
ls_eine-currency   = 'CNY'."gt_tab-waers. "币别
ls_eine-price_unit = '1'."gt_tab-peinh. "价格单位
ls_eine-orderpr_un = 'BOT'."gt_tab-meins. "订单计量单位
ls_eine-conv_num1     = '1'."1. "gt_tab-umrez. "单位转换的分子
ls_eine-conv_den1  = '1'."1. "gt_tab-umren. "单位转换的分母
ls_eine-tax_code   = ''."gt_tab-mwskz. "税码
ls_eine-overdeltol = ''."gt_tab-uebto. "过量交货容差
ls_eine-under_tol  = ''."gt_tab-untto. "交货不足容差
ls_eine-conf_ctrl  = ''."gt_tab-bstae. "确认控制代码
ls_eine-ackn_reqd  = ''."gt_tab-kzabs. "供应商需要确认订单

ls_einex-info_type  = 'X'.
ls_einex-purch_org  = 'X'.
ls_einex-plant      = 'X'.
ls_einex-pur_group  = 'X'.
ls_einex-gr_basediv = 'X'.
ls_einex-nrm_po_qty = 'X'.
ls_einex-min_po_qty = 'X'.
ls_einex-max_po_qty = 'X'.
*ls_einex-net_price = 'X'."此处不能打X
ls_einex-currency   = 'X'.
ls_einex-price_unit = 'X'.
ls_einex-orderpr_un = 'X'.
ls_einex-conv_num1  = 'X'.
ls_einex-conv_den1  = 'X'.
ls_einex-tax_code   = 'X'.
ls_einex-overdeltol = 'X'.
ls_einex-under_tol  = 'X'.
ls_einex-conf_ctrl  = 'X'.
ls_einex-ackn_reqd  = 'X'.

lt_validity = VALUE #( ( plant      = '3060'"gt_tab-werks
                         valid_from = '20240620'"gt_tab-datab
                         valid_to   = '99991231'"gt_tab-datbi
                         ) ).

lt_condition = VALUE #( ( cond_count    = 1
                          cond_type     = 'PB00'"gt_tab-kschl
                          cond_value    = '10'"gt_tab-netpr
                          currency      = 'CNY'"gt_tab-waers
                          cond_p_unt    = '1'"gt_tab-peinh
                          cond_unit     = 'BOT'"gt_tab-meins
                          calctypcon    = 'C'           "计算类型
                          vendor_no     = '0010000792'"gt_tab-lifnr
                          change_id     = lv_flag ) ).

"阶梯价
*    IF gt_tab-kstb1 IS NOT INITIAL.
*      CLEAR: lt_condition.
*      lt_condition = VALUE #( ( cond_count    = 1
*                                cond_type     = gt_tab-kschl
*                                scale_type    = 'A'           "等级类型
*                                scale_base_ty = 'C'           "等级基础类型
*                                scale_unit    = gt_tab-meins  "条件等级计量单位
*                                calctypcon    = 'C'           "计算类型
*                                cond_value    = gt_tab-netpr
*                                currency      = gt_tab-waers
*                                cond_p_unt    = gt_tab-peinh
*                                cond_unit     = gt_tab-meins
*                                vendor_no     = gt_tab-lifnr
*                                change_id     = lv_flag ) ).
*
*      ls_quan-cond_count = 1.
*      ls_quan-line_no = 1.
*      ls_quan-scale_base_qty = '1'."gt_tab-kstb1.
*      ls_quan-cond_value = '10'."gt_tab-kbet1.
*      APPEND ls_quan TO lt_quan.
*      CLEAR ls_quan.
*    ENDIF.
*
*    IF gt_tab-kstb2 IS NOT INITIAL.
*      ls_quan-cond_count = 1.
*      ls_quan-line_no = 2.
*      ls_quan-scale_base_qty = gt_tab-kstb2.
*      ls_quan-cond_value = gt_tab-kbet2.
*      APPEND ls_quan TO lt_quan.
*      CLEAR ls_quan.
*    ENDIF.

"BAPI
CALL FUNCTION 'ME_INFORECORD_MAINTAIN'
  EXPORTING
    i_eina        = ls_eina
    i_einax       = ls_einax
    i_eine        = ls_eine
    i_einex       = ls_einex
  IMPORTING
    e_eina        = ls_eina1
    e_eine        = ls_eine1
  TABLES
    txt_lines     = lt_txt
    cond_validity = lt_validity
    condition     = lt_condition
*   cond_scale_value = lt_value
*   cond_scale_quan  = lt_quan
    return        = lt_return.

CLEAR:lv_message.
LOOP AT lt_return INTO ls_return WHERE type CA 'EXA'.
  lv_message = lv_message && '&' && ls_return-message.
ENDLOOP.
IF sy-subrc = 0 OR ls_eina1-info_rec IS INITIAL.
  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ELSE.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = 'X'.

  lv_message = '采购信息记录' && ls_eina1-info_rec && '创建成功'.
  WRITE:lv_message.

ENDIF.
"--------------------@斌将军--------------------

 

定期更文,欢迎关注

 

 

 

 

 

    TRANSLATE with x English
Arabic Hebrew Polish
Bulgarian Hindi Portuguese
Catalan Hmong Daw Romanian
Chinese Simplified Hungarian Russian
Chinese Traditional Indonesian Slovak
Czech Italian Slovenian
Danish Japanese Spanish
Dutch Klingon Swedish
English Korean Thai
Estonian Latvian Turkish
Finnish Lithuanian Ukrainian
French Malay Urdu
German Maltese Vietnamese
Greek Norwegian Welsh
Haitian Creole Persian  
  TRANSLATE with COPY THE URL BELOW Back EMBED THE SNIPPET BELOW IN YOUR SITE Enable collaborative features and customize widget: Bing Webmaster Portal Back     此页面的语言为加泰罗尼亚语   翻译为中文(简体)          

标签:einex,gt,记录,信息,lt,ls,tab,采购,eine
From: https://www.cnblogs.com/BinGeneral/p/18293936

相关文章

  • 推送单据信息到第三方系统(NC65)
    此处以预付款申请单推动付款结算单到NC系统为例 目录一、Action二、Service三、ServiceImpl四、 FcVoucherUtil的 settlementXML方法(json转xml的方法)五、 FcVoucherUtil的doPost方法(推送NC的方法)一、ActionpublicActionFormgetZhiwu(ActionMapping......
  • 信息收集-导航
    信息收集1、谷歌语法:帮助我们更好的检索有用信息https://www.cnblogs.com/wyw-star/p/182930402、域名SubfinderOneforallSubdomain3、敏感目录7kbscan御剑IhoneyBakFileScanModify:git文件扫描4、端口分析1~655351~1w1w~3w3w以上大端口naabuyakitmsscan5......
  • springboot项目一直在打印Redis链接信息Reconnecting, last destination was
    控制台打印如下:15:03:26.279[lettuce-eventExecutorLoop-1-4]INFOi.l.c.p.ConnectionWatchdog-[log,171]-Reconnecting,lastdestinationwas/192.168.0.6:637915:03:26.282[lettuce-nioEventLoop-4-2]INFOi.l.c.p.ReconnectionHandler-[lambda$null$3,174]-Rec......
  • .Net Core WebApi项目 Development模式下报错 System.InvalidOperationException 解决
    .NetCoreWebApi项目Development模式下报错System.InvalidOperationException:“Cannotresolvescopedservice'Microsoft.Extensions.Options.IOptionsSnapshot`1[Infrastructure.OptionsSetting]'fromrootprovider.” 但是在Production模式下,运行正常因为未设置的......
  • Linux捣鼓记录:快速搭建alist+aria2+qbittorrent
    简介:使用docker-compose创建alistaria2qbittorrent服务,前置条件安装docker及docker-compose插件,docker镜像仓库访问不了,建议配置代理用来拉取镜像。一、确认路径,确认UIDGID,确认端口路径alist挂载路径:-/home/dalong/app/alist:/opt/alist/data-/home/dalong:/homearia......
  • JDBC学习记录3-数据库连接池
    JDBC学习记录3-数据库连接池以此记录自己的学习过程JDBC全称:JavaDataBaseConnectivityJDBC学习的是使用Java语言来操作关系型数据库的一套API。2024年7月10日11:13:04简单了解JDBC学习记录1-入门-CSDN博客JDBC学习记录2-API详解-CSDN博客四、数据库连接池和Drui......
  • JavaScript复习记录(2)— 浅拷贝&深拷贝
    1、前情概要1.1、基本数据类型    Number、String、Boolean、Null、Undefined、Symbol、BigInt。基本数据类型是直接存储在栈中的数据。1.2、引用数据类型    Object、Array、Function、Date、RegExp、Map、Set、WeekMap、WeekSet、Promise、Error、Buffe......
  • 命令行帮助信息、手动和交互执行
    一、方式一1、先定义一个命令行解析类classCommandLineParser:def__init__(self):self.arguments={}self.valid_options={"help","mode","interval","export","wave_data_export","......
  • 信息搜集技术和取证隐写前置技术
    信息搜集技术网络信息搜集技巧公开渠道目标Web网页、地理位置、相关组织组织结构和人员、个人资料、电话、电子邮件网络配置、安全防护机制的策略和技术细节通过搜索引擎查找特定安全漏洞或私密信息的方法GoogleHackingDatabase基本搜索技巧Google基本搜索与挖掘......
  • UFM以及DPU工作过程记录
     [root@nms1~]#history|awk'{$1="";printsubstr($0,2)}'ethtool-ieno2ls-lipaethtool-ienp193s0ethtool-ieno2ls-l/sys/class/netudevadminfo--query=all--name=eno2udevadminfo--query=alludevadminfo--query=all-neno2udeva......