Schedule Lines in APO using CTM

Dear Experts,
How to create schedule lines directly in APO using CTM?
Thanks adn regards,
Sushant

Hi,
Do you mean creation of Planned orders by CTM against the demand /
Generally "schedule lines" term  in APO are seen in RRP3 Product view and refers to Planned order / purchase requisitions.
Yes CTM can create schedule lines in APO after CTM planning run.
Thanks,
Pavan Verma

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.

  • Deletion OF schedule LInes from APO SPP(Spare Parts Planning) through ABAP.

    Dear All,
    I need to delete the schedule Lines from APO SPP(spare parts planning ) system.I am looking for any available BAPI provided by SAP for this purpose.Please provide me help if any of you folks previously in your project went through this requirement.
    If any other way is there other than BAPI please suggest.
    Regards
    Mukesh Pandey

    Hi Siddartha,
    That option is not working.
    Thanks

  • Order schedule lines not created using BAPI_SALESORDER_CREATEFROMDAT2

    Hi experts,
      I am creating sales order using BAPI_SALESORDER_CREATEFROMDAT2. I want to update the Order quantity in VBAP-KWMENG.I got the information from SDN when including the Schedule line in BAPI 'BAPI_SALESORDER_CREATEFROMDAT2  '.
      I tried by using Update flag = 'I'.I am not able to update, what are the values to be passed and how to update the field.
    Is there any other way..Please suggest me..
    Thanks&Regards,
    Karthik.

    Hi, In the BAPI if you look at the tables parameter you will find ORDER_ITEMS_IN and ORDER_ITEMS_INX as well as ORDER_SCHEDULES_IN and ORDER_SCHEDULES_INX. To update KWMENG you will have to pass that value to ORDER_ITEMS_IN-TARGET_QTY and update the same in the table ORDER_ITEMS_INX (ORDER_ITEMS_INX-TARGET_QTY) with 'X'.
    For updating schedule line go for ORDER_SCHEDULES_IN-SCHED_LINE and update X for the same in ORDER_SCHEDULES_INX.
    Try looking into the following code, I am filling in both the Item data as well as the Schedule line data.
      loop at t_mdata into fs_mdata.
        fs_item-itm_number  = fs_mdata-posnr.
        fs_itemx-itm_number = c_flag.
        fs_item-material    = fs_mdata-matnr.
        fs_itemx-material   = c_flag.
        fs_item-target_qty  = fs_mdata-kwmeng.
        fs_itemx-target_qty = c_flag.
        fs_item-item_categ  = fs_mdata-pstyv.
        fs_itemx-item_categ = c_flag.
        fs_itemx-updateflag = c_flag.
          APPEND fs_item TO t_item.
          APPEND fs_itemx TO t_itemx.
        fs_sline-ITM_NUMBER  = fs_mdata-posnr.
        fs_slinex-ITM_NUMBER = c_flag.
        fs_sline-SCHED_LINE  = c_sline.
        fs_slinex-SCHED_LINE = c_flag.
        fs_sline-REQ_QTY     = fs_mdata-kwmeng.
        fs_slinex-REQ_QTY    = c_flag.
          APPEND fs_sline TO t_sline.
          APPEND fs_slinex TO t_slinex.
      endloop.                             " Loop t_mdata
    c_flag contains 'X'.
    fs_item is of structure ORDER_ITEMS_IN.
    fs_sline is of structure ORDER_SCHEDULES_IN.

  • Update Schedule line Delivery date using Bapi_po_Change

    Hi all,
    I am using Bapi_po_change to Update the Schedule line Delivery date(EKET-EINDT) for the PO based on the Item and the Schedule line.
    I am passing the PO number, Po header, Item structure, Schedule line Structure.
    But the Date is not getting updated in the Eket table.
    Please suggest.

    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.

  • Deletion of schedule line in PO using BAPI_PO_CHANGE

    Hi ,
    Can anyone give me the code to delete a schedule line in a po using the bapi bapi_po_change.
    Useful answers will be rewarded.
    Regards,
    Sowmya.

    Hi,
    Refer below code
    *&      Form  sub_populate_data
          text
    FORM sub_populate_data .
    *--Local Variables
      DATA : l_ipdate      TYPE rc65a-datefrom,
             l_fdate       TYPE sy-datum.
      IF NOT it_succ_file[] IS INITIAL.
        LOOP AT it_succ_file INTO st_succ_file.
          st_ipfile = st_succ_file.
    *--Sales Document
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = st_ipfile-vbeln
            IMPORTING
              output = st_salesdoc.
          st_ord_headx-updateflag = c_u.
    *--Sales Document Item
          st_schedule_line-itm_number = st_ipfile-posnr.
          st_schedule_linex-itm_number = st_ipfile-posnr.
          st_schedule_linex-updateflag = c_i.
    *--Schedule line date
          l_ipdate = st_ipfile-edatu.
    *--Call function module to convert the date format into current user format
          CALL FUNCTION 'CY_CONVERT_DATE'
            EXPORTING
              date_string_imp = l_ipdate
            IMPORTING
              date_exp        = l_fdate.
          st_schedule_line-dlv_date = l_fdate.
          st_schedule_linex-dlv_date = c_chk.
          st_schedule_line-req_date = l_fdate.
          st_schedule_linex-req_date = c_chk.
    *--Order quantity in sales units
          st_schedule_line-req_qty = st_ipfile-wmeng.
          st_schedule_linex-req_qty = c_chk.
          APPEND st_schedule_line TO it_schedule_line.
          APPEND st_schedule_linex TO it_schedule_linex.
    *--Clear
          CLEAR : st_schedule_line,
                  st_schedule_linex.
          AT END OF posnr.
    *--Perform to delete the existing schedule line
            PERFORM sub_delete_schedule_line.
          ENDAT.
          AT END OF vbeln.
    *--Clear
            CLEAR : st_erfile.
            READ TABLE it_erfile INTO st_erfile WITH KEY vbeln = st_ipfile-vbeln
                                                         posnr = st_ipfile-posnr
                                                         BINARY SEARCH.
            IF sy-subrc EQ 0.
              g_error_records = g_error_records + 1.
              g_total_records = g_total_records + 1.
            ELSE.
    *--Call the bapi to update sales order schedule line
              PERFORM sub_call_bapi.
            ENDIF.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " sub_populate_data
    *&      Form  sub_call_bapi
          text
    FORM sub_call_bapi.
      g_total_records = g_total_records + 1.
    *--Call BAPI to update sales order schedule line for simulation mode
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = st_salesdoc
          order_header_inx = st_ord_headx
          simulation       = c_chk
        TABLES
          return           = it_return
          schedule_lines   = it_schedule_line
          schedule_linesx  = it_schedule_linex.
      IF NOT it_return[] IS INITIAL.
        READ TABLE it_return INTO st_return WITH KEY type = c_e.
        IF sy-subrc EQ 0.
          g_error_records = g_error_records + 1.
        ELSE.
          REFRESH : it_return.
    *--Call BAPI to update sales order schedule line
          CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
            EXPORTING
              salesdocument    = st_salesdoc
              order_header_inx = st_ord_headx
            TABLES
              return           = it_return
              schedule_lines   = it_schedule_line
              schedule_linesx  = it_schedule_linex.
        ENDIF.
        LOOP AT it_return INTO st_return
                          WHERE type EQ c_e.
          st_erfile = st_ipfile.
          st_erfile-message = st_return-message.
          APPEND st_erfile TO it_erfile.
          APPEND st_erfile TO it_file.
          CLEAR : st_return.
        ENDLOOP.
      ENDIF.
      IF it_file[] IS INITIAL.
    *--Call BAPI transaction commit to change the schedule line
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = c_chk.
      ELSE.
        ROLLBACK WORK.
    *--Call BAPI transaction rollback to rollback the schedule line
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ENDIF.
    *--Clear
      CLEAR : st_salesdoc,
              st_ord_headx.
    *--Refresh
      REFRESH : it_return,
                it_schedule_line,
                it_schedule_linex.
    ENDFORM.                    " sub_call_bapi
    Regards,
    Prashant

  • Schedule lines in APO

    hi guys
    when i run planning in PPDS for material in APO
    its creating PR's instead of schedule lines.
    when it should create PRs & when it should create Schedule lines
    Doc type is LP
    Ext planning ind : 1 i maintained.
    is there any setting in external procurement relationship.
    can you explain me am new to this APO concept.
    thanks
    nani

    Dear Ritwik,
    I guess you  have done following steps already.
    1. Created APO relevant Scheduling agreement. Ext, Planning Indicator.
    2. CIF transfer of the scheduling agreements.
    Now you check in External Procurement relationships, you need to ensure that you only have one active external procurement relationship for the products( which is Created by your APO relavant Scheduling Agreement CIF). It is possible that you have more than one procurement relationship active for the product and so it is creating PR's instead of Schedule lines.
    Hope  it helps.
    Regards\
    Kumar

  • Update of schedule line in PO using BADI 'ME_PROCESS_PO_CUST'

    Hi,
    I have a scenario where my PO has one line item with quantity 10 but there is more than one schedule line (05 Nos.) under the tab 'Delivery Schedule'. First 3 lines have same Delivery Date, same Stats. Del. Date & same Committed Date. Next 2 lines have different Delivery Date, different Stats. Del. Date & different Committed Date.
    The requirement is to conver the first three lines into one with same Delivery Date, Stats. Del. Date & Committed Date and the quantity will be summed up in one row.
    Can I use the above mentioned BADI for the same. If yes then how & If no then which other BADI can be useful?
    Thanks

    Hi Vinay,
    Can you please let me know how did you solve this?
    I have a requirement, I need to send delivery date in the output corresponding to the Schedule line after each GR posting of that day.
    I couldn't find any link between EKET and PKPS.
    Please help.
    Thanks
    Lakshmi

  • Create dummy schedule line in SO using User-Exit

    Hi ,
    I have one requirement of adding one dummy schedule line before the normal schedule lines which gets added after ATP check in sales order.
    for eg: if for line item 10, system will determine 2 schedule 1 and 2. then i want to add a dummy schedule line before 1.
    so it will be like
    sch line
    1 - Dummy
    2 - system generated schedul eline 1.
    3 - system generated schedul eline 2.
    Please let me know if is there any user excit or any way i can achive this?
    Thanks,

    HI Soni,
    What is the meaning of dummy  schedule line.
    Regards,
    Madhu.
    Edited by: madhurao123 on Feb 25, 2011 5:26 AM

  • How to delete the old schedule line release in apo

    How to delete the old schedule line release (from current date) in apo which is having schedule  firmed?
    Please suugest.
    Sunil

    How is it possible to delete old purchasing schedule lines in APO (that do not exist in R/3)?
    Though used successfully before, /SAPAPO/CCR will not reconcile our discrepancy in this case.
    Thanks in advance,
    Jim

  • Link Sales Order Schedule Lines to Delivery

    Hi we have a custom report we use to gather all the inventory information, as well as open orders and deliveries.  We are running in to a a bit of a snafu when it comes to the order's schedule lines.  It seems we can not find a good link between the delivery and order's schedule line for the sales order item.  Any one got some thoughts?  Thanks.
    -Larry

    Hi Larry,
    The link are there in standard tables.
    Depending on the types of information that you want to gather from Sales Schedule Line, you can use the below logic:
    1. Give your program selection screen for VBAK-VBELN (optional), VBAK-AUART (optional), VBAK-VKORG (mandatory) and VBAK-AUDAT (mandatory).  Give as much selection possible to narrow down the search and so that the program can run more efficiently.
    2. Based on selection screen input + VBAK-VBTYP = C, get all VBAK-VBELN.
    3. Where VBAP-VBELN = VBAK-VBELN, get all VBAP-POSNR, and for information at Sales Line Item, get all respective VBAP-MATNR, VBAP-KWMENG and respective VBAP-MEINS, VBAP-WERKS and VBAP-NETWR. Store in Z-table.
    4. Where VBEP-VBELN = VBAP-VBELN, VBEP-POSNR = VBAP-POSNR and VBEP-ETTYP = XX (Schedule Line Type - you do not want to retrieve all types. Name only a few.), get all VBEP-EDATU, VBEP-VBEP, VBEP-BMENG and VBEP-LMENG. Not forgetting also VBEP-WADAT if u require.  For 3rd Party Sales, Requisition number can be obtained from VBEP-BANFN.
    5. Where all data are obtained, populate in ALV for respective Sales Order and group accordingly. ABAP will know what to do.
    6. Where LIPS-VGBEL = VBEP-VBELN and LIPS-VGPOS = VBAP-POSNR, get all LIPS-VBELN.
    7. Then gather all your required fields in LIKP and LIPS table accordingly.
    Hope this helps.
    Thanks.
    Rgds.
    Edited by: PKW on May 4, 2010 12:21 PM

  • MRP To Generate SCHEDULE LINES for Scheduling Agreement

    Hi
    I have followed the below steps but still the Schedule lines is not generated for scheduling agreement.
    1Maintain MRP views 1,2,3,4 for the material in material mste.(MM01)
    2. Maintain Purchase Info Record for the vendor plant & material combination.(ME11)
    3. Create Scheduling agreement using ME31L
    4. Maintain source list for the material & the scheduling agreement # and Line item set the MRP relevant indicator 2 (Necessary ?) ME01
    During Run MRP for the material.the below details entered///
    Processing key NETCH Net Change in Total Horizon
    Create purchase req. 1 Purchase requisitions in opening period
    Schedule lines 3 Schedule lines
    Create MRP list 1 MRP list
    Planning mode 1 Determination of Basic Dates for Planned
    Run MDBT or MD02 but still doesn't create the schedule lines......Anything else missing.
    MRP1:
    MRP Procedure: PD
    MRP Group: 0000 (External Procurement only)
    Lot Size: EX (Lot For Lot)
    MRP2:
    Procurement Type: F
    Sched Margin Key: 000
    MRP3:
    Avilablity chec: 02 (Individual requirement)
    MRP: 4
    Nil

    Raj,
    Source List a Mandatory for Scheduling Agreement, if you want to create automatic Scheduling line.
    Plz use (2) in MRP RELEVENT tab in ME01 (Source List).
    rest of the thing is ok, make sure a material master(MRP 2 VIEW) in that view you have to give a planed delivery days. it is must.
    HOPE IT WILL WORK
    Regards:
    Poision

  • Delivery date in weekends in schedule line

    Hi friends
    we are using 7 days working factory calendar for a plant. But we do not want to have the delivery date on saturdays and sundays. (Delivery date in schedule lines). I used one Z lot size to refer the planning calendar(having monday to friday working).
    But the solution is not feasible as we are using different lot sizes like EX,MB etc.,
    Please let me know if you have any solution on this.
    Regards
    Ranga

    Hi Ranganathan,
    You create one more calendar with all the holiday same but only with saturday and sunday as holiday. Assign that calendar in SPRO -> Enterprise structure->Definition-> Sales and Distribution-> Define copy and delete, check sales organisation. in that assign in the factory calender in the sales org calendar.
    Try this if this is Ok reward the points.
    Thanks and Regards,
    Satish

  • Sales Order Stock - Problem with Schedule line

    Hi guru,
    I have a problem with my schedules line.
    We use the Sales order stock ( using MB1B with good movement  412/E) for some specific customers.
    Even if the sales order reservation works well, there is an issue with the schedule line in the order.
    Indeed when i enter the material in the order the schedule line display an availibily in 8 days even if the material is out of stock or available now....
    When i enter the same materila in a standard order(with item category without special stock E) the schedules line are good...
    What is it the most weird is that i have done the customizing by copying the standard item and i have just added the special stock E in the item category.
    If anyone can help me!!
    Thanks a lot

    hello Lakshmipathi,
    Thanks a lot for your reply.
    I tried to change the requierement class in order to put one with special stock E as you explained, but i still have my weird schedule line. When i put the item in the order it is 0 stock for today, but stock find in 12 days either if there is stock or no(unrestricted stock i mean).
    If i change the RDD in more than 12 days the stock is available for the date requested.
    If you have an idea of what could be wrong because on my case i want the schedule line to be at 0 while the sales order reservation has not been processed (via MB1B/412/E) and once the stock movement is done the schedule line has to be find.
    I dont know if im clear enought..
    To be more clear,  i want the schedule line based on the "sales order stock" and not on the "unrestricted stock".
    thanks for your help!
    Guillaume

  • 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

Maybe you are looking for

  • Cluster network name resource 'Cluster Name' failed registration of one or more associated DNS name(s) for the following reason: The handle is invalid.

    I'm stuck here trying to figure this error out.   2003 domain, 2012 hyper v core 3 nodes.  (I have two of these hyper V groups, hvclust2012 is the problem group, hvclust2008 is okay) In Failover Cluster Manager I see these errors, "Cluster network na

  • How to get Audiobook on iphone to itunes

    I purchased an audiobook and a book by the same name and downloaded them on my iphone. The book syncs with my itunes but the audiobook doesn't. I dont't even see an audiobooks category in itunes. I have the latest version and already looked in edit >

  • PCUI - CRM

    In the marketing Planner application in the PCUI, when i click the export button, it saves by default in CSV format, without prompting for template to be selected. Before prompting to save in CSV format, it pop-ups message "Install Microsoft Office 2

  • Regarding Credit Date in QA32.

    Dear All,                I am creating a daily credit  report , for this is am giving input as i.e. selection-options as credit date, my data is comming properly for certain date span but for 1 day date the data is nothig , i.e. : blank.             

  • Controller role Park and Post

    Hi Experts Here's what I got. I need roles for my customer to park and post documents.  This is what he is asking for: Controller Role:  No park, only post Cost Acct Role:  Park and Post, but no posting their own parked docs Acct Clerk Role:  Can onl