[原]免费交货成本中心确定
--目标:
对于免费交货的销售订单,发货过账的时候一般是借:销售费用科目,贷:物料科目;既然是费用类的科目在财务那边就会定义为cost element;所以就要由一个cost object分配给该cost element. 对于免费交货场景也有两种情况:一是使用Foc的销售订单,在抬头给一个默认的成本中心;二是免费的物料与正常物料在一张订单中;下面我们具体看下:
针对第一种业务:创建foc类型的销售订单,行项目类型TANN; 移动类型901;
配置不同的订单原因,默认自动带出cost center;
- Vov8 - Foc 订单类型; sd document cate: I
- VOV7-定义item category tann:
- 定义schedule line category 并分配给tann;
4) omwn – 定义Movement type 901 对应的account modification key:
5 ) obyc – 定义销售发货对应的费用科目;transcation type GBB:
6 ) IMG-àsales and distributionàbasic functions-àaccount assignment / costing:定义order reason 对应的cost center;
可以看到此处可以按照sales org + distribution channel + division 来定义不同的cost center;
前台实现:
7 ) 创建订单并交货:
可以看到当order reason 设置为105时,抬头的account assignment cost center已经默认为设定值;
行项目明细的acount assignment 的profit center 修改为该cost center主数据里面的;
发货过账:
针对第二种场景:在正常的销售订单中有免费的行项目,那么这时候就不能通过定义order reason来默认成本中心:因为其指定的时订单抬头的cost center; 而我们要的是某个免费项目的cost center;
标准方法无法实现,因为在item detail界面没有输入cost center的地方 。那么我们要debug 一下交货单里面的cost center是怎么取到的,找到增强点我们才能做。以下是debug 的过程;
- ) 在vl01n界面输入 /h 进入调式界面:
在debug 界面设置watchpoint: 如下:
点击 f8 watchpint reached:
但是并不是这段程序,又可能是该段程序之前的程序,点击desktop 2 tab , 选择之前的程序;分别设置断点进去试探; 最后找到'FV50C101'---DATEN_KOPIEREN_101该段程序就是我们要找的;
这段程序是data transfer routine;
- ) Vofm ---定义data transfer routine
定义routine : 901
- ) vtla order -à delivery copy control:
修改tann 行项目类别的 data transfer为901;
这是在order-àdelivery的copy control做的增强,另外也可以在生成会计凭证时在替代程序中做增强;
会计凭证替代增强:ZRGGBS000 --à form uokb9;
-
) okb9 中定义cost element对应的cost center;
--remark:
cobl-glvor: 代表transaction type; 在表t022t中存放其说明;