Changing schedule line details via BAPI_PO_CHANGE

Hello,
I am trying to use BAPI_PO_CHANGE to change the schedule line quantity on a Purchase Order.
I am populating structures :-
POSCHEDULE
POSCHEDULEX
but I am unable to change the schedule line details. The BAPI call returns a success message saying 'No Data wa schanged.'
I have also tried passing in additional structures:-
POITEM
POITEMX
I am not sure whether these are necessary but I thought I'd give it a go.
I seem to get a little further in this case but I get a different error.
I can successfully update the PO manually via ME22N.
Does anyone have any example code for updating schedule lines using this BAPI.
Thanks,
Ruby
Moderator message - Moved to the correct forum
Edited by: Rob Burbank on Dec 14, 2009 1:17 PM

Hello Aveek,
Thank-you for the link. I have had a look at this program but I cannot see how the poschedule and poschedulex structures get populated.
It looks like this could be happening within form get_uom_conversion  but I can't see the code for this.
Could you send me a copy of this routine please?
I need to understand what fields to set within these structures.
At the moment, all I am populating is as below but I can't see what I am doing wrong:-
wa_po_schedule-po_item = '00001'.
wa_po_schedule-sched_line = '0001'.
wa_po_schedule-DELIVERY_DATE = '20100204'.
wa_po_schedule-quantity = '4.000'.
append wa_po_schedule to lt_po_schedule.
wa_po_schedule_x-po_item =  '00001'.
wa_po_schedule_x-sched_line = '0001'.
wa_po_schedule_x-po_itemx =  'X'.
wa_po_schedule_x-sched_linex = 'X'.
wa_po_schedule_x-DELIVERY_DATE = 'X'.
wa_po_schedule_x-quantity = 'X'.
append wa_po_schedule_x to lt_po_schedule_x.
Thanks,
Ruby

Similar Messages

  • BAPI to read and change schedule lines in APO

    Hello experts,
    We want to firm schedule lines inside the firm zone of the APO procurement scheduling agreements with a daily job. For this we are trying to use BAPI BAPI_POSRVAPS_GETLIST3 and BAPI_POSRVAPS_SAVEMULTI3. The getlist one does not return schedule lines, it returns purchase orders and purchase requisitions. Are these the right bapis to read and change schedule lines in APO? or is there anyother one we can use?
    Thanks and regards,
    Ergul

    Hi,
             You can use the below code to read the schedule lines.
    Checking a session exists
        CALL FUNCTION '/SAPAPO/RRP_SIMSESSION_GET'
          IMPORTING
            ev_simsession = gv_sims
            es_gen_params = gv_params.
    If not create a new session and read it
        IF gv_sims IS INITIAL.
          CALL FUNCTION '/SAPAPO/RRP_SIMSESSION_CREATE'
            IMPORTING
              ev_simsession = gv_sims.
          CALL FUNCTION '/SAPAPO/RRP_SIMSESSION_GET'
            IMPORTING
              ev_simsession = gv_sims
              es_gen_params = gv_params.
          g_cre_chk = 'X'.
        ENDIF.
    CALL FUNCTION '/SAPAPO/CMDS_TPSRC_GET'
        EXPORTING
          iv_ebeln                       = p_l_t_acknh_ebeln
          iv_ebelp                       = p_l_t_acknh_ebelp
        TABLES
          et_tpsrc_all                   = lt_tpsrc
        EXCEPTIONS
          matid_not_found                = 1
          locfrom_not_found              = 2
          locto_not_found                = 3
          scheduling_agreement_not_found = 4
          error_selecting_schedagreement = 5
          OTHERS                         = 6.
      IF sy-subrc = 0.
    reading the scheduling agreement records
        READ TABLE lt_tpsrc INTO ls_tpsrc INDEX 1.
        CALL FUNCTION '/SAPAPO/PWB_BZQID_GET_ORDER'
          EXPORTING
            iv_simid               = '000'
            iv_bzqid               = ls_tpsrc-bzqid
          IMPORTING
            ev_ordid               = lv_iordid
          EXCEPTIONS
            lc_connect_failed      = 1
            no_elements            = 2
            unit_conversion_failed = 3
            OTHERS                 = 4.
        IF sy-subrc = 0.
          CALL FUNCTION '/SAPAPO/PWB_GET_RELATED_ORDERS'
            EXPORTING
              iv_ordid             = lv_iordid
              iv_order_type     = '16'
              iv_simid            = '000'
            IMPORTING
              ev_ordid          = lv_eordid
            EXCEPTIONS
              order_not_found   = 1
              lc_connect_failed = 2
              no_elements       = 3
              OTHERS            = 4.
          IF sy-subrc = 0.
            APPEND lv_eordid TO lt_ordid.
            CALL FUNCTION '/SAPAPO/DM_PO_READ'
              EXPORTING
                iv_simsession     = gv_sims
                is_gen_params     = gv_params
                it_ordid          = lt_ordid
              IMPORTING
                et_schedule       = p_lt_sched
              EXCEPTIONS
                lc_connect_failed = 1
                lc_com_error      = 2
                lc_appl_error     = 3
                OTHERS            = 4.
          ENDIF.
        ENDIF.
      ENDIF.
    Use '/SAPAPO/CMDS_SNP_MM_ORD_MODIFY' function module to change the schedule lines (Pass '16' to iv_order_type parameter).
    Let me know if u have any issues.
    Regards,
    Siva.

  • Change Schedule line in Scheduling agreement by function.

    I want to know that is enalbe to change schedule line in Scheduling agreement by function( 'BAPI' or Standard function).
    I known that is possible by BDC.
    But I have to change many records. So I want to know faster method.
    Please let me know what function enbale that.
    Thank you for your interest.

    Hi..
    The Scheduling agreement is one which is created runing MRP not VA31.
    I know that is two transaction data in SAP.
    One is Sales Data other one is Purchasing Data.
    This is second one.
    Thank you your response.

  • How can i show item schedule line details in Tableview for each line item

    Hai all,
      I need to display schedule line details  in Tableview for each line item.for example in each row i need to put one column along with button , if i click on this table that row  should be expand vertically and must show all schedule line details in that.if i click my button again the visible expanded row should disappear...
    if anybody works on this previously plz send some sample code...
    leoiz....

    To modify rows the best way is with the Iterator (do a search in the weblogs for "Iterator")
    However for what you want to do I've only seen this really work successfully with a standard HTML table not using the tableView.

  • How to change schedule line fields when save sales documents in va01/va02

    Hi, every Experts,
    I want to change schedule line when save the sales documents in va01 or va02, such as change delivery block or schedule line category.
    of course, can use user exit USEREXIT_SAVE_DOCUMENT_PREPARE, but I do not know to use this user exit, I am newer about ABAP.
    Please help me , thanks.
    best regards
    Passion Wu

    Hi,
    For changeing schedule line: select line item, GOTO --> item --> schedule lines --> enter the confirmed qty.
    USEREXIT_SAVE_DOCUMENT_PREPARE program is MV45AFZZ
    For your reference
    USEREXIT_SAVE_DOCUMENT_PREPARE - Can I use in button, but skip
    regards,
    Mohanprabu C

  • Change Schedule Line category through user exit - Issue with transfer of requirements

    Dear All,
    There is a user exit in Sales Order program MV45AZZ - PREPARE_TO_SAVE . It is currently being used to implement code to change schedule line category based on the status of the sales order.
    When Blocked , category is set to ZP, and when Released then it is set to CP.
    Now, when we change ZP to CP manually through VA02, I am able to see the requirements transferred in tcode MD50.
    The problem is, when user changes status of sales order from blocked to released, the userexit changes categories from ZP to CP, but the requirements are not transferred ( cannot see it in MD50 ).
    I tried searching the SCN, tried googling it, its been a week now and I havent found any clear solution.
    So, far what I understood is Availability Check needs to be carried out again. But I am not clear how to trigger it again.
    Are there any indicators that need to be set or any internal tables to be updated or any FM to call or any other user exit to place the code in.

    ?? Any suggestion friends ?

  • Change schedule line category

    HI,
    I wonder if somebody can give an idea of how to change schedule line category of non-stock products by order type.
    Thanks,

    Hi,
    Did you check the userexit FORM userexit_move_field_to_vbep in the include MV45AFZZ
    Thanks,
    Naren.

  • How to Change Schedule line Quantity in BADI 'ORDER_SAVE'

    Hi,
    I need to change the Schedule line quantity While Order saving. I am writing the code in ORDER_SAVE BADI. Using the Header guid i am reading the details and changing the quantity in Schedule line structure. How can i pass those values in to Memory so that order quantity will change. I try to Use CRM_ORDER_MAINTAIN but not able to change the quantity. Can an

    Hi,
    You need the One Order Function Module - CRM_ORDER_MAINTAIN to update the Schedule line value. So, you need to have a look at all the fields that are necessary to fill using the Tables and Structures. If you have the header guid, then you can probably pass the guid to CRM_ORDER_READ to read the values and then fill in the entries necessary to make the changes.
    You can also debug the order code to get a feel of the necessary changes.
    Hope this helps.
    Thanks,
    Samantak.

  • Change schedule line date

    Dear All,
    I have a requirement where required delivery date for one divisions material
    in sale order and STO should automatically propose todays date plus 10 days i.e.
    if any sale order or STO created today then required delivery date in STO and
    SO should show 24.10.2010.
    Accordingly we have maintained planned delivery time in material master 10 days in MRP2
    view and it is working fine but another requirement is that user can reschedule the
    delivery and he can change the schedule line date in So (RV45A-ETDAT) before or after
    10 days in VA02 but it is not allowing to change it is considering todays date + 10 days.
    In STO it is allowing for change the delivery date (MEPO1320-EEIND).
    Plz advice how I can make the field RV45A-ETDAT changeable in sale order through VA02.
    Regards,
    sps.

    Hello,
    If you want a sales order to have the requested delivery date automatically populated with today's date +10 business days, this can be maintained via the following SPRO path:
    SAP IMG --> Sales and Distribution --> Sales --> Sales Documents --> Sales Document Header --> Define Sales Document Types
    Go into the sales document type you would like to maintain.  In the section "Requested delivery date/pricing date/purchase order date", there is a field Lead Time in Days.  Put 10 in here, and the requested delivery date will automatically be set to +10 days when an order is being created.
    Planned delivery time in the material master is for when you're out of stock and the system proposes the next available delivery date.  If you have stock on hand, when the availability check runs the system will use the line level delivery date.  At order entry, when a line item created this line level delivery date is taken from the requested delivery date.
    I hope this helps you.

  • Change Schedule Lines values for Each Item for a Scheduling Agreement ?

    Hii
        I want to change the Schedule Line Schedule Qty for Each Line item for a
    Scheduling Agreement .
    I cannot use BAPI_PO_CHANGE as this is for PO only and gives error for
    a scheduling agreement.
    I am on 4.6c so i SAP does not have BAPI_AGREEMENT_MAINTAIN .
    Please help me out on using a BAPI or FM to do this.
    Regards
    Gaurav

    Hi,
    isn't the Schedule Line a special case of SALES order  that might be changed with a BAPI_SALESORDER_MAINTAIN.... If ther is no BAPI for this in your system, you might create new contracts with reference to existing ones using BAPI_CONTRACT_CREATEFROMDATA.
    Regards,
    Clemens

  • 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

  • Schedule Line generation via MRP

    Dear Members..We create Scheduling Agreements by referencing quantity contracts.Now Schedule line in scheduling agreements are generated via MRP ..business wants that the sum of scheduled quantities in scheduling agreements should not exceed Contract Quantity.How can we control this. This check is already there in case of manual scheduling in SA ..but how can we control it via MRP ? Thanks in Advance ..
                                    Vinod

    Hi,
    Let me understand the process
    First create contract ME31K eg X qty
    Output of this contract creates a SA of X qty
    Via MRP it creates a Schedule line and this should increase the X qty.
    I think as std SAP system will not allow to more than X qty
    Thanks
    Suresh

  • Change schedule line delivery date

    Hello,
    We are doing STO intercompany scenario, with ATP control, routing delivery in schedule lines.
    If for example in Supplying Plant the delivery date is 2 month in the future, and we have dates and quantities confirmed in the STO, if this Plant creates the Outbound delivery and PGI tomorrow, how can the buying Plant will notice this situation?
    Once PGI schedule lines in STO will not be ATP anymore and the delivery dates will be not be updated.
    At schedule line level I can see the quantity was delivery but the delivery date it is not updated to the new one.

    Hi Sukriti,
    Thanks for the Response, yes i have used the Bapi Transaction Commit Also .
    The point is I am able to Update the Statistical Delivery Date in the Same EKET table using BAPI_PO_Change .I have Checked all the Ways to update the EKET-EINDT(Delivery Date)but no Unable to do it.

  • 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

  • Changing Schedule Line Category after checking Item availability

    Hi Expert,
       I would like to change the schedule line category according to the result of item availability check, i.e. change to another self defined schedule line category in case confirmed qty < order qty.
       Could any one please suggest where I can implement this logic? Which user-exit is required to modify? Thanks a lot!

    hi,
    U can change the SCH line category manually in sales order
    Menu path:
    Spro-->Img> sd> sales -> sales documents>sch lines-> assign sh line categories---->
    here find ur current combination
    eg:
    ITem cat+ MRP TYPE= SCH LINE CAT + MANUAL SCH LINE CAT
    <b>TAN + ND=CN+---<u><i><b>here u give teh sch lien cate u want</b></i></u>----</b>
    this will aloow u changing sch line cat manually in sales order
    regards,
    Arun prasad

Maybe you are looking for

  • Brand new MacBook Pro doesn't get past grey screen (with spinning gear)

    Hello, I'm a new Apple customer - I bought a new 15" MacBook Pro during the Black Friday sale last week. Since purchase, I've installed the software I needed (Office, CS4) and have used it to browse the web and write emails. Today when I tried to use

  • White Balance Presets

    Do you miss the white balance presets used in Adobe Camera Raw (daylight, cloudy, shade, etc.)? Here is a way we can easily add these to Aperture: http://www.oreillynet.com/digitalmedia/blog/2006/11/createyour_own_white_balance1.html

  • Can you create a book from the Aperture free trial?

    I have created a book on the Aperture free trial and can't seem to buy it. Is there any way I can or can I not buy a book off of the Aperture free trial?

  • Sometimes ORA-00904: invalid column

    Hello, Some times when i am running a query I get 'ORA-00904: invalid column name'. Next times i run exactly the same query the query runs well for a few times. And in an unpredictable way, exactly the same query fails again. I am using Oracle 8i 8.1

  • Report Portlet 'More' button returns Java error

    Running WIN NT 4 SP6 Oracle and WIN NT SP6 Application server (Seperate servers). I have Oracle 9iAS. When I run a report as a portlet and click the 'More' button I get a Java error. Has anyone else had this problem? If so how did you resolve?