Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute the FM K_COSTS_PLAN_INTERFACE_TOTAL with ranges

Former Member
0 Kudos
504

Hi All,

can anybody suggest me, how to execute the Function module K_COSTS_PLAN_INTERFACE_TOTAL with range of Cost element(KSTAR)

and what is the field for Cost Element TO

The fm is for tcode KP06

Edited by: Kachi Reddy on Feb 17, 2012 2:26 PM

2 REPLIES 2

Former Member
0 Kudos
98

Hi, Kachi.

Try this example:

REPORT rkkipl1t.
* The parameters are used to fill the internal table and describe the
* planning object.
PARAMETERS: p_kokrs LIKE tka01-kokrs  MEMORY ID cac  OBLIGATORY,
            p_perab LIKE cobk-perab   DEFAULT '001'  OBLIGATORY,
            p_perbi LIKE cobk-perbi   DEFAULT '012'  OBLIGATORY,
            p_gjahr LIKE cobk-gjahr   MEMORY ID gjr  OBLIGATORY,
            p_versn LIKE cobk-versn   MEMORY ID kvt  OBLIGATORY,
            p_kostl LIKE cssl-kostl                  OBLIGATORY,
            p_kstar LIKE cskb-kstar                  OBLIGATORY,
            p_vrgng LIKE cobk-vrgng   DEFAULT 'RKP1' OBLIGATORY,
            p_kwaer RADIOBUTTON GROUP ein DEFAULT 'X',
            p_owaer RADIOBUTTON GROUP ein,
            p_twaer RADIOBUTTON GROUP ein,
            p_waers LIKE coss-twaer.


DATA: i_rku01_cur LIKE rku01_cur.

* internal table for function
DATA: itrku01g TYPE TABLE OF rku01g WITH HEADER LINE.

REFRESH itrku01g.
PERFORM fill_itrku01g.

* Which currency is to be used?
IF p_twaer = 'X'.
*   planning in transaction currency
  i_rku01_cur-wtg_man = p_twaer.
  i_rku01_cur-wtf_man = p_twaer.
ELSEIF p_owaer = 'X'.
*   planning in object currency
  i_rku01_cur-wog_man = p_owaer.
  i_rku01_cur-wof_man = p_owaer.
ELSE.
*   planning in controlling area currency
  i_rku01_cur-wkg_man = 'X'.
  i_rku01_cur-wkf_man = 'X'.
ENDIF.


CALL FUNCTION 'K_COSTS_PLAN_INTERFACE_TOTAL'
  EXPORTING
*    BLTXT                  = ' '
*    COMMIT                 = 'X'
*    DELTA                  = ' '
    gjahr                  = p_gjahr
    kokrs                  = p_kokrs
    messages_show          = 'X'
    perab                  = p_perab
    perbi                  = p_perbi
    update_values          = 'X'
    versn                  = p_versn
    vrgng                  = p_vrgng
*    ONLINE_VB              = ' '
    irku01_cur             = i_rku01_cur
*    TESTMODE               = ' '
*    KEEP_TWAER             = ' '
  TABLES
    irku01g                = itrku01g
 EXCEPTIONS
   messages_occured       = 1
   OTHERS                 = 2
          .
IF sy-subrc = 0.
  MESSAGE s000(15).
*   Verbuchung wurde erfolgreich durchgeführt
ENDIF.

*---------------------------------------------------------------------*
*  FORM FILL_ITRKU01G
*---------------------------------------------------------------------*
FORM fill_itrku01g.
* fill internal table for function
  CLEAR itrku01g.
  itrku01g-kostl    = p_kostl.              "for CCA planning
  itrku01g-kstar    = p_kstar.              "must be filled
  itrku01g-wtgbtr   = 12000.                "value when planning
  itrku01g-wkgbtr   = 12000.                "value when planning
  itrku01g-wogbtr   = 12000.                "value when planning
  itrku01g-twaer    = p_waers.              "transaction currency
  itrku01g-fcwkg    = '1'.           "distribution key must be filled
  itrku01g-fcwkf    = '1'.                  "must be filled
  itrku01g-fcwkv    = '1'.                  "must be filled
  itrku01g-fcmeg    = '1'.                  "must be filled
  itrku01g-fcmef    = '1'.                  "must be filled
  itrku01g-fcmev    = '1'.                  "must be filled
  APPEND itrku01g.

ENDFORM. "FILL_ITRKU01G.

Best regards,

George Shlyahov.

0 Kudos
98

Hi,

I would like to implement this report.

What are the components : sender cost center and sender activity type in the structure rku01g?

Thanks for your help.