PO BAPI "BAPI_PO_CREATE1"
DATA: poheader LIKE bapimepoheader,
poheaderx LIKE bapimepoheaderx,
poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE,
poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE,
poschedule LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE,
poschedulex LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE,
pomepocond LIKE bapimepocond OCCURS 0 WITH HEADER LINE,
pomepocondx LIKE bapimepocondx OCCURS 0 WITH HEADER LINE,
potextitem LIKE bapiekpotx OCCURS 0 WITH HEADER LINE.
CLEAR: poheader, poheaderx, poitem, poitemx,
poschedule, poschedulex, pomepocond, pomepocondx, potextitem,
return.
REFRESH: poitem, poitemx, poschedule ,poschedulex, pomepocond, pomepocondx, potextitem, return.
DATA: t_ebelp LIKE ekpo-ebelp.
*****PO HEAD
poheader-comp_code = po_head-comp_code.
poheader-doc_type = 'Z3'.
poheader-vendor = po_head-lifnr.
poheader-purch_org = po_head-purch_org.
poheader-pur_group = po_head-pur_group.
poheader-doc_date = po_head-bedat. "凭证日期
poheaderx-comp_code = 'X'.
poheaderx-doc_type = 'X'.
poheaderx-vendor = 'X'.
poheaderx-purch_org = 'X'.
poheaderx-pur_group = 'X'.
poheaderx-doc_date = 'X'.
*-----PO item
CLEAR: t_ebelp.
LOOP AT po_item.
poitem-po_item = t_ebelp + '10'.
t_ebelp = poitem-po_item.
poitem-material = po_item-matnr.
poitem-plant = po_item-werks.
poitem-stge_loc = po_item-lgort.
poitem-quantity = po_item-menge.
poitem-po_unit = po_item-meins.
poitem-net_price = po_item-price.
poitem-price_unit = po_item-price_unit.
poitem-po_price = '1'.
poitem-info_rec = po_item-info_rec.
poitem-bras_nbm = po_item-sb_no.
poitem-val_type = po_item-lgort.
poitem-preq_name = po_item-afnam. "申请者
poitem-trackingno = po_item-trackingno.
poitem-plan_del = po_item-plan_del.
poitem-tax_code = po_item-tax_code. "税码
APPEND poitem.
CLEAR: poitem.
poitemx-po_item = t_ebelp.
poitemx-delete_ind = 'X'.
poitemx-material = 'X'.
poitemx-plant = 'X'.
poitemx-stge_loc = 'X'.
poitemx-quantity = 'X'.
poitemx-po_unit = 'X'.
poitemx-net_price = 'X'.
poitemx-price_unit = 'X'.
poitemx-po_price = 'X'.
poitemx-info_rec = 'X'.
poitemx-bras_nbm = 'X'.
poitemx-val_type = 'X'.
poitemx-preq_name = 'X'. "申请者
poitemx-trackingno = 'X'.
poitemx-plan_del = 'X'.
poitemx-tax_code = 'X'. "税码
APPEND poitemx.
CLEAR: poitemx.
poschedule-po_item = t_ebelp.
poschedule-sched_line = 1.
poschedule-quantity = po_item-menge.
poschedule-delivery_date = po_item-delivery_date.
APPEND poschedule.
CLEAR: poschedule.
poschedulex-po_item = t_ebelp.
poschedulex-sched_line = 1.
poschedulex-quantity = 'X'.
poschedulex-delivery_date = 'X'.
APPEND poschedulex.
CLEAR: poschedulex.
potextitem-po_item = t_ebelp.
potextitem-text_id = 'F01'.
potextitem-text_line = po_item-text_line.
APPEND potextitem.
CLEAR: potextitem.
*-------加税
pomepocond-itm_number = t_ebelp.
pomepocond-condition_no = '00001'.
pomepocond-cond_type = 'PBXX'.
pomepocond-cond_value = po_item-price.
pomepocond-cond_p_unt = po_item-price_unit.
pomepocond-currency = 'RMB'.
pomepocond-change_id = 'U'.
APPEND pomepocond.
CLEAR: pomepocond.
pomepocondx-itm_number = t_ebelp.
pomepocondx-condition_no = '00001'.
pomepocondx-cond_type = 'X'.
pomepocondx-cond_value = 'X'.
pomepocondx-cond_p_unt = 'X'.
pomepocondx-currency = 'X'.
pomepocondx-change_id = 'X'.
APPEND pomepocondx.
CLEAR: pomepocondx.
pomepocond-itm_number = t_ebelp.
pomepocond-condition_no = '00001'.
pomepocond-cond_type = 'ZVAT'.
pomepocond-cond_value = po_item-cond_value.
pomepocond-currency = '%'.
pomepocond-change_id = 'U'.
APPEND pomepocond.
CLEAR: pomepocond.
pomepocondx-itm_number = t_ebelp.
pomepocondx-condition_no = '00001'.
pomepocondx-cond_type = 'X'.
pomepocondx-cond_value = 'X'.
pomepocondx-currency = 'X'.
pomepocondx-change_id = 'X'.
APPEND pomepocondx.
CLEAR: pomepocondx.
ENDLOOP.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = poheader
poheaderx = poheaderx
memory_complete = flag_temp
IMPORTING
exppurchaseorder = ebeln
TABLES
return = return
poitem = poitem
poitemx = poitemx
poschedule = poschedule
poschedulex = poschedulex
pocond = pomepocond
pocondx = pomepocondx
potextitem = potextitem.
READ TABLE return WITH KEY type = 'E'.
IF sy-subrc = 0. "有出错信息
LOOP AT return WHERE type = 'E'.
CONCATENATE e_message ',' return-message INTO e_message.
CONDENSE e_message.
ENDLOOP.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
WAIT UP TO 2 SECONDS.
ENDIF.
PO BAPI "BAPI_PO_CREATE1"的更多相关文章
- 创建服务类PO
转载:https://blogs.sap.com/2014/03/04/creating-a-simple-service-po-using-bapipocreate1bapipochange/ Cr ...
- SAP交货单过账自动生产采购订单、采购订单自动收货入库
公司间需要买卖操作,由于发货和收货都是同一批人在操作,为了减少业务人员的工作量,提高工作效率,特实现以上功能 1.增强实现:增强点为交货单过账成功时触发,在提交前触发,如果遇到不可预知问题,可能造成数 ...
- 使用bapi创建PO遇到问题(BAPI_PO_CREATE1
今天用 BAPI_PO_CREATE1创建po. 注意事项: vendor 供应商号:长度必须和系统一致,10位.如 2000025要写成 0002000025传递给参数. POITEM 中的 PO_ ...
- BAPI_PO_CREATE1 创建PO ch_memory_complete = ‘x',导致hold on 解决方案,
1.尝试注释标准逻辑,看会不会有什么问题, ZME_BAPI_PO_CUST IF_EX_ME_BAPI_PO_CREATE_02~INBOUND 里面有个控制很费解 我给注释了 2.改用 BAPI_ ...
- BAPI创建PO,禁止净价信息更新
大家都知道创建PO时,我们如果勾选了"信息更新",则该PO保存后相应的信息记录会把这个PO更新为其最后的凭证,那么这张PO的净价会作为下次创建新PO时净价的默认值. 这样我们设置的 ...
- [SAP ABAP开发技术总结]业务对象和BAPI
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- BAPI 使用
BAPI_ACC_DOCUMENT_POST *---BAPI_ACC_DOCUMENT_POST 所需要的参数 DATA: OBJ_TYPE LIKE BAPIACHE09-OBJ_TYPE, ...
- BAPI
MM模块 1. BAPI_MATERIAL_SAVEDATA 创建物料主数据 注意参数EXTENSIONIN的使用,可以创建自定义字段 例如:WA_BAPI_TE_MARA-MATERIAL = IT ...
- SAP BAPI一览 史上最全
全BADI一览 List of BAPI's BAPI WG Component Function module name Description Description Obj. Ty ...
随机推荐
- docker 搭建zookeeper集群和kafka集群
docker 搭建zookeeper集群 安装docker-compose容器编排工具 Compose介绍 Docker Compose 是 Docker 官方编排(Orchestration)项目之 ...
- Android之Json
Servlet部分 public class JasonAction extends HttpServlet { private JsonService service; public void do ...
- BZOJ2208 [Jsoi2010]连通数[缩点/Floyd传递闭包+bitset优化]
显然并不能直接dfs,因为$m$会非常大,复杂度就是$O(mn)$: 这题有三种做法,都用到了bitset的优化.第二种算是一个意外的收获,之前没想到竟然还有这种神仙操作.. 方法一:缩点+DAG上b ...
- mysql5.7安装中的问题(服务无法启动。服务没有报告任何错误。排查方法)
1.拒绝访问的问题 权限不够,必须以管理员身份启动命令行 2.MySQL 服务无法启动.服务没有报告任何错误. 进入到你的mysql安装目录,C:\Program Files\MySQL\MySQL ...
- 前端小白页面开发注意事项及小工具(html\css\js)
技术一直在向前发展.但是有一些是相通的,要找准重点,将80%的时间放在提升基础问题上,余下的20%再去学习框架,库和工具. HTML 1. HTML 属性应当按照以下给出的顺序依次排列,确保代码的易读 ...
- BZOJ 4260: Codechef REBXOR (trie树维护异或最大值)
题意 分析 将区间异或和转化为前缀异或和.那么[L,R][L,R][L,R]的异或和就等于presum[R] xor presum[L−1]presum[R]\ xor \ presum[L-1]pr ...
- contents() 查找匹配元素内部所有的子节点(包括文本节点)。如果元素是一个iframe,则查找文档内容
contents() V1.2概述 查找匹配元素内部所有的子节点(包括文本节点).如果元素是一个iframe,则查找文档内容 示例 描述:大理石平台检定规程 查找所有文本节点并加粗 HTML 代码 ...
- java学习第一天:环境的配置
1.下载JDK,当前版本下载地址为:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.htm ...
- 单调栈求全1(或全0)子矩阵的个数 洛谷P5300与或和 P3400仓鼠窝
爆零好爽,被中学生虐好爽,还好我毕业得早 求全1(或全0)子矩阵的个数,看了题解有好几种思路,我学了三种,但有两种不是很理解,而且也没另外那个跑得快,所以简单讲述一一下我会的那种来自Caro23333 ...
- Java源码分析-UUID
原文链接:Little Apple's Blog 本文分析的JDK版本为1.8.0_131. UUID? UUID是Universally Unique Identifier的缩写:Java UUID ...