Change the schedule line committed qty in PO items using ME_PROCESS_PO_CUST

Dear Experts,
I want to make the PO item schedule line committed quantity MNG02 field to zero, for this purpose I wrote the logic as below.
but its not changing the committed quantity to zero. Please advice me.
method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM.
DATA: lwa_po_header TYPE REF TO if_purchase_order_mm,
        lwa_mepoheader TYPE mepoheader,
        lwa_mepoitem TYPE mepoitem,
        lwa_mepoitemx TYPE mepoitemx,
        lwa_ekko TYPE ekko,
        lwa_ekpo TYPE ekpo,
        lwa_ekpv TYPE ekpv,
        lwa_eket TYPE eket,
        tp_minqty TYPE min_qty,
        tp_clabs TYPE labst,
        tp_kosch TYPE kosch,
        tp_werks TYPE werks_d,
        tp_tdid type tdid,
        ta_textlines type MMPUR_T_TEXTLINES,
        lwa_textlines LIKE LINE OF ta_textlines,
        lwa_minstk TYPE zminstk.
  DATA: schedules TYPE PURCHASE_ORDER_SCHEDULES,
        schedule LIKE LINE OF schedules,
        lwa_schedule TYPE meposchedule,
        tp_mtvfp TYPE mtvfp,
        tp_avqty TYPE BSTMG,
        tp_minqty1 TYPE BSTMG.
  if sy-tcode = 'ME21N'.
Get PO Header data
    lwa_po_header = im_item->get_header( ).
    lwa_mepoheader = lwa_po_header->get_data( ).
    MOVE-CORRESPONDING lwa_mepoheader TO lwa_ekko.
Get PO Item data
    lwa_mepoitem = im_item->get_data( ).
    MOVE-CORRESPONDING lwa_mepoitem TO lwa_ekpo.
*-> Get schedule line data
              CALL METHOD im_item->get_schedules
                RECEIVING
                  re_schedules = schedules.
              LOOP AT schedules INTO schedule.
                CALL METHOD schedule-schedule->get_data
                  RECEIVING
                    re_data = lwa_schedule.
*-> Change Committed quantity
                lwa_schedule-mng02 = 0.
                CALL METHOD schedule-schedule->set_data
                  EXPORTING
                    im_data = lwa_schedule.
              ENDLOOP.
                CALL METHOD im_item->set_data
                  EXPORTING
                    im_data = lwa_mepoitem.
    ENDIF.
endmethod.

Hi Siddu,
Please finf enclosed with the suedo code.
DATA: LS_MEPOITEM TYPE MEPOITEM,
            LS_OBJ TYPE REF TO IF_PURCHASE_ORDER_MM,
            LS_MEPOHEADER TYPE MEPOHEADER.
*IM_ITEM is ur importing parameter
in order to get the  item details :
LS_MEPOITEM = IM_ITEM->GET_DATA( ).
*In order to get the current document type
  LS_OBJ = IM_ITEM->GET_HEADER( ).
  LS_MEPOHEADER = LS_OBJ->GET_DATA( ).
Now you have your document type in LS_MEPOHEADER-bsart ...
IF LS_MEPOHEADER-bsart ... = ur custom doc type .
*Set the return item = 'X'.
LS_MEPOITEM-RETPO = 'X'.
    CALL METHOD IM_ITEM->SET_DATA
      EXPORTING
        IM_DATA = LS_MEPOITEM.
ENDIF.
Hope this helps you,,,
Regards,
Deepak.

Similar Messages

  • How to change the schedule line date in SO with reference to value contract

    Hi SD Guru's,
    I need to change the schedule line date in the sales order with reference to the value contract by using some algorithm that i will write. The problem that i can't find the suitable place to add the algorithm. I can't add it to the Copy control because there is no schedule lines in value contract and copy control for schedule lines does no exist.
    I can not add to user exit MV45AFZZ  , because order that was created with reference to the value contract, does not go through this user exit.
    Do you have some ideas where i can add it?
    Thanks and Regards
    Viky
    Edited by: Viky Sloutsky on Oct 20, 2010 12:43 PM

    Hello Viky
    How about using program MV45AFZB- USEREXIT_CHECK_VBEP or USEREXIT_MOVE_FIELD_TO_VBEPKOM
    or program FV45EFZ1- USEREXIT_CHANGE_SALES_ORDER
    Does the program go through these exits when an order is created with ref to a value contract??
    Also I am wondering why you need to change a Schedule line determined by Availability check and/or delivery scheduling?

  • VA02 changing the Schedule line

    Hi All,
    I have an issue where in one Sales order is created. after saving the order whenever you open in change mode(VA02), and though you do not make any changes, when it prompts for Save you say yes. Then if you see the changes made for the order in Environment-> chnges,  for a perticular line item the schedule line two is deleted and created agian. It will be saved by the user id of the user who opend the order in the change mode.
    when it promts for save, If you say NO, then no changes will be recorded.
    Kindly help me with the issue.
    Please let me know If any OSS notes exists for correction. Its happening only with a perticular order.
    Thanks
    Swathi

    Dear Swathi,
    Not sure if this is a standard issue. Could you please check with your ABAPer if they have done any changes in the user exit specific to orders?
    thank you
    Venkatesh SP

  • Delivery before the schedule line date in scheduling agreement.

    Hi All,
    I have a situation where in I am using JIT delivery schedule for processing the delivery requirement from customer. In this, lets say, I have a schedule as 08/05/2009 for material A to deliver 1000 qty and the material is made available to me after production as of 07/05/2009 and I want to despatch the material on 7th only and not on 8th. The system does not allow me to do this.It allows me to make a delivery only on 08/05/2009.
    Is there any alternative to this and is this SAP standard behaviour.

    I think you can change the schedule line date in scheduling agreement itself and do the delivery.
    regards,
    Sudhir

  • Changing of Schedule line

    Hi Friends,
    I have a below mentioned issue.
    We have nearly 500 sales order created on jan 1st 2010 and which are scheduled for the delivey on April 2nd 2010.
    But now the stock is ready and we want to deliver all the sales orders.
    So my question is how to change the schedule lines for the current date to all the sales orders inorder to deliver the stock immediately.
    Kindly provide me the solution ASAP
    Thanks
    RAM

    Hi
    When you run a V_V2 rescheduling program, by inputting material and plant, all the open sale order (back orders) schedule lines get confirmed.
    Then you can proceed with delivery creation through VL01n or vl10e etc.
    thank you
    Anirudh

  • KANBAN cycle - Change of Schedule line dellivery date.

    Hi,
    I have some queries in KANABAN scenario
    1) How to change the schedule line delivery date generated from KANBAN cycle.
    2)How to avoid generation of schedule lines from KANABAN if the Scheduling agreement was not released.
    regards,
    Kannaiah Naidu

    Hi,
    1.It is not possible to change the schedule lines of the Scheduling agreement with kanban indicator. Only work arround solution is to remove the kanban indicator. Then you can change the schedule line.
    2.Using user exit, during emptying of the bin check whether scheduling agreement is released on not.If not released generate error.
    Regards,
    Krishna A S V

  • Schedule line on BOM lower level items

    Hi Team,
    I have maintained a manual over ride for Schedule line category on a lower level item of a BOM. In sales order when I try to change the schedule line cat manually I am not able to. In fact the entire line is greyed out.
    The quantities on the main item are confirmed. can you please advise
    Thanks
    Sunny

    We are adding the unit of measure to the pricing access sequence.  If I enter a product that explodes into a lower level item from the bill of material you can only enter the unif of measure on the high level material  and it doesn't copy down to the lower level item and I want them to match.
    Thanks,
    Michelle

  • 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

  • How to change  delivery  block for all item in the schedule lines via va32

    dear sap expert:
    i onle can  change delivery block for one  sales order item in the schedule line  every times via va32,it will take so many time because there are hundreds of item  in a sceduling agrrement. how to change all the item  one times.
    please give me a way to resovle the problem.
    best regards.

    dear:
      the fast change function cann't resovle the problem,i first double click the item of schedule agreement  ,then select the schedule lines option, finally in the delivery block input the reason of bolck.
    best regards.

  • Is there a way to track the delivered qty at the schedule line level in R3

    Hello Gurus,
    Is there a way to track the delivered qty at the schedule line level in R3.  I spoke to al ot of functional guys on this and the answer is NO. If NO,then, how does the 2LIS_11_V_SSL extractor extract the delivered qty at schedule line level. Help is really appreciated.
    Thanks
    Simmi

    Hi Simmi,
    I have used this extractor for the purpose you describe at more than one customer without problem. My understanding is that it links the order schedule line with the delivery, but I haven't tried to work out the mechanism.
    Regards,
    Ken

  • Regarding schedule line confirm qty

    Hello ,
    I am facing a problem ,that is when we create an order in CRM 2007, we are not able to see confirmed quantity check against the schedule line because  of this order is not able to be processed
    how can this problem can be solved
    regards .

    Hi Rags,
    I have issue regarding schedule line like this .
    in Schedule line i have two line
                Date                        qty                             Confirm Qty
    Line 1 16.08.2011                1                                       0
    Line 2  21.09.2011                0                                      1
    Suppose we have created oreder on 16 th Aug so lschedule line 1 is triggerd on 16th Aug and other scedule line triggred on 21.09.2011 with confirm qty.
    One Batch job run and update only line 1 like mat avalaiblity date, transpotration date, delivery date etc but not line 2. why ?
    I have created PR on 21.08.2011 and Po on 26.08.2011 and material available in plant 5.09.2011 so why this batch job has not change the line2 and date for confirm  qty. But it has not changed line 2.  Why?
    I have checked PR change log and found that item del date chaged from 21.09.2011 to .7.09.2011 but it is not chaged for line 2. Could you please tell me whre is the problem cone across?
    thanks

  • Delivery Date needs to be changed on Schedule lines

    Hi All-
    I am using BAPI_SALESORDER_CHANGE, to update the delivery date on the schedule lines...If I have 2 lines of schedule, needs to be updated the second one ETENR '0002'...
    Bapi returns message that successfully processed, when I go back and look at Sales order, I don't se any changes on schedule line..
    I am pssing into BAPI, sales doc and schedule line with the delivery date and the flag 'U'..and also I am using BAPI commit...
    But, let me know if I am missing something and also let me know is it possible to change schedule delivery date or not?
    Thanks,
    Sony

    Hi
    Please follow this process.
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data.
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    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.

  • Firming the Schedule Lines in Sch.Agreement

    Hi , I have done the  following to firm the schedule lines in Scheduling agreement.
    1. Firm Zone as 30 days
    2.Tradeoff zone days as 60 days
    3.Binding MRP indicator as NULL(Lines not changeable within Zones)
    4.In OMIN , Firm Schedule lines enabled for the MRP group
    When i run the MRP, schedule lines are getting created with Firm Indicator (*) for the requirements lying within these zones. After transmitting the schedule lines to vendor , if i change the requirement again, the schedule  lines within Firm Zone are getting adjusted as per the new requirment. I dont know whats the purpose behind maintaining these Firm Zone and Trade off Zone.
    Pointers are much appreciated.
    Thanks and regards,
    Milton Isaac

    Hi,
    Rolling delivery schedules issued under scheduling agreements are divided into different time zones indicating the degree to which lines of the schedule are binding.
    Firm zone (zone 1) (go-ahead for production).
    The schedule lines within this zone count as firm and thus as fully binding. If you cancel a schedule line that falls within the firm zone, the vendor is entitled to charge you with both production costs and the costs of procuring input materials incurred by him as a result of the cancellation.
    Trade-off zone (zone 2) (go-ahead for procurement of input materials)
    This is the "semi-firm" zone, giving the vendor the go-ahead to procure necessary input materials for the manufacture of the item ordered. If you cancel a schedule line within this semi-firm zone, the vendor is only entitled to charge you the material costs. Schedule lines falling within this time zone are thus less binding that those falling within the firm zone.

  • Credit Release thru VKM3 remove the schedule line delivery block ...

    HI Gurus,
    I have created the sales order with the delivery block at the schedule line. i have save the order . The order goes to the credit block . So when i release credit block with the help of VKM3 then system also removes the schedule line level block.
    This is not std behaviour . Can any one come across such scenario ?
    Details: I have removed the routine 101 in the OVB8 so that if order goes to credit block still order will have the confirm qty.
    Also in the OVAK order type is mark D for automatic credit check.
    Thanks in advance

    Hi ,
    I have checked the sales order thru the program but we are not using any user exit for the same.
    Now i have found that if the qty is confirm on the first date i mean on the date given then system does not remove the block & if the ATP check suggest the diff date so there are two schedule line in this case block get removed ..
    May be this is like after credit removes system must be running the ATP check again ..
    Please help

  • Link between the Schedule Lines and the GR document

    Hi
    I would like to find the link between the Schedule Lines (of Scheduling Agreement) and the GR document. i.e. which GR has been made against which Schedule Line. I have checked the tables EKET, EKBE, MSEG but there is no link with the Schedule Line, I found the link only with the item number there.
    Thanks
    Prashanth

    Hi
    At the time of posting the GR for a SA you will be not posting this with reference to the Schedule line of the SA item. So system will always update the GR document against the SA item and update qty on the schedule line.
    May be this is the reason we donot have any direct relation ship to material document and Scheclue line
    Thanks & Regards
    Kishore

Maybe you are looking for

  • Problem with lm_sensors.

    My system is core i7 860 / asus p7p55d  Archlinux kernel 2.6.30 I'm install lm_sensors 3.1.1 but its seem doesn't work. When I run sensors-detect, the result is Driver `max6650':   * Bus `NVIDIA i2c adapter '     Busdriver `nvidia', I2C address 0x4b

  • RPCIPE00 error log/messages

    Hi all, When I run this RPCIPE00 program, I will get some error messages on certain employees regarding "posting balance not cleared" in the error log button in"Evaluation of Posting Item " screen. I want to know is the error log stored permanently?

  • OWB Mapping quesion

    With the repository deployed on a windows box and the target deployed on a unix box, where do the maps actually run? Specifically if I'm pulling data from an ODBC data source on the Windows box, will that break when I actually deploy it to the target

  • Run BSP Application

    Hi All, I created a simple BSP application. and when I tried to run the application it is giving some BSP error on the browser. I just wanted to know what should put in the host file. Regards, Jeetu

  • CS6 Multicam "Rendering Required Files"

    Did a quick search for "rendering required files" and came up with a number of threads from early-mid 2011 regarding CS5 and 5.5 difficulty with PrPro stopping to render audio files when doing multicam edits. I never experienced that until CS6, and n