Skip to Content
author's profile photo
Former Member

Contract Price Computation

Hi,

When creating a contract, the total value (price * quantity) in both header and item level are not automatically filled up. The workaround was to compute the total value via BADI.

For the header level total value, I used FM BBP_PD_CTR_GETDETAIL to retrieve the prices of all items and get the total. However, when a contract is released and edited again, the changed prices or quantities are not automatically reflecting in the function module.

Question is: is there a way to retrieve real-time quantity/price values to be able to total it? like a function module or table?

Reward points to helpful answers.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 03:09 PM

    Hi

    Which SRM version are you using ? Please give more details.

    Looks like you are using the FM incorrectly in your custom code. Please paste the code here in your next reply.

    Regards

    - Atul

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 09:48 PM

    Hi margaretanne,

    I discovered the same behavior in the available releases. I am not sure, if it is

    solved in the upcoming release. I got the answer from SAP, that it is not possible,

    but a good idea. Open a SAP note to get additional info.

    Cheers,

    Claudia

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 05:37 AM

    Hi Atul,

    I'm using SRM Version 5.00.

    Code goes like this:

    v_contract = is_header-object_id.

    CALL FUNCTION 'BBP_PD_CTR_GETDETAIL'

    EXPORTING

    i_object_id = v_contract

    i_with_itemdata = 'X'

    TABLES

    e_item = i_item.

    UNASSIGN <fs_item>.

    LOOP AT i_item INTO wa_item WHERE del_ind <> 'X' AND itm_released <> space.

    • for items that were just inactivated or deleted

    READ TABLE ct_item ASSIGNING <fs_item> WITH KEY guid = wa_item-guid.

    IF sy-subrc = 0.

    CHECK <fs_item>-del_ind <> 'X' AND <fs_item>-itm_released <> space.

    v_total = <fs_item>-value + v_total.

    ELSE.

    • calculate sum of all items that are not deleted and are active

    v_total = wa_item-value + v_total.

    ENDIF.

    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded