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

Similar Messages

  • Update termination dump while saving sales order after updating billing pla

    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 attaches milestone in the project which is updated in the billing plan of the sales order. Then user goes into change view of sales order, and sees if the billing plan is getting updated. After user sees that billing plan is updated, he tries to save the sales order and the update termination dump comes.
    We have analyzed this issue to some extent. Since the product hierarchy have been changed, the system checks for the duplicate records and throws the dump.
    We have advised the user to follow following steps also:
       1) Delete existing billing plan if any assigned to the order. You can delete the billing plan by going into CJ20N and deleting the existing milestones completely.
       2) Please ensure network in project is release and sales order does not have credit block.
       3) Change Product Hierarchy in sales order (Please do not copy and paste from Material master instead select the same through F4 for each level.
       4) Once again create the milestones as required in the Project.
       5) We need to remove block of billing plan from Project only instead of from Order.
       6) Check order in display mode and ensure billing plan has appeared.
       7) Now goto change mode of the order and carry billing.
    Above solution has solved the issue but sometimes it takes times for the above solution to work.
    The user has to repeatedly follow above steps to save the billing plan.
    We need to have permanent solution for the same. I would appreciate if anybody can help resolve this issue.
    Thanks

    Thanks All for providing me possible solutions.
    The issue is resolved by one more step into what i had suggested in my questions
    At step 3, after changing the product hierarchy, I simply go to billing plan tab, thereby generating billing plan even before I add milestones in the project.
    To my understanding, generating billing plan in the sales order must be conflicting with the milestone being added to the billing plan from the project, giving 2 billing plan numbers in the background and throwing update termination dump.
    Cheers!!

  • Creating Billing Plan data for sales order using BAPI_SALESORDER_CREATEFROM

    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.
    Thanks in Advance,
    Kiran I.

    Hi kiran
    hi Dhanapal
    i ahve the same problem which u posted..
    My scenarion is to create billing plan while creation of order using the BAPI_SALESORDER_CREATEFROMDAT2 but could not find any structure to pass billing plan details
    pls can u let me know if u found any solution for this if so can u send me detailed mail..
    i want to populate in both way header level and item level (by removing check header plan in the billing plan tab)
    Pls let me know ASAP..
    Thanks
    anil

  • 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

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

  • Error received while changing sales order.

    Hi All,
    while changing sales order we have received error message "An internal program error has occured.See note 44283".
    So could you plesae explain me what needs to be done.
    Thanks in advance.

    To avoid to store inconsistent data in the future, activate the following method of the BADI                           BADI_SD_SALES:                                                          
    > 1 - Transaction SE18                                         
    > 2 - Definition name: BADI_SD_SALES Menu: Implementation -> Overview double-click on implementation: IM_CORE_CHECK
    > 3 - Now you will get an overview on the methods and you see also that the implementation IM_CORE_CHECK is inactive    
    > 4 - Press the change button and activate                                                                               
    This check works in the following way:
    > 1 - if the number of items is less than 10 and there is an inconsistency the system will not store the data and an A-message  will occur.
    > 2 - If the number of items is greater than 10 and less than 50 and there is an inconsistency the data will be stored and an I-message will occur.
    > 3 - if the number of items is greater than 50 there is no check because performance.
    Edited by: Gerard Magorrian on Aug 6, 2010 4:01 PM

  • Getting error in while changing sales order which is created using BAPI

    Hi All,
       I have created the sales order using BAPI ( BAPI_SALESORDER_CREATEFROMDAT1 ) and i am successfully creating sales order using this BAPI. But while i want to change sales order iam changing Shipping Conditions in Header Data of sales order .its giving an error .can any know any thing about this.
    Error mesage :    No status object is available for SDI 300082407/10    (Order Number/Item Number)
    In Header i  am passing these values ...
         wa_order_header_in-doc_type = vbak-auart.
        wa_order_header_in-sales_org = vbak-vkorg.
        wa_order_header_in-distr_chan = vbak-vtweg.
        wa_order_header_in-division = vbak-spart.
    Do i required to pass the below values ? in Header structure ( BAPISDHEAD1 ).
    REFOBJECTTYPE
    REFOBJECTKEY
    REFDOCTYPE
    Regards,
    Sudhakar Reddy A

    rectified

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

  • 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

  • Creating Billing Plan data for sales order using BAPI

    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 order with bapi
    *& Report  YOBJ_BAPI_SALESORDER
    *& REPORT : CREATING SALES ORDER USING STANDARD BAPI
    *& AUTHOR : S.PAVAN KUMAR INUMARTHY
    REPORT  YOBJ_BAPI_SALESORDER.
    DATA : ORDER_HEADER_IN LIKE STANDARD TABLE OF BAPISDHD1 WITH HEADER LINE.
    DATA : ORDER_ITEMS_IN LIKE STANDARD TABLE OF BAPISDITM WITH HEADER LINE.
    DATA : ORDER_PARTNERS LIKE STANDARD TABLE OF BAPIPARNR WITH HEADER LINE.
    DATA : RETURN TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE.
    DATA : SALESDOCUMENT LIKE BAPIVBELN-VBELN.
    *APPENDING VALUES FOR HEADER.
    ORDER_HEADER_IN-DOC_TYPE = 'TA'.
    ORDER_HEADER_IN-SALES_ORG = '1000'.
    ORDER_HEADER_IN-DISTR_CHAN = '10'.
    ORDER_HEADER_IN-DIVISION = '00'.
    ORDER_HEADER_IN-SALES_GRP = '130'.
    ORDER_HEADER_IN-SALES_OFF = '1030'.
    APPEND ORDER_HEADER_IN.
    *APPENDING VALUES FOR ITEM
    ORDER_ITEMS_IN-MATERIAL = 'M-13'.
    ORDER_ITEMS_IN-PLANT = '1000'.
    ORDER_ITEMS_IN-SALES_UNIT = 'ST'.
    ORDER_ITEMS_IN-DIVISION = '07'.
    ORDER_ITEMS_IN-GROSS_WGHT = '28000'.
    ORDER_ITEMS_IN-NET_WEIGHT = '28000'.
    ORDER_ITEMS_IN-UNTOF_WGHT = 'KG'.
    ORDER_ITEMS_IN-VOLUME = '0.780'.
    ORDER_ITEMS_IN-VOLUNIT = 'M3'.
    APPEND ORDER_ITEMS_IN.
    *APPENDING VALUES FOR PARTNER
    ORDER_PARTNERS-PARTN_ROLE = 'AG'.
    ORDER_PARTNERS-PARTN_NUMB = '0000001000'.
    ORDER_PARTNERS-COUNTRY = 'DE'.
    ORDER_PARTNERS-TRANSPZONE = 'D000080000'.
    APPEND ORDER_PARTNERS.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
    *   SALESDOCUMENTIN               =
        ORDER_HEADER_IN               = ORDER_HEADER_IN
    *   ORDER_HEADER_INX              =
    *   SENDER                        =
    *   BINARY_RELATIONSHIPTYPE       =
    *   INT_NUMBER_ASSIGNMENT         =
    *   BEHAVE_WHEN_ERROR             =
    *   LOGIC_SWITCH                  =
    *   TESTRUN                       =
    *   CONVERT                       = ' '
    IMPORTING
       SALESDOCUMENT                  = SALESDOCUMENT
      TABLES
       RETURN                         = RETURN
       ORDER_ITEMS_IN                 = ORDER_ITEMS_IN
    *   ORDER_ITEMS_INX               =
        ORDER_PARTNERS                = ORDER_PARTNERS
    *   ORDER_SCHEDULES_IN            =
    *   ORDER_SCHEDULES_INX           =
    *   ORDER_CONDITIONS_IN           =
    *   ORDER_CONDITIONS_INX          =
    *   ORDER_CFGS_REF                =
    *   ORDER_CFGS_INST               =
    *   ORDER_CFGS_PART_OF            =
    *   ORDER_CFGS_VALUE              =
    *   ORDER_CFGS_BLOB               =
    *   ORDER_CFGS_VK                 =
    *   ORDER_CFGS_REFINST            =
    *   ORDER_CCARD                   =
    *   ORDER_TEXT                    =
    *   ORDER_KEYS                    =
    *   EXTENSIONIN                   =
    *   PARTNERADDRESSES              =
              IF SY-SUBRC = 0.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *           EXPORTING
    *             WAIT          =
    *           IMPORTING
    *             RETURN        =
               ENDIF.
    WRITE : 'SALES ORDER IS :', SALESDOCUMENT.
    I have tested and go it.
    please go through it

  • Problem with profitability segment derivation while posting sales order

    Hello,
    We have the issue of profitability segment being not derived when the sales order is changed using BAPI 'BAPI_SALESORDER_CHANGE'. Subsequent to calling this BAPI we execute a BDC - to derive the profitability segment - which runs well in the foreground but fails in the background. Immediate help in this regards would be of immense help.
    I have searched the forum but could not locate anything useful. There is this thread (Re: BDC for profitability segment VA02 (sales order)) citing the same problem but without answers.
    Kind Regards,
    Indu Shekar

    Probability Segment is maintained but  Profitability Segment is still grayed out.
    The only way i was able to move things to COPA  was to do a project Settlement from
    WBS element to Profitability Segment (PSA).
    But does anyone know if we can move things to COPA during Sales Order (specifically for a project-based Sales Order)?
    Thanks.

  • Problem in updating the partners data for sales order

    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 order is created succesfully .but now the problem is the partner data as shown above is not updated successfully in the item level details of sales order..
    is there any way to fix it ?
    please help me with the possible alternatives.
    thanks in advance
    suresh

    Hi Suresh,
    *Fill partner
    wa_order_partnr-partn_role = 'AH'.
    wa_order_partnr-partn_numb = '0000100001'.
    "wa_order_partnr-itm_number  = '000010'.
    INSERT wa_order_partnr INTO TABLE tab_order_partnr.
    wa_order_partnr-partn_role = 'WE'.
    wa_order_partnr-partn_numb = '0000100001'.
    "wa_order_partnr-itm_number  = '000010'.
    INSERT wa_order_partnr INTO TABLE tab_order_partnr.
    Is it a standard partner function or custom one.Check with german key words llike AH,WE.
    Regards,
    Madhu.

  • Problem while changing Sales order using 'BAPI_SALESORDER_CHANGE'

    Hi all,
    Below is my code to update delivery block value:
    FORM call_bapi_salesorder_change .
    DATA:  iv_bapi_view  LIKE order_view.
    DATA: gt_sales_doc TYPE STANDARD TABLE OF sales_key, " Document Numbers to Be Selected
            gt_items TYPE STANDARD TABLE OF bapisdit. " Order Item Data for Document Numbers
    *************************************************************8
    DATA:order_headers_out LIKE bapisdhd OCCURS 0 WITH HEADER LINE.
    DATA:order_header_inx LIKE bapisdh1x.
      DATA: lv_salesdocument LIKE bapivbeln-vbeln.
      data: lv_matnr(10) type c.
      DATA:
    gt_schdule TYPE STANDARD TABLE OF bapischdl, " for gl date & load date
    gt_schdulex TYPE STANDARD TABLE OF bapischdlx, " for partner role and partner function.
            gt_return TYPE STANDARD TABLE OF bapiret2,
            gt_itemin TYPE STANDARD TABLE OF bapisditm,
            gt_iteminx TYPE STANDARD TABLE OF bapisditmx ,
            gt_bapisdh1 TYPE STANDARD TABLE OF  bapisdh1.
      DATA:gs_head_bapi TYPE bapisdh1x,
           gs_schdule TYPE bapischdl,
           gs_schdulex TYPE bapischdlx,
           gs_return TYPE bapiret2,
           gs_itemin TYPE bapisditm,
           gs_iteminx TYPE bapisditmx,
           gs_bapisdh1 TYPE bapisdh1.
      CLEAR : gt_schdule,gt_schdulex,gs_return.
      REFRESH gt_return.
      gs_head_bapi-updateflag = 'U'.
    SORT gt_final BY vbeln.
    CLEAR gs_vbep.
    REFRESH gt_vbep[].
      CLEAR gs_final.
      LOOP AT gt_final1 INTO gs_final.
        gs_itemin-itm_number = gs_final-posnr.
    *move gs_final-matnr to lv_matnr."qx94162
       gs_itemin-material = gs_final-matnr.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            input  = gs_final-matnr
          IMPORTING
            output = gs_final-matnr.
       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = lv_matnr
        IMPORTING
         output = lv_matnr.
       gs_itemin-material = lv_matnr.
        gs_itemin-material = gs_final-matnr.
        gs_iteminx-itm_number = gs_final-posnr.
        gs_iteminx-updateflag = 'U'.""changed to I
        gs_iteminx-material = 'X'.
        " gs_schdule-req_dlv_bl = gs_final-lifsp. " Delivery block
        gs_schdule-itm_number = gs_final-posnr.
        gs_schdulex-itm_number = gs_final-posnr.
        gs_schdule-sched_line = '0001'.
        gs_schdulex-sched_line = '0001'.
       MOVE gs_final-lifsp to gs_schdule-req_dlv_bl.
        gs_schdule-req_dlv_bl = gs_final-lifsp.
        gs_schdulex-req_dlv_bl = 'X'. " Delivery block
        gs_schdulex-updateflag = 'U'.
        gs_bapisdh1-sales_org = gs_final-vkorg.
        APPEND gs_schdule TO gt_schdule.
        APPEND gs_schdulex TO gt_schdulex.
        APPEND gs_itemin TO gt_itemin.
        APPEND gs_iteminx TO gt_iteminx.
       Append gs_BAPISDH1 to gt_BAPISDH1.
        lv_salesdocument = gs_final-vbeln.
        CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
          EXPORTING
            salesdocument               = lv_salesdocument     
           ORDER_HEADER_IN             = gs_BAPISDH1
            order_header_inx            = gs_head_bapi         
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
      LOGIC_SWITCH                =
      NO_STATUS_BUF_INIT          = ' '
          TABLES
            return                      = gt_return            
       order_item_in               =    gt_itemin
       order_item_inx              = gt_iteminx
      PARTNERS                    =
      PARTNERCHANGES              =
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
          schedule_lines                = gt_schdule           
          schedule_linesx               = gt_schdulex          
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      CONDITIONS_IN               =
      CONDITIONS_INX              =
      EXTENSIONIN                 =
      NFMETALLITMS                =
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        REFRESH: gt_schdule, gt_schdulex, gt_itemin , gt_iteminx.
        LOOP AT gt_return INTO gs_return.
          WRITE / gs_return-message .
        ENDLOOP .
      ENDLOOP.
    ENDFORM.                    " CALL_BAPI_SALESORDER_CHANGE
    When I am using material value as 18342 using CONVERSION_EXIT_ALPHA_OUTPUT:
    ORDER_HEADER_IN has been processed successfully
    Material  is not defined for sales org.A101,  distr.chan.00,  language DE
    Error in ITEM_IN 000030
    SCHEDULE_IN has been processed successfully
    The sales document is not yet complete: Edit data
    Sales document 5010000715 was not changed
    and when I am using CONVERSION_EXIT_ALPHA_INPUT (000000000000018342)or  while debuging when I am changing value to  0018342 :
    I am getting below dump:
    Runtime Errors         DATA_LENGTH_0
    Exception              CX_SY_RANGE_OUT_OF_BOUNDS
    Date and Time          21.10.2010 07:22:17
    Information on where terminated
         Termination occurred in the ABAP program "SAPLVBAK" - in
          "MAP_VBAP_TO_BAPISDIT".
         The main program was "RS_TESTFRAME_CALL ".
         In the source code you have the termination point in line 168
         of the (Include) program "LVBAK001".
         The termination is caused because exception "CX_SY_RANGE_OUT_OF_BOUNDS"
          occurred in
         procedure "MAP_VBAP_TO_BAPISDIT" "(FORM)", but it was neither handled local
          nor declared
         in the RAISING clause of its signature.
         The procedure is in program "SAPLVBAK "; its source code begins in line
         99 of the (Include program "LVBAK001 ".
    The same dump I am getting while executing this above BAPI from SE37 tcode with the same test data.
    but I am able to change it though Va02 tcode.
    Edited by: Arora26 on Oct 21, 2010 7:58 AM

    Hi,
    have you searched for OSS notes? The note 1137897 looks like related to your problem. It mentions different BAPI but I assume that both BAPI reuse same routines and therefore it might solve your problem as well.
    Cheers

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

  • While saving sales order, deleted item resulting in error

    Dear All
    I am facing an issue while changing Sales Orders.
    I have set a check in a user exit that if batch is empty, display an error message. I add try to add a new line item which doesnt have batch. When i try to save, i get a message which is fine.
    But when I delete this line item and try to save again, I am still getting message. I am not sure how this is happening.
    Kindly advice.
    Regards
    Dinesh

    There's a field EKPO-LOEKZ (Deletion Indicator in Purchasing Document) for PO, but there's no such field for an SO as per my knowledge. So the only option left to you is to debug the your user-exit while saving the SO and check why its still triggering the error message. May be you can add another condition stating that the line item should have atleast material number filled, in that case if the material number is there and batch is missing, it will show an error msg.
    Regards,
    Raman.

Maybe you are looking for