创建服务类PO
转载:https://blogs.sap.com/2014/03/04/creating-a-simple-service-po-using-bapipocreate1bapipochange/
Creating a Simple Service PO using BAPI_PO_CREATE1(BAPI_PO_CHANGE)
March 4, 2014 | 224 Views |
Introduction:
For creating a PO we have BAPI’s like BAPI_PO_CREATE1 and BAPI_PO_CREATE, for amending a PO we have BAPI_PO_CHANGE.
For these BAPI’s to work the minimum required data has to be provided.
It is pretty simple to create a normal PO, but little complexity comes in while creating a Simple Services(Services) PO. In this document I would like to deal majorly with creating and amending a services PO, what are the tables that has to be filled, what data that has to be passed to these fileds, where to get this data from and how, so that the BAPI works smooth as honey.
This task has been taken up by me as I see lot of posts on the titled text unanswered or not completely answered.
How to acheive it:
The tables highlighted in the below image are the ones that carry the services information to the BAPI. The information we fill in these tables are crucial (we are taking a scenario where a services PO has to be created from a services PR).

The services line item information should be filled in the POSERVICES table and the accounting information of the service line should be filled in the table POSRVACCESSVALUES.
Filling the POSERVICES table:
Every service line will have a package number assigned to it and every package number has a sub-package number assigned to it.
It is the subpackage number that will have all the service line item information filled in it (like unit price,value,material group etc,) so filling this is very important.
ESLL is the table where all the package realted data is saved for services. It will have service line item related details.
As we are using the scenario where a PO is created from PR,for filling the the table POSERVICES we can use the ESLL entries of the PR. First get the package number of the PR line item(this information is available in EBAN table eban-packno). Pass this package number to ESLL table and get the corresponding sub-package number.
Pass this sub-package number to package number field of ESLL and get all the service line item details like unit price,value,material group etc.
Fill the above obtained data to the POSERVICES table as below.
Every service line item should have two entries in this table, 1 for package number and 2 for subpackage number
1’st entry:
poservices–pckg_no = esll–packno. “Package number
poservices–line_no = esll–introw. “Package Line number
poservices–outl_ind = esll–package. “If this is X then it is a service line( because limits also have package numbers, this will act as differentiator)
poservices-subpckg_no = esll–sub_packno. “Sub-Package number
2nd entry:
poservices–pckg_no = esll–sub_packno. “Sub-Package number
poservices–line_no = esll–introw. “Sub-Package line number
poservices–quantity = pass quantity(can use esll entry) “PO service quantity
poservices–base_uom = pass UOM(can use esll entry) “Unit of measure
poservices–price_unit = pass Unit Price(can use esll entry) “Unit Price
poservices–gr_price = pass Net Value(can use esll entry) “Net value
poservices–short_text = esll–ktext1. “Short text
poservices–matl_group = esll–matkl. “Material Group
poservices–pln_pckg = esll–sub_packno “Sub-Package number
poservices–pln_line = esll–introw. “Sub-Package line number
The above mentioned are the minimum required fields that has to be passed.
Q: Why poservices–pln_pckg and poservices–pln_line has to be passed ?
A: When a Shopping cart is created in portal a PR will be created in ECC corresponding to it. When a PO is created in ECC refering to this PR, in the Shopping cart also this PO number should be update in the related documents tab.
Only when you pass the above two fields this will happen.
Filling the POSRVACCESSVALUES table:
As mentioned above this table will have the acounting information of the service line. This table will have only one entry corresponding to the service line.
The accounting information of a service line is stored in the table ESKL with reference to sub-package number of the above service line item.
So take the above sub-package number, pass it to the package number field of the ESKL table and get the accounting details.
Fill the above obtained data to the POSRVACCESSVALUES table as below.
posrvaccessvalues–pckg_no = eskl–packno. “Sub-Package number of ESLL entry
posrvaccessvalues–line_no = eskl–introw. “Line number of eskl
posrvaccessvalues–serno_line = eskl–numkn. “Seq. Number of Acc. Assignment Specification: Service Line
posrvaccessvalues–serial_no = eskl–zekkn. “Sequential Number of Account Assignment in ESKN
posrvaccessvalues–quantity = pass quantity(can use eskl entry) “PO service quantity
This way both the services tables should be filled and passed to BAPI.
*Note: Along with these tables all the required tables as shown in the above screen shot are also to be filled for the BAPI to work. Here we only covered service realted data.
5 Comments
You must be Logged on to comment or reply to a post.
Shashikant WadhavaneJanuary 29, 2015 at 12:49 pm
Hi Pavan ,
I am passing the pack_no from ESLL to POSERVICES structure . PO creation is successful but its giving update termination error message as it tries to insert new entry in ESLH table for same package number.
When I hardcoded package and subpackage number to 000000001 and 000000002 , PO created successfully and these packages are created and updated in ESLH/ ESLL. But when running second time… getting same termination message.
Does these packages get newly created or is it just reference of package BAPI uses ?
like (0)Pavan Kumar Raju Sagiraju Post authorJanuary 29, 2015 at 2:35 pm
What is the scenario….yor are trying to create a simple service scenario or complex service scenario(Limits)??
A new package number will be created for PO. If you are trying to change the PO data, it is this package number you need to mention.
like (0)Shashikant WadhavaneJanuary 30, 2015 at 5:18 am
This is simple service scenario where I need to get services details from central contract (ME33K) and use this to create work order (ME23N).
I am not populating POSRVACCESSVALUES as no entries present in ESKL for contract’s package no. ( This should not be an issue).
Main concern is , if I pass some random number to PACK_NO , system creates this package automatically. My program will be running daily , so I cant hard code anything.
Is there any way , so that package number (internal number) will be created by SAP and I don’t need to mention any value. But in this case , how to map
poservices–pckg_no to poitem-pack_no.
like (0)Shashikant WadhavaneJuly 25, 2016 at 8:53 am
This is to provide update, When we approched SAP they suggested us few SAP notes and asked one program to run which resolves the number range problem and creates number assignment for PO service lines by itself. So to conclude, pass package and subpackage number as 000000001 and 000000002 respectively to BAPI and SAP should generate new number for package and subpackage. If its not th case, do not waste much time and raise it to SAP.
like (0)
Rene Maldonado FimbresJuly 4, 2016 at 7:38 pm
Just an addition to use it with Purchase Requuest.
On the POITEM table, fill PREQ_NO and PREQ_ITEM
like (0)
创建服务类PO的更多相关文章
- Android 服务类Service 的详细学习
http://blog.csdn.net/vipzjyno1/article/details/26004831 Android服务类Service学习四大组建 目录(?)[+] 什么是服务 服务有 ...
- Android 服务类Service 的具体学习
上一篇说到了通知栏Notification,提起通知栏,不得让人想到Service以及BroadcastReceive,作为android的4大组建的2个重要成员,我们没少和它们打交道.它们能够在无形 ...
- 关于使用Topshelf创建服务
目录 0. 背景说明 1. 使用Topshelf组件创建Windows服务 1.1 依赖Quartz.net实现定时任务 1.2 依赖于Topshelf创建服务类 1.3 log4net的配置文件lo ...
- vs里根据json快速创建对应类的方法
有时候,我们在调用别人接口的时候,服务端返回了一个json格式的字符串,我们要获取json里面的数据的话一般有两种方式: 1.通过正则 2.反序列化成一个对象 第一种方式这里不再多说,主要说一下第二种 ...
- C#创建服务及使用程序自动安装服务,.NET创建一个即是可执行程序又是Windows服务的exe
不得不说,.NET中安装服务很麻烦,即要创建Service,又要创建ServiceInstall,最后还要弄一堆命令来安装和卸载. 今天给大家提供一种方式,直接使用我们的程序来安装/卸载服务,并且可以 ...
- [转]C#创建服务及使用程序自动安装服务,.NET创建一个即是可执行程序又是Windows服务的exe
写在前面 原文地址:C#创建服务及使用程序自动安装服务,.NET创建一个即是可执行程序又是Windows服务的exe 这篇文章躺在我的收藏夹中有很长一段时间了,今天闲着没事,就自己动手实践了一下.感觉 ...
- Spring AOP 创建增强类
AOP联盟为增强定义了org.aopalliance.aop.Advice接口,Spring支持5种类型的增强: 1)前置增强:org.springframework.aop.BeforeAd ...
- 一种从JSON数据创建Java类的高效办法
<一种从JSON数据创建Java类的高效办法> 作者:chszs,转载需注明.博客主页:http://blog.csdn.net/chszs JSON格式的数据经常会遇到,比如调用Web服 ...
- C#创建服务及使用程序自动安装服务
.NET创建一个即是可执行程序又是Windows服务的exe 不得不说,.NET中安装服务很麻烦,即要创建Service,又要创建ServiceInstall,最后还要弄一堆命令来安装和卸载. 今天给 ...
随机推荐
- 《JavaScript权威指南》拾遗(下)
一.类和原型 1.在JavaScript中,类的实现是基于原型继承机制的,如果两个实例都是从同一个原型对象中继承了属性,则它们是同一个类的实例. 2.原型对象是类的唯一 ...
- 纯css画哆啦A梦
今天有点无聊,照着网上的图写了个哆啦A梦,无技术可言,纯考耐心. <!doctype html> <html lang="en"> <head> ...
- HTML5 画布参考
描述 HTML5 <canvas> 标签用于绘制图像(通过脚本,通常是 JavaScript). 不过,<canvas> 元素本身并没有绘制能力(它仅仅是图形的容器) - 您必 ...
- office2013破解工具
终于找到破解工具了,每次打开word文档都弹出限期激活对话框,真的是相当烦躁啊,先把破解工具奉上!!!! 工具名: HEU-KMS-ActivatorV1.1绿色版 链接: office2013 和 ...
- ACM 中常用的算法有哪些?
在网上看到别人ACM学习的心得,转载过来,源地址不记得了,当时是百度的.内容如下: 网络上流传的答案有很多,估计提问者也曾经去网上搜过.所以根据自己微薄的经验提点看法. 我ACM初期是训练编码能力,以 ...
- CoreAnimation (CALayer 动画)
CoreAnimation基本介绍: CoreAnimation动画位于iOS框架的Media层 CoreAnimation动画实现需要添加QuartzCore.Framework CoreAnima ...
- UITableView 协议中常用的方法
UITableViewDataSource 协议中常用方法 1.设置右边 索引值 - ( NSArray *)sectionIndexTitlesForTableView:( UITableView ...
- 如何用 Swift 语言构建一个自定控件
(via:破船之家,原文:How To Make a Custom Control in Swift) 用户界面控件是所有应用程序重要的组成部分之一.它们以图形组件的方式呈现给用户,用户可以通过它 ...
- Aqua Data Studio 查询结果中文乱码
菜单条里[文件]-[选项]会弹出个选项对话框 然后选[一般] 在右边的[外观]以下找到[网格结果字体] 将字体类型改成宋体即可了 watermark/2/text/aHR0cDovL2Jsb2cuY ...
- Android GPS应用:临近警告
前面介绍过LocationManager有一个addProximityAlert(double latitude,double longitude,float radius,long expirati ...