Current Position:Home > Problem in updating Billing plan while changing Sales order

Problem in updating Billing plan while changing Sales order

Update:11-30Source: network consolidation
Advertisement
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

The Best Answer

Advertisement
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
  • Problem in updating Billing plan while changing Sales order Update:11-30

    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 p

  • Bill plan of a Sales Order/Contract Update:11-30

    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

  • How to enable Billing plan tab in sales order (lean) with NWBC Update:10-11

    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

  • Creating Billing Plan data for sales order using BAPI_SALESORDER_CREATEFROM Update:10-11

    Hi All, We are using BAPI_SALESORDER_CREATEFROMDAT2 to create the sales order.We are unable to get the fields for billing plan tab in this BAPI. Kindly let me know the fileds in BAPI that corresponds to the fileds of billing plan in sales order. Than

  • Creating Billing Plan data for sales order using BAPI Update:10-11

    Hello, Someone ones if there is any way to create a sales order (BAPI) and then create a billing plan (by means of another BAPI)? Or is there any way to create both at the same time? Kind Regards.Hi David and Nisha here is the code for creating sales

  • Problem in updating the partners data for sales order Update:11-30

    hi all.. am using bapi_salesorder_createfromdat2 to create salesorder.. in the bapi am passing the partners data as follows.. partner-partn_role = 'ZD'. partner-partn_numb  = <cust.no.> partner-itm_number = <item no.> after that..,the sales or

  • Billing plan dates in Sales order Update:11-30

    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

  • BAPI or FM for changing billing plans of a sales order Update:11-30

    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 o

  • BAPI or Function to update Billing Plan in Sales Order Items Update:11-30

    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 up

  • Update termination dump while saving sales order after updating billing pla Update:11-30

    Hi, Our client is facing a strange issue. The client has a sales order already created and WBS element assigned to it automatically. The sales order has many items, which are billed periodically. Whenever the particular item has to be billed. user at