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: 

BAPI_COSTACTPLN_POSTPRIMCOST summing up fix and var value

0 Kudos

Hello,

we are facing the following problem:

We would like to book fix and variable costs with the help of BAPI_COSTACTPLN_POSTPRIMCOST.

We hand over fix and variable values, but the BAPI is building a sum of both and saves it as fix value as well as total value.

The results are saved in the table COSP in the columns WKG001...WKG005 (total) and WKF001...WKF005 (fix)

Please find a code snippet below.

A similiar issue has already been described here: http://scn.sap.com/thread/677570

We are using the BAPI without Delta = 'X' at the moment, but tried it already also with Delta='X'.

Did anybody faced the same issue or has a solution already?

Many thanks in advance!

Best Regards,

Thorsten

ls_pervalue-fix_val_per01 = lv_value_fix.

      ls_pervalue-fix_val_per02 = lv_value_fix.

      ls_pervalue-fix_val_per03 = lv_value_fix.

      ls_pervalue-fix_val_per04 = lv_value_fix.

      ls_pervalue-fix_val_per05 = lv_value_fix.

      ......

      ls_pervalue-var_val_per01 = lv_value_var.

      ls_pervalue-var_val_per02 = lv_value_var.

      ls_pervalue-var_val_per03 = lv_value_var.

     ls_pervalue-var_val_per04 = lv_value_var.

     ls_pervalue-var_val_per05 = lv_value_var.

          .....

         

          ......

      lv_suc = lv_suc + 1.

      APPEND ls_pervalue TO lt_pervalue.

    ENDLOOP.

    CALL FUNCTION 'BAPI_COSTACTPLN_POSTPRIMCOST'

      EXPORTING

        headerinfo     = ls_header

*       DELTA          = ' '

      TABLES

        indexstructure = lt_index

        coobject       = lt_coobject

        pervalue       = lt_pervalue

*       TOTVALUE       =

*       CONTRL         =

        return         = lt_bapiret.

1 ACCEPTED SOLUTION

Solution was to use the correct activity type.

Using "wrong" activity types doesn't lead to an error in bapiret, but sums up var and fix.

2 REPLIES 2

JL23
Active Contributor
0 Kudos

Looks quite different to the example given behind the documentation button that can be found in SE37 for BAPI_COSTACTPLN_POSTPRIMCOST

Solution was to use the correct activity type.

Using "wrong" activity types doesn't lead to an error in bapiret, but sums up var and fix.