K_TARGETCOSTS_TOTALS_CALC is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name K_TARGETCOSTS_TOTALS_CALC into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
KV02
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'K_TARGETCOSTS_TOTALS_CALC' "
EXPORTING
* par_auflo = SPACE " kv042-xfeld
par_awvrs = " tkv09-awvrs
par_awvsv = " tkv09-awvsv Comparison version
* par_awwtv = '01' " tkv09-awwtv Comparison value type
par_gjahr1 = " t009b-bdatj Fiscal year from
* par_gjahr2 = 0 " t009b-bdatj Fiscal year to
* par_knach = SPACE " kv042-xfeld Do not display message
par_kokrs = " tka00-kokrs Controlling area
par_meinh = " cosla-meinh Allocation base unit
par_menge = " cosla-lst001 Allocation base
par_objnr = " cosla-objnr Object number
* par_plako = SPACE " kv042-xfeld
par_poper1 = " t009b-poper Posting period from
* par_poper2 = 0 " t009b-poper Posting period to
* par_afout = 'X' " kv20a-afout
* par_mmess = SPACE " kv042-xfeld
TABLES
pta_kv012 = " kv012
pta_kv011 = " kv011
EXCEPTIONS
TARGETCOSTS_IMPOSSIBLE = 1 " Target costs calculation is not possible
SYSTEM_ERROR = 2 "
. " K_TARGETCOSTS_TOTALS_CALC
The ABAP code below is a full code listing to execute function module K_TARGETCOSTS_TOTALS_CALC including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).
| it_pta_kv012 | TYPE STANDARD TABLE OF KV012,"TABLES PARAM |
| wa_pta_kv012 | LIKE LINE OF it_pta_kv012 , |
| it_pta_kv011 | TYPE STANDARD TABLE OF KV011,"TABLES PARAM |
| wa_pta_kv011 | LIKE LINE OF it_pta_kv011 . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_par_auflo | TYPE KV042-XFELD , |
| it_pta_kv012 | TYPE STANDARD TABLE OF KV012 , |
| wa_pta_kv012 | LIKE LINE OF it_pta_kv012, |
| ld_par_awvrs | TYPE TKV09-AWVRS , |
| it_pta_kv011 | TYPE STANDARD TABLE OF KV011 , |
| wa_pta_kv011 | LIKE LINE OF it_pta_kv011, |
| ld_par_awvsv | TYPE TKV09-AWVSV , |
| ld_par_awwtv | TYPE TKV09-AWWTV , |
| ld_par_gjahr1 | TYPE T009B-BDATJ , |
| ld_par_gjahr2 | TYPE T009B-BDATJ , |
| ld_par_knach | TYPE KV042-XFELD , |
| ld_par_kokrs | TYPE TKA00-KOKRS , |
| ld_par_meinh | TYPE COSLA-MEINH , |
| ld_par_menge | TYPE COSLA-LST001 , |
| ld_par_objnr | TYPE COSLA-OBJNR , |
| ld_par_plako | TYPE KV042-XFELD , |
| ld_par_poper1 | TYPE T009B-POPER , |
| ld_par_poper2 | TYPE T009B-POPER , |
| ld_par_afout | TYPE KV20A-AFOUT , |
| ld_par_mmess | TYPE KV042-XFELD . |
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name K_TARGETCOSTS_TOTALS_CALC or its description.