FM to change / split SD schedule lines in batch

Dear all,
Following scenario:
Material A: Current available stock: 1000 pcs,
            Purchase Order 10000 pcs arriving on 01.09.06
            SD order with 2000 pcs.
When I run the availability check for the SD order in VA01, the system would create 2 schedule lines:  1000 pcs today & 1000 pcs 01.09.06.
We would like to use a batch program instead of the online availability check in order to calculate the confirmed qty. based on our rules.
What I'm looking for is a FM / BAPI which allows the created more than one schedule line and pass the confirmed quantity, eg. 900 pcs scheduled for today and 1100 pcs scheduled for 01.09.06  .
I tried FM SD_BACKORDER_UPDATE but it allows only to pass one quantity per item line and does not split the schedule lines.
I also tried BAPI_SALESORDER_CHANGE but it does not allow to pass the confirmed qty. ( It changes the order line qty.)
Any idea welcome......
Regards
Heinz

Hi Heinz,
In the sales order you can go to the Item -> Schedule lines and you can split it.
Did you resolved if so shall i know how.
Regards
Agasthuri Doss

Similar Messages

  • How to use bapi to change so's schedule line category

    dear friends:
       I try to change so's schedule line category using bapi "BAPI_SALESORDER_CHANGE", but it doesn't work,the code is as following:
      T_SCHEDULE_LINES-ITM_NUMBER = ITAB-POSNR.
      T_SCHEDULE_LINES-SCHED_TYPE = ITAB-ETTYP.
      T_SCHEDULE_LINES-SCHED_LINE = '0001'.
      APPEND T_SCHEDULE_LINES.
      T_SCHEDULE_LINESX-ITM_NUMBER = ITAB-POSNR.
      T_SCHEDULE_LINES-SCHED_TYPE = ITAB-ETTYP.
      T_SCHEDULE_LINESX-SCHED_LINE = '0001'.
      T_SCHEDULE_LINESX-UPDATEFLAG = 'U'.
    who can tell me the reason.thanks in advance.

    Hi 
    First try to execute same bapi in test mode and then check thwe respective SO if this work then you have to commint the changes through program, some more help on this topic
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.

  • Changing Date in Schedule Lines

    Good Day.
    When I am changing a date in the schedule line. everything resets back to start date.
    For example:
    a> 10/1 x 5000
    b> 10/15 x 5000
    c> 10/30 x 5000
    I just want to change the date of b> from 10/15 to 10/10, but everything just resets back to zero, such that i have to re-enter 10/1 & 10/30 again.
    What should I do to prevent that?
    Let me know...
    Thanks,

    do not use a standard order to manage schedule lines. Use scheduling agreements instead, they are much more flexible.
    Roberto

  • Changing details of schedule line agreement-T.code ME38

    Hi Abapers!!!
                Is there any function module to change the details of schedule line agereement.. .....if GR quatity is less than the scheduled quantity i want to make scheduled quantity as gr quantity.
              Can't we change this using BAPI_PO_CHANGE? I tried, but I am getting the message 'the schedule line agreement is not possible using this function module'.
              This process is possible through the me38 (just type agreement number ,double click on the screen displayed,finlay a report will displayed there we can make changes). Instead of doing this manualy i asked to develop a program to do automaticaly.
    Could anyone pl help me on this issue.....Pl give your suggestions. .
    Thanks in advance!!!

    Hi Madan,
             Thanks for ur reply!!!
          Refer the purchase order with document category L
    and document type LP or LU .BAPI_PO_CHANGE is not working for this.....So i want to know any other function module or methods.
    Edited by: Ranganayahi Chandirasekaran on Aug 12, 2008 5:47 AM

  • Change schedule lines using bapi salesorder_change

    Hello,
    I am using 'SD_SALESDOCUMENT_CHANGE' to change sales order. schedule lines are not changed.
    I get an express inbox message saying :
    ===================================================================
    Update was terminated
    Error Info...   00 671: ABAP/4 processor: SAPSQL_ARRAY_INSERT_DUPREC
    ======================================================================
    I don't know what to do.
    any body solved this problem? what is wrong in the way I wrote it?
    Thanks in advanced ,
    Sara
    I populate schedule lines this way:
          lv_schedule-itm_number = svbap-posnr.
          lv_schedule-sched_line = '0001'.
         lv_schedule-req_qty    = svbap-kwmeng.
          lv_schedule-req_date   = im_vbak-vdatu.
          move im_vbak-vdatu to: lv_schedule-tp_date,
                                 lv_schedule-ms_date,
                                 lv_schedule-load_date,
                                 lv_schedule-gi_date.
          append lv_schedule to et_schedule.
      * schedule lines X
          lv_schedulex-itm_number = svbap-posnr.
          lv_schedulex-sched_line = '0001'.
          lv_schedulex-updateflag = 'U'.
          lv_schedulex-req_qty    = 'X'.
          lv_schedulex-req_date   = 'X'.
          move 'X' to: lv_schedulex-tp_date,
                      lv_schedulex-ms_date,
                      lv_schedulex-load_date,
                      lv_schedulex-gi_date.
          append lv_schedulex to et_schedulex.

    Hi,
    The function I use is the one used in the BAPI CHANGE.
    Online changing the delivery date changes the date in the schedule lines.
    I can't understand why it is not updated.
    Sara

  • Mass change schedule line

    Hi,
    I want to know how to mass maintain the schedle line rejection code for a specific grid value.
    I tried using the T Code MASS, but i cant carry out mass changes at the schedule line level.
    Thanks,

    Hi,
    Rejection code is at item level and once rejected system automatuically deletes the SC lines.
    Vivek

  • Change shipping dates/times for confirmed schedule line

    Hi,
    I am having a problem changing the confirmed schedule line in a Sales Order VA01.
    I have added my code into the user-exit
    *       FORM USEREXIT_MOVE_FIELD_TO_VBEP                              *
    *       This userexit can be used to move some fields into the sales  *
    *       dokument schedule line workaerea VBEP                         *
    *       SVBEP-TABIX = 0:  Create schedule line                        *
    *       SVBEP-TABIX > 0:  Change schedule line                        *
    *       This form is called at the end of form VBEP_FUELLEN.          *
    FORM userexit_move_field_to_vbep.
          vbep-ezeit  = '235900'.
          vbep-wauhr  = '235900'.
          vbep-lduhr  = '235900'.
          vbep-mbuhr  = '235900'.
          vbep-tduhr  = '235900'.
    However, in the above code I manage to only change the first schedule line in case I choose a delivery proposal. I need to change the line with a confirmed quantity. Instead I change only the first shedule line without a confirmed quantity.
    Question: Which user-exit can i use to change shipping times dates for all schedule lines or just confirmed schedule lines?
    Thanx

    Hi,
    Use form routine "USEREXIT_SAVE_DOCUMENT_PREPARE" in MV45AFZZ.  Update VBEP as well as XVBEP Structures.
    Regards
    Vinod

  • Schedule Line Category change-USER EXIT

    REQUIREMENT:
    When saving a SALES ORDER, Change the schedule line category on the SALES ORDER from CP(Standard Availability Check) to CS(Third Party Processing u2013Trigger Purchase Requisition)
    Initially when we create the SALES ORDER, we have Schedule line category CP to generate schedule lines based on stock availability
    SO Date- 09/14/2010
    Schedule line 0001--- 09/14/2010 --- Confirmed Qty (0) --- Sched Line Categ(CP)
    Schedule line 0002--- 09/16/2010 --- Confirmed Qty (1) --- Sched Line Categ(CP)
    Config Change: We have changed the Schedule line category- CS to turn off Purchase Order Scheduling (Indicator turned off--P.req.del.scheduling)so that when we change the schedule line category, no PO scheduling happens again
    Our requirement is that when saving the sales order, we want to change both the schedule lines item category-0001/0002 from CP to CS
    SO Date- 09/14/2010
    Schedule line 0001--- 09/14/2010 --- Confirmed Qty (0) --- Sched Line Categ(CS)
    Schedule line 0002--- 09/16/2010 --- Confirmed Qty (1) --- Sched Line Categ(CS)
    After saving the order, a Purchase Requisition is generated for the Schedule Line 0002..
    MY QUESTION:
    Is this possible using the BAPI_SALESORDER_CHANGE without changing the dates on the schedule lines or deleting any schedule line
    Thanks
    Kumar

    Hello Kumar,
    Please check the User exit and let us know whether your requirment is met or not.
    #USEREXIT_MOVE_FIELD_TO_VBEP
    Use this user exit to assign values to new fields at the level of the sales document schedule lines.
    The user exit is called up at the end of the FORM routine VBEP_FUELLEN.
    Regards,
    Sarthak

  • Split Schedule Lines handling

    Hi Gurus,
    I am working on a Sales Order scenario - Schedule lines split.
    When I am trying to create an Order and key in Delivery Date as today's date - Schedule lines are getting split.
    However if I propose Delivery Date other than today's date i.e. future date - Schedule lines are not getting split.
    Is there any chance to prevent split if item get confirmed with in same date.
    Please advice.
    Many Thanks,
    Madan

    Hi RB/Praveen,
    Thanks for you response.
    However the scenario here is different.
    Schedule lines are getting split because of the Arrival time.
    By default, first line is having Arrival time as 00:00 and second line with actual Arrival time.
    If the delivery date is a Future Date - this issue is not occuring.
    Issue:
    Issue is when the delivery date is today's date.
    As said, schedule lines are getting split because of Arrival time.
    1st line with Arrival time as 00:00
    2nd line with Actual Arrival time.
    Is there any way of controlling splitting of Schedule lines based on date/time.
    Awaiting you adivce/suggestions.
    Many Thanks,
    Madan

  • How to put schedule lines for one year  in a schedule line agreement

    dear all
    thanks for the support till now from the forum
    now i need some seetings by which the scheduling agreement will autoumatically take the schedule line for one year automatically
    in my client we are getting open PO so
    we have to make one agreement acording to that PO and thats for one year
    and this one yr will have same quantity to be produced everyday
    means 12nos of material every day for 12 month and this will be for every day
    and as per that it should generate a sales order.i need to put schedule line automatically not mannually one by one for each date.so wat is the settingand how to reffer this scheduling agreement we can produce sales order.
    please help
    subrat
    Message was edited by:
            subrat panda

    Dear Subrat,
    you cannot create a yearly schedule line in the scheduling agreement. It is not possible due to format restrictions of the date field. But what you can do is the follows (it is the modification, but it should work with the help of user-exits):
    1. You can split the year schedule line to the monthly schedule lines. There are two ways to do it. If you apply the DELINS IDOC, then you can do it already during transfer of the data to the application (itr is the best way). Here you can use, for example, user-exit USEREXIT_ZUORDNEN_IDOCS (include LVED4FZZ) or customer function EXIT_SAPLVED4_002, called from the subroutine USEREXIT_DYNPRO (Include LVED4F0U). Alternatively, you can use the user-exit USEREXIT_MOVE_FIELD_TO_VBEP (Include MV45AFZZ) within the call transaction, then it will work also in the dialog case.
    2. After getting the monthly schedule lines, you can create a planning delivery schedule, where you can split mothly schedule lines automatically to daily schedule lines according to the customer factory calender.The settings for generation of planning delivery schedules can be found under:
    Customizing SPRO: Sales and Distribution => Sales => Sales Documents => Scheduling Agreements with Delivery schedules => Maintain Planning Delivery Sched. Instruct./Splitting Rules
    It is the only ways, how you can reach your aim. I hope, this information will help you further.
    Kind Regards,
    Akmal Vakhidov
    Development Support SD, SAP, Walldorf/Germany

  • Credit limit check cause the item schedule line confirmed qty empty

    Hi,
    I have an SO that is under credit limit check, the problem is, after releasing it via VKM3, the confirmed qty at item schedule line is not taking the qty as of stock at the time. The SO qty is 100 Pcs, but there's still stock of 80 Pcs. I will then need to split the schedule line to 2 lines --> 1st line with order qty 80 Pcs, and 2nd line 20 Pcs. Then only the confirmed qty appear for the 80Pcs.
    For usual SO that is without credit checking, the confirmed qty will immediately shown as in 1 schedule line. Does anyone know why is this happening and can we amend this problem?
    Thanks.

    Hi
    If an order is subject to credit check once you save the order the confirmed quantities becomes 0 because if the settings done in t code OVB8 Number of the routine used for copying is set as 101and System FORM routine number is set as 1 (and this is the standard settings)
    This is kept like this in standard so that if a material stock is say 10 units and order from customer X has come for 10 units and that order is blocked on crediit limit so that when the next order from customer Y has come for another 5 units and this customer Y has a better credit limit and this order is not blocked on Credit limit check then she should not suffer for stocks
    A genuine customer should not be deprived of stocks
    For you between the order registered and released thro VKM3 another order has come from another customer for 20 units and hence the 100 units has become 80 now and balance 20 is confirmed for a future date thro forward scheduling
    In T code OVB8 you can do the customizations for this scenario according to the business requirement
    Regards
    Raja

  • Schedule line data

    Hi gurus,
    How can we see the changes in schedule line data. i.e. all changes in delivery date in open sales orders.
    Thanks in advance.

    Hi,
    goto environment in Va02/Va03 and click on Changes.
    There enter your schedule line instead of item. You can see all the changes for the schedule line.
    Hope it helps.

  • Scheduling Agreement Schedule Lines firmed after outbound delivery

    Dear All,
    We use scheduling agreement for cross-company process in our client.  After MRP run schedule lines created automatically. For the next step outbound delivery is created via VL10F (or VL10B).
    After outbound delivery creation, on MD04 or ME39, i see the schedule line firmed (*). Because firmig MRP doesn't change those schedule lines. This is a problem for our client.
    Do you know a way for MRP can change the schedule lines even outbound delivery created ? How can i manage this situation ?
    Best regards,

    Hi Anil
    The '*' that you see means that the schedule line has been changed manually and the Firming indicator (EKET-FIXKZ) is set when there is any change to the Schedule line.
    So, when a Delivery is created, the schedule line should be 'Fixed'.
    Otheriwse, MRP can delete or change this schedule line and it would cause an inconsistency in the system. This is the logically intended behaviour.
    Please see the F1 help for the field EKET-FIXKZ:
    "Schedule Line is "Fixed"
    Fixes the schedule line and determines that it cannot now be automatically changed as a result of materials planning and control/MRP activities.
    Procedure
    The indicator is set automatically if:
    .- You make manual changes to a line of a scheduling agreement delivery schedule that was created via the materials planning process
    .- You create a schedule line manually
    Dependencies
    You can specify whether Materials Planning/MRP can change delivery schedule lines within the firm and trade-off zones in the additional data for the scheduling agreement item."
    I hope this helps.
    Anna

  • EDI Message for Scheduling Agreement Schedule Lines

    Hi Experts,
    My client has the EDI set up for the SASL and is running fine.
    Currently we have scheduled background program to trigger the IDOC and convert the IDOC into XML to send the information to the external system via interface after MRP run.Output type in the SASL will be triggered at header level (Without release documentation) whenever there is a new or change in the schedule line. Schedule line will be fixed automatically for every MRP run based on the Firm zone maintained in scheduling agreement.
    Now the requirement is, Client wants to send the schedule lines regardless of New or change after MRP run sothat all the information will be sent to the suppliers. This requirement may be contradictory one but the client needs it.
    1) For the New schedule line creation the output type will be triggered so no issues the program will take care
    2) For the change schedule line also the output type will be triggered so No problem.
    Requirement :
    1) When there is no new & change in the schedule lines , how we can handle this???
    2) Client wants to fix the schedule lines based on the planned delivery time and they do not want to maintain this PDT in the Firm zone field.??
    Kindle explore and provide me the inputs. Appreciate your help.
    Thanks /Karthik

    Can you elaborate bit more on the issue.
    see if you are not mentioning the PDT in the firm zone field. then it means the schedule lines can be changed and once they are changed the change idoc will get trigger.
    however if there is no change in the schedule line and since its a old one there will not be any idoc generation for this.
    seems as per your requirement you want to get the idoc generated for the old line as welll then u need to look for the anhancement badi/uer exit to map this.
    need more insight of the issue to resolve it

  • Schedule Lines generated for expired Scheduling agreements

    Hi All,
    We are facing problems in Scheduling agreements.
    Schedule lines are getting generated for those agreements whose validity has expired(i.e Validity in Past).
    Is there any check to restrict those Scheduling Agreements??
    Please Help.
    Regards,
    Ritesh.

    from OSS note 914607 - FAQ: Validity and status of scheduling agreements
    1. Question: When I process scheduling agreements without delivery schedules, I have the option to specify the validity of the scheduling agreement: "Valid" and "Valid to". What role does the validity play when the scheduling agreement is processed?
    Response: In the case of scheduling agreements without delivery schedules, the system checks the validity of the scheduling agreement if you create a new schedule line or change an existing schedule line. If the schedule line date is outside the validity interval, a warning message is issued. You can then decide whether or not to create the schedule line or whether to adjust the validity of the scheduling agreement. No error message is issued.
    2. Question: What role does the validity play in the case of scheduling agreements with delivery schedules?
    Response: The function is similar to scheduling agreements without delivery schedules. The only difference is that the entry of the validity is optional (unlike scheduling agreements without releases) and this is not checked by the system. If the validity is missing, the system does note issue a warning message. If you specify the validity, the system behaves in the same way as for scheduling agreements without releases.

Maybe you are looking for