How to update Billing Plan using BAPI_SALESORDER_CHANGE

Hi,
In my case initailly sales order header data is created and saved, with reference to SO Project is created and then item level data is updated.
So clients requirement is to create any upload programme which can use for mass upload.
i.e to develop a program to upload,
i) Items in Sales Order.
ii) Billing Plan & Pricing Conditions in SO
I am trying to use BAPI_SALESORDER_CHANGE for this requirement. Problem is in this scenerio user exit is already used which validate "Amount" at item level and "Bill. value" in Billing plan tab should be same.
As observed Billing plan data can not be updated using this BAPI.
Even I've tried to use BDC for this requirement, but as we need to double click on line item while updating billing plan data and conditions it does  not work while recording.
Incase anyone have worked on similar scenerio and found out solution, please share all your inputs.
Warm Regards,
Nitish

Hi,
The following code will take you to Billing plan tab in BDC.
  PERFORM bdc_dynpro      USING 'SAPMV45A' '0102'.
  PERFORM bdc_field       USING 'BDC_CURSOR'
                                'VBAK-VBELN'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '/00'.
  PERFORM bdc_field       USING 'VBAK-VBELN'
                                wa_vbap-vbeln.             
  PERFORM bdc_dynpro      USING 'SAPMV45A' '4001'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '=ITEM'.
  PERFORM bdc_field       USING 'BDC_CURSOR'
                                itemno . "'RV45A-MABNR(wa_vbap-posnr)'.
  PERFORM bdc_dynpro      USING 'SAPMV45A' '4003'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '=T\06'.
  PERFORM bdc_dynpro      USING 'SAPLV60F' '4001'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '/00'.
Regards,
P Gomatheeswaran

Similar Messages

  • How to update billing plan date in contract

    Hi guys!
    I*m using the bapi   BAPI_CUSTOMERCONTRACT_CHANGE to change some data in my contract
    However, I want to set the date for the beginn of the billing plan.  (Billing plan start date)  and i don't find this field in the BAPI.
    So is there a way to set and change this date?
    ...by the way. There is a rule initiated named "rule for origin of start date of billing plan". This should set the billing plan start date to the contract start date. - The contract start date is updated with BAPI_CUSTOMERCONTRACT_CHANGE - but the changes doesn't affect the billing plan startdate.
    If i edit the contract, the changes to the billing plan occur automatically, but not in the BAPI
    thanks!!
    Edited by: tom54321 on Aug 6, 2009 9:36 AM

    Hi,
    Plz check the link given below:
    BAPI_CUSTOMERCONTRACT_CHANGE is giving dump when start date of contract
    It may help you.
    Thanks & Regards,
    Sarita Singh Rathour

  • 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

  • BAPI or Function to update Billing Plan in Sales Order Items

    Hello all !
         I have to update some fields in the billing plan data in sales order's item (VA02) with a program (receiving it's data form csv files).
         I've searched a BAPI but infortunately there are no "Billing Plan" data structure to update thoses fields.
         The transaction in VA02, the billing plan data is found in FPLT table, linked to VBKD table with key field VBKD-FPLNR.
         I've tried theses Functions with no result :
    BILLING_SCHEDULE_MAINTAIN
    BAPI_SALESORDER_CHANGE
    BAPI_SALESORDER_CHANGEBOS
    BAPI_SALESDOCUMENT_CHANGE
    For now I'm searching how VA02 is saving the billing plan data, but it's very tricky and maybe not reusable.
         If someone have an idea for updating billing plan data in a abap program ( and not a batch input of VA02 because the line to update can have a variable position ).
    Thanks a lot.
    Message was edited by: Thomas B.

    Thanks Kiran I for your answer.
        This function might be helpful but there is a strange control at the begining of the code.
    (I guess VBAK must be filled somewhere..)
      IF I_VBELN NE VBAK-VBELN.
        MESSAGE A044 WITH I_VBELN VBAK-VBELN.
      ENDIF.
    But I've found another way to update the billing plan dates: using the function BILLING_SCHEDULE_SAVE (with BILLING_SCHEDULE_READ before). My point is solved.

  • I can not create  Billing Plan using BDC

    Dear All
       I create a RFC to generate SO ,    RFC name  is ZAPCREATE_SO.
       Because BAPI_CONTRACT_CREATEFROMDATA2  can not update Billing plan.
       So I  use  BDC to  update billing Plan in RFC "ZAPCREATE_SO" ,
       But The RFC can not update biling plan  if the RFC is call in lotus or non-SAP system. And not any error message
       So funny,The RFC can update biling plan  if the RFC is call in SAP.
      Anyone know why? Thanks in advance.
    Shi Chun Qing

    Dear Sandeep Kumar
       Could you give me more information? I  am not sure understanding your meaning. Thanks.

  • How to Update a Row using ADF

    Hi every one
    Can any one help me out, How to Update a Row using ADF.
    Thanks in advance

    In addition to Clear to my question
    By Using ADF BC How can I update a record in a database.
    I have VO and EO associated with a table.
    How can I update a record using ADF BC
    Message was edited by:
    user616296

  • How to update flex to use air 1.5.1

    How to update Flex to use air 1.5.1?
    The last Nightly Build (3.4.0.5042) release today has the
    "old" 1.5 version of air sdk.
    Thanks

    Currently, you have to overlay the AIR 1.5.1 SDK on top of
    your Flex SDK. There are instructions in the AIR 1.5.1 release
    notes:
    http://www.adobe.com/support/documentation/en/air/1_5_1/releasenotes_developers.html#sdk
    The AIR 1.5.1 SDK is available here:
    http://www.adobe.com/products/air/tools/sdk/

  • How to update the ztable using screen.

    hi experts,
    i have one ztable with 8 fields
    and i created one screen with 8 fields
    how to update the ztable using this screen menas when i press the some push button in my screen the table should update.
    Devi

    hi
    check the link shown below
    Coding & screen shots of how to update a database table from screen(Module poool)
    http://www.scribd.com/doc/15628693/moduleprog090311165111phpapp011
    in the attachment u will find
    data  : begin of i_ysrtmm occurs 0,
            sno type ysrtmm-sno,
            sname type ysrtmm-sname,
            scity type ysrtmm-scity,
            sedu type ysrtmm-sedu,
            spercent type ysrtmm-spercent,
            select(1),
            end of i_ysrtmm.
    in the SE51 click on layout & in that menu goto - secwindow- enter the internal table i_ysrtmm
    and click on get from program.u will get all the fields of the internal table select all of them except
    SELECT  field  and then drag and drop on table control . double click on the table control u see the attributes screen there in the w/colselect enter i_ysrtmm-select for tab selection of table control.
    Regards

  • How to update the Ztable using modulepool Tablecontrol...

    Hi All,
    could anyone help me how to update the Ztable using modulepool Tablecontrol...
    if it is possible give me a example with code..
    Many thanks in advance...!!
    Rajesh

    Hi,
    For that pls refer to the link:
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbac3735c111d1829f0000e829fbfe/frameset.htm
    Also refer the sample program:
    RSDEMO02
    Then for updating:
    modify the internal table(which u used to populate the tabcntrl) from the table control.
    Then update database table like:
    update dbtab from table itab.
    Regards,
    Renjith Michael.

  • Problem in updating Billing plan while changing Sales order

    Hi All,
            I am using the BAPI 'BAPI_SALESORDER_CHANGE' to change a Prepaid Sale order.After calling this BAPI ,I am calling the function module <b>'BILLING_SCHEDULE_SAVE'</b> to update the Billing plan of the changed Sale order(Billing plan dates for Billing type ZF1 are changed).
         The updated date values are getting reflected in the screen when I view through the transaction VA02 and the values are also updated in FPLT table but the values are not getting reflected in the table VKDFS.
       Since the values are not getting reflectedin the table VKDFS the billing date is not correct while we view in the transaction VF04.
       Please provide your valuable suggestions for updating the Billing date in VKDFS table.
        Thanks in advance for your help.
    Thanks and regards,
    Siva

    Hi,
    I had the same problem. Here is an example code to resolve it:
    REPORT  ytestfg.
    DATA: i_bsid LIKE bsid OCCURS 0,
          i_bsid2 LIKE bsid OCCURS 0.
    TABLES: bsid.
    DATA: doc     LIKE     vbak-vbeln,
          pos(6) TYPE n.
    DATA e_fpla     LIKE     fpla.
    DATA e_fplt     LIKE     fpltvb OCCURS 0 .
    DATA: zfpla     LIKE     fplavb OCCURS 0,
    zfplt     LIKE     fpltvb OCCURS 0.
    DATA zfplt2     LIKE     fpltvb OCCURS 0 WITH HEADER LINE.
    doc = 'G03060619'.
    pos = '000010'.
    CALL FUNCTION 'SD_SALES_DOCUMENT_READ'
      EXPORTING
        document_number = doc.
    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 <> 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[].
    READ TABLE zfplt2 INDEX 1.
    zfplt2-afdat = '20080927'.
    Very important to set field updkz = 'U' ***
    zfplt2-updkz = 'U'. "--> UPDATE!!
    MODIFY zfplt2 INDEX 1.
    CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
      TABLES
        fpla_new = zfpla
        fpla_old = zfpla
        fplt_new = zfplt2 " --> NEW
        fplt_old = zfplt.
    CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Regards,
    Edited by: PHO_BA on Mar 9, 2009 5:28 PM

  • 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.

  • How to pass pricing type using BAPI_SALESORDER_CHANGE

    Hi all,
    How will we use BAPI_SALESORDER_CHANGE  to re-price the orders.
    There is parameter LOGIC_SWITCH  which can be used to export the pricing type.
    But what all are the other parameters we should pass?
    Has anybody worked in such a context.?

    Hi , Here is what you should pass to update the pricing with a particular pricing type :
    1)  SALESDOCUMENT = your sales order number
    2) ORDER_HEADER_INX-UPDATEFLAG = 'U'
    3)  LOGIC_SWITCH-PRICING =  "your value"
    4 ) *order_item_in-itm_number = * the item number for which pricing should be triggered
    5) *order_item-inx-ITM_NUMBER   = * the item number for which pricing should be triggered
    6) *order_item-inx-UPDATEFLAG   = * 'U'
    regards,
    Advait

  • 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

  • Problem while updating Item category using Bapi_salesorder_change

    Hi,
    Iam facing a probelm while updating item category using bapi Bapi_salesorder_change
    In the Return table iam getting the folowing mesages.
    Inforation mesage : Field 'PSTYV' cannot be changed, VBAPKOM 000010  ready for input
    Error Message : Item 000010 cannot be processed.
    Please find the code below
    CLEAR wa_bapisdh1x.
      wa_bapisdh1x-updateflag = 'U'.
      CLEAR wa_order_item_inx.
      wa_order_item_inx-itm_number = wa_vbap-posnr.
      wa_order_item_inx-item_categ = 'X'.
      wa_order_item_inx-UPDATEFLAG = 'U'.
      APPEND  wa_order_item_inx TO it_order_item_inx.
      CLEAR wa_order_item_inx.
      CLEAR wa_order_item_in.
      wa_order_item_in-itm_number = wa_vbap-posnr.
      wa_order_item_in-item_categ = 'ABC'.
      APPEND wa_order_item_in TO it_order_item_in.
      CLEAR wa_order_item_in.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = w_vbeln
          order_header_inx = wa_bapisdh1x
        TABLES
          return           = it_return
          order_item_in    = it_order_item_in
          order_item_inx   = it_order_item_inx
    How can i correct it..
    Regards
    Kumar

    Actually iam facing a strange problem here.
    When i copy the program into another sample program and execute it iam able to change both the item catgegory and delivery block for particular sales order and item number.
    But in my main program i have BDC for MB1B transaction to create the material document.
    Once the material document is created succesfully iam using BAPI Sales_order_change to change the item category and delivery block..
    In my main program iam not to change the item catgeory getting an error field PSTYV cannot be changed.
    But the same code is running percfectly in the copied one..
    How can i correct that..
    Regards
    Kumar

  • How to see billing plan balance value ?

    Team-
    I am using billing plan with VA01 and client wants the see the remaining balance of the sales order, how can I do this without RICEF object ?
    Lets say billing plan was started with Net value 1000 for 10 periods, and of the period is paid but Net value is still showing 1000. Is there any place where I can find remaining balance of 900 ?
    Thanks

    Hi,
    Go to KKBC_KUN 
    Put sales contract number and periods from to & execute
    You will get
    Plan value which is your total contract value
    Actual value which is invoice
    Plan/actual variance which is your remaining value to be billed
    Modify layout if need more information
    Or you can view it by VA42/VA43 >> Environment >> Cost report
    Kapil

Maybe you are looking for