Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

can I use the BAPI K_Costs_Plan_Interface_total for secondary cost planning?

$
0
0

Hi,

 

I would like to know if I can use the BAPI K_Costs_Plan_Interface_total for secondary cost planning.

If yes, I would need to implement the sap sample report. What are the fields sender cost center and sender activity type in the structure rku01g?

 

 

 

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.

 

Thanks.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>