BAPI or FM for changing billing plans of a sales order

Hi guys,
I tried the FMs BILLING_SCHEDULE_SAVE and BILLING_SCHEDULE_MAINTAIN for updating the billing plan of an SO but it doesn't work. Tried adding coomit work after calling the FMs but didn't affect the results.
Can anyone provide me with a BAPI or FM for updating the billing plan?

Below is a sample code.
I am able to delete the details....
Take a look...:)...imp to add wait for few seconds
REPORT z.
PARAMETER: vbeln TYPE vbak-vbeln.
PARAMETERS: fplnr TYPE fplnr.
DATA: t_zfpla TYPE STANDARD TABLE OF fplavb WITH HEADER LINE.
DATA: t_zfplt TYPE STANDARD TABLE OF fpltvb WITH HEADER LINE.
DATA: t_fpla_new TYPE STANDARD TABLE OF fplavb WITH HEADER LINE.
DATA: t_fpla_old TYPE STANDARD TABLE OF fplavb WITH HEADER LINE.
DATA: t_fplt_new TYPE STANDARD TABLE OF fpltvb WITH HEADER LINE.
DATA: t_fplt_old TYPE STANDARD TABLE OF fpltvb WITH HEADER LINE.
*DATA fplnr TYPE fplnr.
IF NOT vbeln IS INITIAL.
  SELECT SINGLE rplnr INTO fplnr FROM vbak WHERE vbeln = vbeln.
ENDIF.
CALL FUNCTION 'BILLING_SCHEDULE_READ'
  EXPORTING
    fplnr = fplnr
  TABLES
    zfpla = t_zfpla
    zfplt = t_zfplt.
LOOP AT t_zfpla.
  MOVE-CORRESPONDING t_zfpla TO t_fpla_old.
  t_fpla_old-updkz = 'D'.
  APPEND t_fpla_old.
ENDLOOP.
LOOP AT t_zfplt.
  MOVE-CORRESPONDING t_zfplt TO t_fplt_old.
  t_fplt_old-updkz = 'D'.
  APPEND t_fplt_old.
ENDLOOP.
BREAK-POINT.
*CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
TABLES
   fpla_new = t_fpla_new
   fpla_old = t_fpla_old
   fplt_new = t_fplt_new
   fplt_old = t_fplt_old.
DATA fpltr TYPE fpltr.
CALL FUNCTION 'BILLING_SCHEDULE_MAINTAIN'
  EXPORTING
  I_FPLA           =
  I_FPLT           =
   i_upd_fpla       = 'X'
   i_upd_fplt       = 'X'
    i_fplnr          = fplnr
IMPORTING
  E_DATALOSS       =
  E_UPD_FPLA       =
  E_UPD_FPLT       =
   e_fplnr          = fplnr
   e_fpltr          = fpltr
TABLES
    fpla_new = t_fpla_new
    fpla_old = t_fpla_old
    fplt_new = t_fplt_new
    fplt_old = t_fplt_old.
WAIT UP TO 2 SECONDS.

Similar Messages

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

  • Bill plan of a Sales Order/Contract

    Hi,
    Where do we create/update the bill plan for a sales order/contract.
    I tried VA41 where a bill plan button is provided. But need to understand the bill plan from a functional perspective.
    Any short summary on the same will be helpful.
    Also please provide Transaction/steps to update a bill plan.
    Thanks.
    Shreyas

    Hi
    A billing plan is a schedule of individual billing dates
    for a single item in a sales document.
    You can define a billing plan at header level, which is
    then valid for all items assigned to it.
    During sales order processing, the system determines from
    the item category whether a billing plan is required and,
    if so, which type of plan: The type of billing plan that
    is determined at this point is set up in Customizing and
    cannot be changed in the sales document.
    For each billing plan you create, you can enter a freely-
    definable search term in the details screen of the billing plan in the sales document.
    When you save the document, the system automatically
    assigns a number that later uniquely identifies the
    individual plan.
    You can use the search term later to locate specific billing plans.
    Transaction code for Sales order - VA01, VA02 & VA03
    Kindly check the following link for more information on Billing plan:
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/560674545a11d1a7020000e829fd11/frameset.htm
    kindly reward points for useful answers!
    best regards,
    Thangesh

  • Billing plan dates in Sales order

    Hi Experts,
    i am creating a sales order and i need to populate the date in billing per from Ztable as per payment terms.
    1 . the enhancement i am using is V60F0001 - > EXIT_SAPLV60F_001 and inside i have kept a break point. but it is not stopping. i have also created the project in CMOD and assigned this enhancement but still it is not working.
    2. is there any enhance ment or user exit i need to use.. to change the date in billing plan for sales order.
    is there any BADI i can change the billing plan dates.
    Thanks in Advance.

    Hi,
    Yes this is std behaviour.
    You need to do some enhacement to get this working.
    BR

  • What is the table for checking billing types assigned to sales orders

    Hi Folks,
    Good morning!
    Could you please help me how to check the billing types assigned to sales documents.
    What is the table to see billing types assigned to sales documents.
    Regards,
    Sarath

    Hello Sarath,
    As mentioned by Siva in the above the table name is TVAK but if you are a functional guy then you should go by the functional assignment.We are assigning the default billing type in Tcode= VOV8.
    All sales document control you can find over here.
    Needless to mention this Billing type you are assigning over here is auto proposed during billing in VF01. But you have option to choose another billing type in VF01 itself considering you have maintained the Copy Control for that.
    Thanks,
    Suman$

  • Alert for change in due date on sales order

    Hi,
    I would like the system to create an alert when ever a user changes the due date on an existing sales order. The alert should only be triggered once when the change takes place.
    Please help
    Kind Regards
    Grant

    Grant,
    You could use the Query below 
    SELECT DISTINCT T1.DocNum AS 'Document Number', T1.CardCode, T1.CardName, T0.DocDueDate [Old Due Date], T1.DocDueDate [New Due Date] FROM  [dbo].[ADOC] T0  INNER JOIN  [dbo].[ORDR] T1 ON T0.DOCNUM = T1.DOCNUM WHERE T0.ObjType = N'17'   AND  T0.DocNum = 400000
    AND T1.DOCDUEDATE <> T0.DOCDUEDATE
    NOTE: The number of times the Alert appear cannot be controlled through a Query, it is a setting in the Alerts windows. 
    Suda

  • BAPI_ADMGMTSO_CHANGE for change billing data set of mam order

    Dear,
    i  change Start of Copy/Publication Date Period of mam order using  BAPI_ADMGMTSO_CHANGE this bapi but the billing dataset can't change it's date(i.e serv.date,edservdate).
    Give the solution for above problem.

    Hi,
    in this BAPI 'BAPI_ADMGMTSO_CHANGE' you have to pass update parameter.
    for example you are going to change item data, then you have to update
    item table and itemx table.
    and check the documentation of the BAPI.
    Test program is also avilable for this BAPI. in SE37 give the BAPI name and click the 'Where used list' button, it will show the test program.
    Regards,
    Boobalan S

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

  • Field/Table to change the header tick in sales order billing plan

    Hi SD Guru's
    I am using a GUI screen to create standard sales order (VA01). Since my order dates at header and line item level can differ, i want the field name or table name of the header tick which is taken as default from my billing plan in my sales order.
    Or is there any setting where my billing plan at item level is not defaulted from my header.
    Its really urgent. Would appreciate your reply.
    Regards
    Ravi

    Hi Ravi,
    I'm unsure whether this will help you or not. In VOV7, choose your It Cat, in detailed screen of It Cat settings there's a checkbox with "Business data" when not checked which will allow you to change Data at Item level.
    Regards
    SD

  • BAPI for "Change Base Planning Object"

    Hi
    Is there any BAPI for "Change Base Planning Object" ( TC KKE2).
    I need to change the Price of a Resource in the Cost Items for a Base Planning Object.
    So if any one know the BAPI for this topic please let me know, and if possible send me your code also it will be really help full.
    Regards

    I didn't find a BAPI to do this. I had to do it by a Batch Input.

  • Customer exit for tab 'Billing Plan' at item level in VA02

    Hi gurus,
    is there any customer or user exit for tab 'billing plan' in va02 where we find other tab like SALE A, SALES B, SHIPPING etc, i allready tried mv45afzz (userexit_field_modification) and exit V60F0001( Cmod). the requirement is to suppress field NET VALUE for certain user n based upon sale order type. so i cant use transaction variant.
      well i found one include "RV60FUS4" which contain form 'userexit_field_modification' but i dont know how to change the code n through which user exit.
    any reply will be awarded.
    thanks

    well include "RV60FUS4" which contain form 'userexit_field_modification' worked with development key from sap.
    thanks

  • FBE2: BAPI or FM for Changing and Deleting Payment Advice

    Hi,
    I am looking for BAPI or FM for changing & deleting payment advice as we can accomplish from FBE2.
    This is EC 6.0 upgrade issue for not be able to post using CALL TRANSACTION in background mode.
    I tried the below FM's in the Function group  FARMATCH, but all have them have the follwing code to select payment advice Header Table [AVIK].  
    SELECT * FROM AVIK INTO TABLE LT_AVIK WHERE (LT_WHERE) AND
                                                  AVSID LIKE '09%'.    "This is not the case for my requirement
    FARMATCH_CHANGE_PAYMENT_ADVICE               
    FARMATCH_DELETE_PAYMENT_ADVICE               
    I found another set of FM's  REMADV_CHANGE  &  REMADV_DELETE but I am not sure if i can
    achieve the same functionality of change and delete that we can do using FBE2.
    If anyone had similar scenario, Appreicate your feedback.

    Below is a sample code.
    I am able to delete the details....
    Take a look...:)...imp to add wait for few seconds
    REPORT z.
    PARAMETER: vbeln TYPE vbak-vbeln.
    PARAMETERS: fplnr TYPE fplnr.
    DATA: t_zfpla TYPE STANDARD TABLE OF fplavb WITH HEADER LINE.
    DATA: t_zfplt TYPE STANDARD TABLE OF fpltvb WITH HEADER LINE.
    DATA: t_fpla_new TYPE STANDARD TABLE OF fplavb WITH HEADER LINE.
    DATA: t_fpla_old TYPE STANDARD TABLE OF fplavb WITH HEADER LINE.
    DATA: t_fplt_new TYPE STANDARD TABLE OF fpltvb WITH HEADER LINE.
    DATA: t_fplt_old TYPE STANDARD TABLE OF fpltvb WITH HEADER LINE.
    *DATA fplnr TYPE fplnr.
    IF NOT vbeln IS INITIAL.
      SELECT SINGLE rplnr INTO fplnr FROM vbak WHERE vbeln = vbeln.
    ENDIF.
    CALL FUNCTION 'BILLING_SCHEDULE_READ'
      EXPORTING
        fplnr = fplnr
      TABLES
        zfpla = t_zfpla
        zfplt = t_zfplt.
    LOOP AT t_zfpla.
      MOVE-CORRESPONDING t_zfpla TO t_fpla_old.
      t_fpla_old-updkz = 'D'.
      APPEND t_fpla_old.
    ENDLOOP.
    LOOP AT t_zfplt.
      MOVE-CORRESPONDING t_zfplt TO t_fplt_old.
      t_fplt_old-updkz = 'D'.
      APPEND t_fplt_old.
    ENDLOOP.
    BREAK-POINT.
    *CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
    TABLES
       fpla_new = t_fpla_new
       fpla_old = t_fpla_old
       fplt_new = t_fplt_new
       fplt_old = t_fplt_old.
    DATA fpltr TYPE fpltr.
    CALL FUNCTION 'BILLING_SCHEDULE_MAINTAIN'
      EXPORTING
      I_FPLA           =
      I_FPLT           =
       i_upd_fpla       = 'X'
       i_upd_fplt       = 'X'
        i_fplnr          = fplnr
    IMPORTING
      E_DATALOSS       =
      E_UPD_FPLA       =
      E_UPD_FPLT       =
       e_fplnr          = fplnr
       e_fpltr          = fpltr
    TABLES
        fpla_new = t_fpla_new
        fpla_old = t_fpla_old
        fplt_new = t_fplt_new
        fplt_old = t_fplt_old.
    WAIT UP TO 2 SECONDS.

  • BAPI for changing PRT link to operation in order in Plant maintenance...

    Hello,
    I am working on Plant maintenace module. I want to change the PRTs associated to an operation (VORNR) of an Order (AUFNR) programatically.
    The PRT documents are created automatically in SAP with newer versions. Whenever a newer version is encountered, The PRT link with the Operation of an order should be changed programatically.
    Is there any BAPI avaialable to do change PRT linkt o operation of order  ?
    Thanks
    Regards,
    Rajesh.

    No such BAPI exists...

  • Can't change quantity when copy from Sale order for Delivery

    Hi all!
    Can i use authorization for can't change quantity when copy from Sale order for Delivery.

    Tien,
    Approval will not work when you have mutiple rows of data.  You would have to work with SP Transaction Notification
    There has been threads before on the forum on the same topics.
    Block the Quantity in Sales Delivery
    Approval Procedure for chaning quantity in Delivery Document
    Suda

  • Changing proposed delivery date in sales order for one specific sales org

    Hi All,
    I want to change proposed delivery date in sales order automatically for one specific sales org only without changing lead time in VOV8.
    For that can I use MV45AFZZ. But it is asking access key to make changes. Is there any other user exit for the same. And how does exactly change it.
    Thanks in advanced.
    Points will be awarded.
    Regards,

    EXIT_SAPFV45E_001 has nothing to do with this - it is meant to update the purchase order from a sales order. It might not even be triggered if the sales order has no link to a purchase order.
    USEREXIT_SAVE_DOCUMENT is not really good for this either, because the delivery date has to be changed before that. If memory serves, it also influences the schedule lines and probably the ATP check and such. I would strongly advise against it. One of the other routines in MV45AFZZ should do just fine, USEREXIT_MOVE_FIELD_TO_VBAK for example.

Maybe you are looking for