Contract Billing Plan

Using VA42, I have to create the Billing Plan for contract line items.
I find many Function Modules and BAPIs to update the existing Billing Plan for the contract line.
Any idea about how to create one? Any BAPI/FM?
Pranu

You can update billing plan using following Function module.
*& UPDATE Billing Plan
i_bapi_view-header = 'X'.
    i_bapi_view-item = 'X'.
    i_bapi_view-partner = 'X'.
    i_bapi_view-contract = 'X'.
    i_bapi_view-sdcond = 'X'.
    i_bapi_view-sdcond_add = 'X'.
    i_bapi_view-billplan = 'X'.
    i_bapi_view-configure = 'X'.
    sales_documents-vbeln = v_order.
    APPEND sales_documents.
    CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
      EXPORTING
        i_bapi_view            = i_bapi_view
      TABLES
        sales_documents        = sales_documents
        order_headers_out      = order_headers_out
        order_items_out        = order_items_out
        order_contracts_out    = order_contracts_out
        order_billingplans_out = order_billingplans_out
        order_billingdates_out = order_billingdates_out
        order_partners_out     = order_partners_out
        order_conditions_out   = order_conditions_out.
    LOOP AT order_billingplans_out WHERE itm_number = '000000'.
      hfplnr = order_billingplans_out-bill_plan.
    ENDLOOP.
    LOOP AT tab WHERE kbetr IS NOT INITIAL.
      LOOP AT order_conditions_out WHERE itm_number = tab-itm_number
                                   AND cond_type = 'ZZRE'.
        MOVE-CORRESPONDING order_conditions_out TO cond_ch.
        IF order_conditions_out-cond_type = 'ZZRE'.
          cond_ch-cond_value = tab-kbetr.
          APPEND cond_ch.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
* Read the billing plan
    CALL FUNCTION 'BILLING_SCHEDULE_READ'
      EXPORTING
        fplnr = hfplnr
      TABLES
        zfpla = hfpla
        zfplt = hfplt.
    MOVE hfpla TO hfpla2.
*READ TABLE zfpla2 INDEX 1.
    hfpla2-lodat = p_stat.
    hfpla2-tndat = p_end.
    hfpla2-rfpln = ''.
    hfpla2-lodar = ''.
    hfpla2-tndar = ''.
    hfpla2-fpart = p_bplan.
    hfpla2-perio = p_bplan.
    hfpla2-horiz = p_hori.
*** Very important to set field updkz = 'U' ***
    hfpla2-updkz = 'U'. "--> UPDATE!!
    APPEND hfpla2.
    CLEAR pos.
    CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
      TABLES
        fpla_new = hfpla2
        fpla_old = hfpla
        fplt_new = hfplt " --> NEW
        fplt_old = hfplt.
    CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
      EXPORTING
        i_no_messages = ' '.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.
*& END OF UPDATE Billing Plan Header level
*& UPDATE Billing Plan Item  level
    LOOP AT zbill.
      MOVE v_order TO doc .
      CALL FUNCTION 'SD_SALES_DOCUMENT_READ'
        EXPORTING
          document_number = doc.
      MOVE zbill-itm_number TO pos.
      CALL FUNCTION 'SD_SALES_BILLINGPLAN_READ'
        EXPORTING
          i_vbeln                = doc
          i_posnr                = pos
        IMPORTING
          e_fpla                 = e_fpla
        TABLES
          e_fplt                 = e_fplt
        EXCEPTIONS
          no_billingplan_allowed = 1
          no_billingplan_found   = 2
          OTHERS                 = 3.
      IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
* Read the billing plan
      CALL FUNCTION 'BILLING_SCHEDULE_READ'
      EXPORTING
      fplnr = e_fpla-fplnr
* I_VFKDAT =
* I_BFKDAT =
      TABLES
      zfpla = zfpla
      zfplt = zfplt.
* Upddate the ZFPLT2 table with the new values
*MOVE zfplt TO zfplt2.
      MOVE zfpla TO zfpla2.
*READ TABLE zfpla2 INDEX 1.
      zfpla2-lodat = zbill-datesfrom.
      zfpla2-tndat = zbill-datesto.
      zfpla2-rfpln = ''.
      zfpla2-lodar = ''.
      zfpla2-tndar = ''.
      zfpla2-fpart = p_bplan.
      zfpla2-horiz = p_hori.
*** Very important to set field updkz = 'U' ***
      zfpla2-updkz = 'U'. "--> UPDATE!!
      APPEND zfpla2.
    ENDLOOP.
    CLEAR pos.
    CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
      TABLES
        fpla_new = zfpla2
        fpla_old = zfpla
        fplt_new = zfplt " --> NEW
        fplt_old = zfplt.
    CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
      EXPORTING
        i_no_messages = ' '.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.
Edited by: Krupaji on Apr 9, 2011 7:21 AM

Similar Messages

  • Contract , billing plan issue

    Hello
    I am having issue where I have cancelled billing document corresponding to a contract, then also I canu2019t rebill the contract. I found in the header billing plan the status is showing is B(Partially processed) which is partially processed and for a line item it is showing C(Completely  processed), though I have cancelled all the invoices. Can some one help.
    David

    David
    Try running reports SDVBUK00 and RVV05IVB  to correct the status and/or billing index after carefully reading their documentation.
    Hope this helps.

  • Service Contract Billing plan

    Dear Guru's,
               As per my clinet Requirement we configured the Service Contract with Periodic Billing Plan on Monthly basis.Now After Saving the Service Contract when i go to change mode in Item Level Billing Plan Tab Page it is showing GREY or DISPLAY MODE only. But when i realize the Button HDR it is showing CHANGE MODE.
               Now what is my Requirement is The Billing Plan Tab page Should always be in Change mode only .So how to do this could anybody help me.
    Thank you
    suribabu

    Dear All,
                    Thank you. i solved the problem. i have maintain the Billing plan in Both Header and Item level.Now Remove at Header level. Do run the cycle.
    Thank you.
    suribabu

  • Pricing in contract/billing plan

    Hai ,
    I have a contract with a billing plan. On header level I use a pricing condition. Example: at header level I have a net value of 400 euro.  In the periodic billing plan I have 13 periods, each period gets 400 euro.
    I want that the 400 euro  will be divided over the periods. In this case, 13 periods so each period has to get 400/13= 33,77.
    Can you help me to accomplish this?

    Hello Balazs,
    Thanks for your reply.
    I use an condition with a fixed amount at header level. this amount/rate must be divided over number of settlement periods.
    Whe use a routine for this and it works, but when I save a contract and go back to change a discription, the rate is no longer  divided by the number of periods. It looks like the routine is in conflict with standaard SAP.
    Is it possible to customize this without a routine, so that the amount at header level divided over the number of periods.
    Fixed amount 400 euro at header level. in billing plan 13 periods so each period has to get 400/13= 30.77
    Thanks!

  • Item billing plan lines not appearing in billing due list ...

    Hello Team ,
    I have one question on service contract billing plan. Contract has status released.
    I have one contract which has header billing plan that is applicable at line item also.
    1. At line item level billing plan two items are due for billing but in billing due list this line item does not appear. Some of the lines in Item billing plan are already billed.
    Also at item billing plan there is no check (tick mark) for Header Billing Plan.
    Can some one suggest what are the possible checks for item billing plan not appearing in billing due list.
    Thanks ,
    Nitn Patki

    Hi Nitin,
    Check the status of the line items.
    Regards
    Narayana

  • Billing Plan Flow

    Hello,
    Suppose we have a contract with a sales plan that comprises a milestone plan (3 invoices with different percentages 30%, 40% and 40%).
    Is it possible to split the billing plan in different sales orders wichi will end up in one of those invoices mentioned above?
    Contract (Billing Plan)   --> Sales order 1   --> 30%  --> F2
                                         --> Sales order 2   --> 40%  --> F2
                                         --> Sales order 3   --> 30%  --> F2
    OR the billing plan only supports this scenario:
    Contract (Billing Plan)   --> Sales order 1   --> 30%  --> F2 30%
                                                                                    --> F2 40%
                                                                                    --> F2 30%
    Kind Regards.

    Hi,
    The billing plan only supports the second scenario.
    We cannot create different sales orders for different billing plan items in contract.
    The name itself tells us that it is a plan for billing.
    So it supports only this case:
    Contract (Billing Plan) --> Sales order 1 --> 30% --> F2 30%
    --> F2 40%
    --> F2 30%.
    For creating the first billing document,we have to maintain the billing block for other two items.
    Regards,
    Krishna.

  • Service Contracts  with billing plan not updating debit memo request in ECC

    For service contracts with billing plan, we cancel the line items and set the user status at header to "cancelled" and also set the cancellation date (under Cancellation Tab) at the header as well as item level which delete all items in the “DMR” in ECC (which are not yet billed). When we do this, it works perfect for most of the time and in some cases DMR items are not updated in ECC and it is billing. When I checked in CRM, the billing plan items are updated based on the cancellation date.
    Experts appreciate your help on this issue.
    Thanks,
    George.

    This is resolved by the note 1008663

  • How to get the Billing plan number for Contract Item?

    HI Friends
    I have been stuck up with the billing plan number to fetch perticular item in sales contract.
    When I go to the table FPLA, I can all the billing plan numbers for a contract or sales order and I am not able to locate for a perticular line item.
    Is there any way to fetch the exact billing plan number for a line item of a contract?
    Please help me
    Thanks
    Praveen

    U need to use the table vbfa or fololow thw link
    [http://www.erpgenie.com/sap-functional/sd/read-sales-document-flow-using-a-function-module]

  • Relation with Contract Line Item and Billing Plan

    Can a Billing Plan have more than one Contract (Sales Document) Line Item ?
    To detail, for example, a Billing plan is X and it has three Plan Items 1,2,3. Can there be situation where Billing Plan X:Item 1 is set up for Contract A:Item 10 and rest of the Items i.e. Billing Plan X:Item 2,3 are set up for  a different Contract B:Item 20 ?

    yes , we can

  • Is it necessary to create a Billing Plan for the Service Contracts

    Hi All,
      Is it necessary to create a billing plan for the service contracts.
      My requirement.
      In CRM 7.0, we created a service contract. For the item in that service contract there is a Billing Plan tab.
      In that tab we have the dates for Period, Billing Date etc.
      Now our requirement is to get the Billing Date quarterly. For this we created date rules and date profiles and assigned these date profiles to header and item level transactions.
    And we are able to see the date rules under the drop down of the billing date.
    I copied the standard date rule BILL004 to ZBILL004.
      But when we changed to our date rule it is not changing to quarterly date.
      Can you please let me know  what are the configurations to be done for this.
      Is the billing plan has to be created for this kind of scenario.
    Thanks in advance
    Thanks and Regards,
    Raghu

    Hi
    On OK button's action  you can Destroy the window and navigate to Page1.
    Go through this link for more details and a step by step guide for creation of pop ups  and dialog boxes
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/903fed0d-7be4-2a10-cd96-9136707374e1?quicklink=index&overridelayout=true
    Hope it works
    Regards
    Suresh

  • How  to Generate the Dates of Billing Plan Contract

    Dear experts,
    Need your advice on this.
    I have a requirement to create a program to update the Billing Plan of contract. It will run in background and update the end date (billing plan), then generate the dates ( Settlement Date for Deadline, Billing date for billing index and printout, etc ..).
    I have managed to change to end date using 'BILLING_SCHEDULE_READ' and 'BILLING_SCHEDULE_SAVE', but I couldn't generate the dates. I've searched sdn and still, no luck. I've tried 'SD_SALES_BILLINGPLAN_CHANGE' with no result. I've also found 'RV_SALES_DOCUMENT_UPDATE', but I dunno how to fill-in all the parameters.
    Please help .. I have run out of ideas ...
    Thx..
    TRI

    Found the answer .. using BDC :).
    Thx for attention ..
    TRI..

  • Copy Billing plan from Contract to Sales Order

    Dear Expert,
                 We created the Contract with Billing plan related to specific "WBS "Element". Then, tried to create the sales order with reference to that Contract. But billing plan details maintained in contract is not getting copied to sales order. can anybody give your experience to solve this issue.
    Warm Regards,
    Nag

    Hello Nag,
    Did you check your copy control routines in transaction VTAA? You need to see if these fields are included in the routines maintained for copy control between your contract and sales order.
    I hope this helps.
    Best regards,
    Ian Kehoe

  • How to bill the customer as per billing plan according to a contract

    Hello All
    Plz help  me out I am  stuck, scenerio is I am doing a contract with Perodic billing plan for every month. in contract the billing date shows rightly. but when I do vf01 for first month billing it shows all the billing plan days . but when I select first date for billing system allows me to save the bill. but later when I again go for vf01 for next month billing from putting the same contract no it shows a log stating that "paritially processed". Plz show me the path how to bill th customer on every month. is my process is right or any alternative Please suggest. I am waiting eagerly. thankx in advance.

    Hi  Mohan ,
    In the periodic billing plan, you can adjust conditions to the length of
    the period, only if you use the following calculation type for the
    condition:
                 M     quantity - monthly price
                 N     quantity - yearly price
                 Q     quantity - daily price
                 P     quantity - weekly price
    In this case the pricing determins correctly a prorated value
    according to the lenght of the period in the billing plan.
    Please check your conditions and use in a periodic billing plan
    only conditions which have the mentioned calculation type. Otherwise
    you will get every time the same value for a 'long' period or a
    'short' period.
    92655 - Billing plan: billing yearly prices on monthly basis
    Regards
    Goviind
    Edited by: Govindraj Kulkarni on Feb 20, 2012 10:05 AM

  • Error in Billing plan of Contract

    Hi Experts,
    We have a contract with Billing Plan. Billing plan tab has 2 line items.
    The first line item Net value in Billling plan tab is showing '0' (zero) and the second line item Net value in Billing plan tab is showing is 250. But Condition record value is 250 itself.
    The contract has been Invoiced now. In the Invoice the first line item value is '0'(zero) but the condtion tab of this line item its 250 (yellow icon, inactive).
    In the Output Print form, the first line item value is showing as '250' not '0'(zero).
    I am unable to understand where it went wrong..
    Please help me in this regard.
    Thanks in Advance
    Jaya.

    Hi,
    ut the condtion tab of this line item its 250 (yellow icon, inactive).
    Select this condition and check details why it show as yellow, inactivate
    Kapil

  • Periodic Billing Plan in Contract

    Hi
    I am  trying to configure periodic billing plan in service contract scenario but when I assign it to Sales Doc. and item category, and create contract, the value in contract overview screen ( Net Document Value) does not match with Net header value . when I remove Billing plan then they match.Billing is to be done quarterly in this scenario.Please guide.

    Hi,
    for Contract end rule 10
    In T.Code: OVBZ
    maintain baseline date as 01= Todays date
    time period as 1
    time unit as 4= year.
    Alternately maintain  Contract Validity period as 1 year and check. It looks the contract end and validity are not uniform.
    Hope this will help.
    Regards,
    sharan

Maybe you are looking for