--目標:
對於免費交貨的銷售訂單,發貨過賬的時候一般是借:銷售費用科目,貸:物料科目;既然是費用類的科目在財務那邊就會定義爲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中存放其說明;