How to copy billing plan details of main item to all its sub-items...

In the sales order, we have main item and sub-items. The main item is a project item and it has a billing plan which gets copied from the project. Now the requirement is to copy the same billing plan(of the mainitem) to all its subitems- billing dates, billing type, billing rule, date category, percentage of the amount to be billed, etc. So that when we do billing for this sales order all the items and its sub items are copied in the milestone billing document.
The billing plan is not at header level since the sales order can have multiple project items and their milestones can differ.
Please suggest how to acheive this- coping of billing plan details from main item to all the subitems.
Rds,
sucmsss

You can use the enhancement section in include mv45af0f_fplan_aktualisieren_c. In the below code, I am copying milestone lines from previous document, but you could adapt to copy from the higher level item. Copy and pretty print it in ABAP editor.
ENHANCEMENT 10  ZSD_SALES_DOC1.    "active version * Generate Billing Plan without dialog. * Because copy control does not work with milestone billing plans, we need to perform the below tricks.
  DATA: zlt_fplt TYPE TABLE OF fpltvb,         zlt_fpla TYPE TABLE OF fplavb,         zlv_fareg TYPE tfpla-fareg,         zlv_fplnr TYPE fplnr,         zls_vbkd TYPE vbkd.   FIELD-SYMBOLS:TYPE vbkdvb,                 TYPE fplavb,                 TYPE fpltvb,                 TYPE fpltvb.
IF xvbkd-updkz = chari AND       tvap-fpart IS NOT INITIAL AND *      xfplt[] IS INITIAL AND       vbkd-fplnr IS INITIAL AND "bill plan not created       vbak-vbtyp CA 'CG'. "contracts and orders       SELECT SINGLE fareg FROM tfpla INTO zlv_fareg WHERE         fpart = tvap-fpart.         IF zlv_fareg IS NOT INITIAL AND           zlv_fareg <> '6'.         READ TABLE cvbkd ASSIGNINGWITH KEY         vbeln = vbap-vgbel         posnr = vbap-vgpos.         IF sy-subrc IS INITIAL.           CALL FUNCTION 'BILLING_SCHEDULE_READ'             EXPORTING              fplnr          =-fplnr             tables              ZFPLA          = zlt_fpla              zfplt          = zlt_fplt. * Check if any of the lines are not periodic and not from milestone before proceeding.            READ TABLE zlt_fplt ASSIGNINGWITH KEY            MLSTN = abap_false            nfdat = 0.          IF sy-subrc IS INITIAL.           CONCATENATE '$000' vbap-posnr INTO zlv_fplnr.           ENDIF.         ENDIF.         IF sy-subrc IS INITIAL.           LOOP AT zlt_fplt ASSIGNINGWHERE             mlstn = abap_false.            -fplnr = zlv_fplnr.             APPENDTO xfplt.            -updkz = chari.           ENDLOOP.           LOOP AT zlt_fpla ASSIGNING.            -fplnr = zlv_fplnr.             CLEAR-vbeln.            -updkz = chari.             APPENDTO xfpla.           ENDLOOP.           da_fplnr =-fplnr.         ENDIF.       ENDIF.     ENDIF.     CALL FUNCTION 'BILLING_SCHEDULE_GENERATE'          EXPORTING               I_FKDAT        = VBKD-FKDAT               I_FPLNR        = DA_FPLNR               I_WAERS        = VBAK-WAERK               I_FPART        = TVAP-FPART               I_VEDA         = XVEDA               I_VEDA_KOPF    = VEDAVB               I_UPD_FPLA     = UPD_FPLA               I_UPD_FPLT     = UPD_FPLT               I_KOMK         = TKOMK               I_KOMP         = TKOMP               I_KOMPAX       = KOMPAX               I_FKREL        = VBAP-FKREL               I_CREATE_DATES = US_FLG_CREATE_DATES               I_KFPLAN       = DA_KFPLAN               I_KFPLNR       = DA_KFPLNR               I_NOMSG        = US_NOMSG               I_ABSAGEN      = DA_ABSAGEN               I_FPLAA        = FPLAA          IMPORTING               E_FPLNR        = XVBKD-FPLNR               E_DATALOSS     = DA_DATALOSS               E_UPD_FPLA     = UPD_FPLA               E_UPD_FPLT     = UPD_FPLT               E_KOMPAX       = KOMPAX          TABLES               FPLA_NEW       = XFPLA               FPLA_OLD       = YFPLA               FPLT_NEW       = XFPLT               FPLT_OLD       = YFPLT               I_FPLTS        = TFPLTS               I_FPLTNP       = TFPLTNP               I_KOMV         = XKOMV               I_TKOMK        = TKOMK               I_SVBAP        = UVBAP.     LOOP AT zlt_fplt ASSIGNING.       READ TABLE xfplt ASSIGNINGWITH KEY       mandt =-mandt       fplnr =-fplnr       fpltr =-fpltr.       CHECK sy-subrc IS INITIAL.      -updkz = chari.     ENDLOOP. ENDENHANCEMENT.

Similar Messages

  • How to give Billing plan details to BAPI_CONTRACT_CREATEFROMDATA

    Hi,
    I am using BAPI-BAPI_CONTRACT_CREATEFROMDATA for creating contract (VA41), the problem is, i am not able to give the billing plan details in this BAPI. I mean, in VA41, in Billing plan tab, it will have 2 fields- Dates From, Dates Until.
    These 2 fields i am not able to give in BAPI. Any help is appreciated.
    Vinoth

    I face same issue now i solve so i tell how to solve
    first u use
    CALL FUNCTION 'BAPI_CONTRACT_CREATEFROMDATA'
    then u commit
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    after that you can use following FM for billing plan details
    CALL FUNCTION 'SD_SALES_BILLINGPLAN_READ'
    CALL FUNCTION 'BILLING_SCHEDULE_READ'
    CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
    CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
    using above FM u pass all billing plan data  if u want sample code give ur mail id because if i past full code then can't read able it it more then 1500 char.
    Edited by: kk.adhvaryu on Jun 8, 2010 8:57 AM

  • 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

  • Copy Billing plan

    Dear Experts,
    Can any one explain the process of
    Copy billing plan from sales order to project automatically.
    Is their any configuration required.
    Regards
    Chandra

    Dear Virendra,
    Actually i heard and read.
    in this thread u only toled.
    Automatic Copying billing plan from WBS to Sales order
    If i want to copy revenue plan automatically means how?
    Regards
    Chandra

  • How to create Billing Plan in sales order using Function module /BAPI

    hi,
    How to create Billing Plan in sales order using Function module /BAPI
    i hv check few FM such
    BILLING_SCHEDULE_READ
    BILLING_SCHEDULE_GET_NUMBER
    BILLING_SCHEDULE_SAVE
    But unable to create billing plan for a sales order.....any other method to create???

    Hi,
    Use this link.
    Create sales order with billing plan via LSMW and BAPI BUS2032
    BAPI or Function to update Billing Plan in Sales Order Items
    Hope this will help you.
    Regards,
    Vijay

  • How to copy complete internal table into main dababase table

    please tell me how to copy complete internal table into main dababase table by overwriting all the entries of the main DBtable.

    HI,
    you can use<b> Insert Or  Modify statement ..</b>
    <b>Modify updates the existing record, insert creates a new one. ...</b>
    insert ZDBTAB from table itab.
    Modify ZDBTAB from table Itab.
    The structure of itab should be exactly the same as the z table.
    You should not update standard tables directly though.
    rewards if usefuyl
    regards,
    nazeer

  • Copy Billing plan from Quation to Sales order at header level

    Dear Gurus,
    I am using custom routine (600) to copy Billing plan from Quotation to Sales Order.
    I used following code to copy Billing plan.
    LOOP AT CFPLT.
    MOVE-CORRESPONDING cfplt TO FPLT.
    CLEAR FPLT-FPLNR.
    FPLT-FPLNR = FPLA-FPLNR.
    MOVE-CORRESPONDING FPLT TO XFPLT.
    XFPLT-UPDKZ = 'I'.
    APPEND XFPLT.
    CLEAR XFPLT.
    ENDLOOP.
    UPD_FPLT = 'I'.
    I also tried with CFPLA instead of CFPLT.
    Using this code all line item Billing plan is coping into header Sales order Billing Plan (Duplicating records). When I save and come back it is giving Express Document error.
    I could not able to save document.
    Please guide me this regards.
    Thanks,
    Vasanth.

    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

  • Material exchane ,copy pricing and conditions from main item to sub item.

    Hi All,
    We are using parts exchange/interchangeability in the transaction ME22N,
    While using ME22N we are exchanging  main item with interchangeable part and while doing so we want to copy pricing and conditions from main item to sub item.
    But its not happening.
    As per sap help its possible, details describe below.
    http://help.sap.com/erp2005_ehp_04/helpdata/en/c2/0a5288b77d11d3bcce00105ab03aee/content.htm
    Price Determination by Copying from Main Item
    In the case of price determination by copying from the main item, the net price of the originally ordered part is still used for the superseding part in a part exchange.
    The system copies all conditions from the main item to all sub-items and takes into account the order quantity for the main item when calculating scale prices. It does not take into account the conditions and scale prices that exist for the interchangeable part.
    You cannot change the conditions, which have been copied from the main item, at sub-item level. It is possible, however, to define additional conditions for each sub-item.
    Prerequisites
    A calculation schema, which can be altered on an individual basis in Customizing, has been supplied for the price determination.
    In the vendor master record, you have set the schema group 09 (interchangeable material).
    But in customizing I didnu2019t find value 09 for schema group .
    Can any buddy through some light on missing pieces which need to be set?
    Thanks
    Regards
    Ritesh

    Hi,
    Can you check few more things and tell me?
    - In this exit, does XVBPA and XVBAP contains all the line items. ( main and sub items ).
    - In Sales order creation time, do these table have VBELN populated when this exit triggers.
    - If you modify XVBPA or XVBAP in this exit, do they get overwritten after that.
    Try this code. See if it works.  Let me know if you still have a problem.
    DATA: wa_hvbpa LIKE vbpa,
          wa_xvbpa like vbpa.
    CLEAR: wa_hvbpa, wa_xvbpa.
    * check if HVBAP and VBAP line items are not same
    IF vbap-posnr <> hvbap-posnr.
    * read the ****-to partner from main-item
      READ TABLE xvbpa INTO wa_hvbpa WITH KEY posnr = hvbap-posnr
                                              parvw = 'WE'.
      IF sy-subrc = 0.
    *   read the line item data for sub-item based on main item
        READ TABLE xvbap WITH KEY posnr = vbap-posnr
                                  uepos = hvbap-posnr.
    * See if current line is the child of that BoM parent
        IF sy-subrc = 0.
          MOVE wa_xvbpa-kunnr TO xvbpa-kunnr.
          MOVE xvbap-vbeln TO wa_xvbpa-vbeln.
          MOVE xvbap-posnr TO wa_xvbpa-posnr.
          MOVE 'WE' TO wa_xvbpa-parvw.
          MODIFY vbpa FROM wa_xvbpa.
        ENDIF.
      ENDIF.
    ENDIF.
    Regards,
    RS

  • Transaction to maintina Billing Plan for Sales order item

    Hi All,
    Is there any transaction other than VA01/VA02 to maintian Billing plan for Sales order item.
    Thanks & Regards,
    Rajanidhi Rajasekeran.

    It is possible to maintain Billing Plan in Sales Document Type (VOV8), as well as Item Category level (VOV7). As you want it at Item level, maintain the same in Item Category Configuration at Item level & it will by default be captured in Sales Order at Item level.
    Step 1: Sales Document Type
    IMG > Sales and Distribution > Sales > Sales Documents >
    Sales Document Header:
    1. Sales Document Type:The sales document types represent the different business transactions, such as Inquiry, Quotation, Sales Order, etc. To create new sales order type, always copy as with reference to similar sales order. If possible use standard sales order.
    2. Define Number Ranges For Sales Documents: Maintain number range with discussion with core team.
    3. Assign Sales Area To Sales Document Types:
    A. Combine sales organizations / Combine distribution channels / Combine divisions: Ensure to maintain these, else Sales Order creation will give error.
    B. Assign sales order types permitted for sales areas: Assign only required Sales Order Types to required Sales Area. This will minimize selection of Sales Order Type as per sales area.
    Sales Document Item:
    1. Define Item Categories: If possible use Standard Item Category. Incase if required to create new, copy as from standard & maintain New.
    2. Assign Item Categories: If possible, use standard. Formula for deriving item category: Sales Document Type + Item Category Group + Usage + Higher Level Item Category = Item Category
    Regards,
    Rajesh Banka

  • How to show view tab Main Report and all of Sub Report in one action through Visual FoxPro

    How to show all view tab (Main Report and all of Sub Report) in one action.
    I already know how to show Main Report with this code sample:
    oRptRun=createobject("CrystalRuntime.Application")
    oRptView=this.Parent.oleRptViewer
    oRptOpen=oRptRun.OpenReport('MyReport.rpt')
    oRptView.ReportSource=oRptOpen
    oRptView.ViewReport
    Inside the 'MyReport.rpt' it has 2 subreports:
    1. MySubReport_1
    2. MySubReport_2
    I try to show MySubReport_1 and MySubReport_2 together with their own Main Report with this code sample:
    oRptRun=createobject("CrystalRuntime.Application")
    oRptView=this.Parent.oleRptViewer
    oRptOpen=oRptRun.OpenReport('MyReport.rpt')
    oRptSub1=oRptOpen.OpenSubreport('MySubReport_1')
    oRptSub2=oRptOpen.OpenSubreport('MySubReport_2')
    oRptView.ReportSource=oRptOpen
    oRptView.ViewReport
    Did I miss something because there was only view tab 'Preview' (Main Report) shown without view tab MySubReport_1 and MySubReport_2.
    Thank you.

    Your right, there is only one tab to view the report.
    To open the subreports you will need to click on them in the main report. I don't know of a way to open them programmatically like you are doing here
    http://diamond.businessobjects.com/robhorne</a>

  • Copy BILLING PLANS from Quotation to Sales Order.

    Hi Guys,
    I am trying to copy the billing plans from quotation to sales order(SO), when CREATED BY REFERENCE from quotation.
    Quotation HEADER LEVEL Billing plans -> SO Header Level Billing plans
    Quotation ITEM LEVEL Billing plans -> SO ITEM LEVEL Billing plans
    I have already tried to use copy control routine 402 by adding a statments to copy internal table CPFLT to XFPLT. It did not work.
    I will appreciate if somebody can tell how to accomplish this task. It is for ECC 6.00
    Thanks,

    Hi Manoj,
    I know its very late to provide the solution. Thought of sharing since I had a similar requirement as yours and got the solution.
    Here is the Solution::::
    1) Let 402 routine stay in the config and do not add any custom code in it.
    2) In TCode: VTAA , in FPLA tab, copy the routine 251 (Conditions) and copy the below mentioned code..thats it...
    FORM DATEN_KOPIEREN_251.
    *{   INSERT         ECDK900223                                        1
    LOOP AT CFPLT.
    MOVE-CORRESPONDING cfplt TO FPLT.
    CLEAR FPLT-FPLNR.
    FPLT-FPLNR = FPLA-FPLNR.
    MOVE-CORRESPONDING FPLT TO XFPLT.
    XFPLT-UPDKZ = 'I'.
    APPEND XFPLT.
    CLEAR XFPLT.
    ENDLOOP.
    UPD_FPLT = 'I'.
    *}   INSERT
    ENDFORM.
    Now you should be able to copy the Billing plan from Quotation into Sales Order.
    Reward if helpful
    Thanks,
    Maqsood.

  • How to enable Billing plan tab in sales order (lean) with NWBC

    Dear All,
    The Billing plan tab in sales order (lean) is not availabe with NWBC. How to enable this tab?
    Is there is any documentation to do the modifications of NWBC's webdynpro screens?
    for example, there is a standard webdynpro screen in NWBC from SAP best practices to create sales order (lean). The lean sale order screen having restricted elements and tabs when compare with standard SAP GUI (t code va01).
    So I want to include the few missing tabs for data entry.
    any documentation or solution?
    thanks in advance,
    Suresh Yerra.

    Dear All,
    Is there is any documentation to do the modifications of NWBC's webdynpro screens?
    for example, there is a standard webdynpro screen in NWBC from SAP best practices to create sales order (lean). The lean sale order screen having restricted elements and tabs when compare with standard SAP GUI (t code va01).
    So I want to include the few missing tabs for data entry.
    any documentation or solution?
    Thanks,
    Suresh Yerra.

  • Copy billing plan lines from one sales document to another

    HI,
    we want to copy the open billing plan lines from one sales document to another, which routine should we use in the copy control in configuration?
    we tried to use,401 and 402 but with no success..
    it's should'nt be a standard process with out any development?
    Best Regards
    Yehudit

    Hi,
    Check where you entering this routine
    If your billing plan at header then enter it at header in copy control, if billing plan is item level then maintain at Item level in copy control
    Kapil

  • How to change the currency in Billing plan in SO line item

    Hi Experts
    Pls help in following scenario.
    Company Code Currency: HKD
    Sales Document Currency: INR(Indian Rupees)
    Item Pricing Condition Currency(PR00): 100 USD
    Item Netvalue: 4800INR(System caluculated as per exchange rate type M)
    Document Netvalue: INR 4800
    The sales document item is linked to a billing plan.
    I wanted to maintain 100USD in the billing plan.
    When i goto Sales->item-->Billing Plan, The currency in billing plan screen is document currency and is greyed out.
    How to change the Currency in Billing plan (to Item Condition currency) and maintain the Billing value in USD?
    Pls help.
    Regds
    Hari

    Currency change we wanted to do is not during Invoicing.
    In billing plan itself we want to change the currency setup the billing value in item condition currency.
    Any one, pls help.

  • How to view existing plan details?

    Does anyone know whether I can view my existing plan details on the BT website?  The various package names are getting less and less clear - eg which type of calls are free - and the charges are getting more and more unfathomable.  Thanks.   Dolphin

    Hi Dolphin,
    Welcome to the forum.  Have you setup online billing?  This will allow you to keep an eye on your account to see what you are paying for.
    Please visit this website to setup an online billing profile My BT: https://www.bt.com/reg/consumer/displayPage.do?journeyType=consumer_online_registration&page=registr...
    Let me know if you have any problem in setting this up.
    Cheers
    Sean
    BTCare Community Manager
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

Maybe you are looking for

  • A lot of albums in the store that are duplicates...WHY???

    I'm on a shopping spree of songs (since I got a number of free song credits) and I was searching through Bob Dylan's albums. A good number of his albums have duplicates. They seem to be exactly the same but are listed twice (Freewheelin' and Nashvill

  • Values of F4 help are not returned.

    Hi, I had a requirement to add a F4 help  for batches in VL02n transaction. It is using a collective search help MCH1for the F4 help . I created 1 elemntary search help ,with a necessary view. I then added my elementary search help to the collective

  • SRM 7 Contract Distribution not possible in PPS

    Hi all, We're on SRM 7 / ECC6 EHP3, and activated PPS. I have been told that for PPS the  distribution is not supported completely, and hence the functionality is disabled, NOTE 1354971. My problem is, since we have activated the PPS functionality in

  • PSE 11 suddenly stops working

    Hi there, I have never had issues with PSE 11 at all, nor PSE 9 prior to that.  Suddenly, I am experiencing "fault bucket" errors and the "photoshop elements 11 has stopped working" error.  It always occurs when I am accessing a plug-in; either a Top

  • Premiere media encoder

    I want to encode my film in a 1920 x 1080 resolution and 5.1 audio to a mp4-file. I tried to use an AVC codec (H264). There you can export the audio in 5.1 (aac! no ac3) This definitely works for shorter films, but my film is 80min long and after a 1