Dear Experts,
Our client have requirement as system should calculate OH cost on output quantity.
for example : production GR is 10 then system has to add the cost 10000/-INR to each output qty (10000*10 = 100000)
for this requirement we are trying to use "Enhancement COOM0001" but we are not getting the expected result from this enhancement.
as you aware "Enhancement COOM0001" have three function module like
1. EXIT_SAPLKASC_001
2. EXIT_SAPLKASC_002
3. EXIT_SAPLKASC_003
We did coding as below for your advice correction
Code in Function Module 01. EXIT_SAPLKASC_001
&---------------------------------------------------------------------*
*& Include ZXKSCU01
*&---------------------------------------------------------------------*
TABLES: cosl.
FIELD-SYMBOLS: <actty>,
<qunty>.
DATA: aname(6),
qname(6),
abw_menge LIKE cosla-lst001, " Istmenge
abw_meinh LIKE cosla-meinh, " Mengeneinheit
abw_poper LIKE kks00-poper, " Periode bis
abw_gjahr LIKE kks00-gjahr. " Geschäftsjahr von
CLEAR sy-subrc.
CLEAR t_cossa.
REFRESH t_cossa.
CHECK i_cbase = 'B000'.
IF i_wrttp = '01'OR i_wrttp = '04'.
SELECT * FROM cosl WHERE lednr = '00'
AND objnr = i_coiob-objnr
AND gjahr = i_yeafr
AND wrttp = i_wrttp.
CONCATENATE: 'LST' i_perfr INTO aname,
'MEG' i_perfr INTO qname.
ASSIGN: COMPONENT aname OFSTRUCTURE cosl TO<actty>,
COMPONENT qname OFSTRUCTURE t_cossa TO<qunty>.
MOVE: i_yeafr TO t_cossa-gjahr,
<actty> TO<qunty>,
cosl-meinh TO t_cossa-meinh.
APPEND t_cossa.
ENDSELECT.
ENDIF.
Code in Function Module 02. EXIT_SAPLKASC_002
&---------------------------------------------------------------------*
*& Include ZXKSCU02
*&---------------------------------------------------------------------*
break cfi_bhagirap.
CLEAR: sy-subrc,
e_pcent,
e_amont,
e_curcy,
e_perqt,
e_qunit.
IF i_coiob-werks = 'TS18'.
IF i_ohead = 'BULK'.
e_amont = '15000'.
ELSEIF i_ohead = 'CONS'.
e_amont = '10000'.
ENDIF.
ENDIF.
CLEAR sy-subrc.
Code in Function Module 02. EXIT_SAPLKASC_003
*&---------------------------------------------------------------------*
*& Include ZXKSCU03
*&---------------------------------------------------------------------*
break cfi_bhagirap.
CLEAR: sy-subrc,
e_aufnr,
e_kostl,
e_kstar.
IF i_credt EQ'840'.
IF i_coiob-werks = 'TS18'.
e_kostl = '2000010999'.
e_kstar = '0094100000'.
ENDIF.
CLEAR sy-subrc.
Please check and reply your valuable suggestions.
Thanks & Regards
Bhagirath