BADI for MIGO ( Material document change for Production Order goods Receipt

Hey experts,
I am actually stuck up with MIGO BADI.
There are many BADI's available but i dont think any one would suit my requirement.
here goes my requirement.
When a Production Order is created in transaction CO01 , the system picks the value of the moving  material and multiplies it with the quantity .
But when the production order is being confirmed thru CO11N , again the system picks the present moving price of the material and multiplies it with the quantity. This goods receipt is done through MIGO transaction by selecting goods receipt for order that is 101 movement type. I have been asked to get the value of the material at the time of production order create and then change the dmbtr value of MSEG table, this can be done in the badi at the time of creation of material document number but the BADI's MB_DOCUMENT_BEFORE_UPDATE,  MB_DOCUMENT_UPDATE do not allow me to change the values .
  The BADI MB_DOCUMENT_BEFORE_UPDATE does not allow any changes to be made for XMSEG table
and MB_DOCUMENT_UPDATE is passed by value and hence the changes are not affected after it comes out of the method.
Guys please help me as this creating a hell lot of problem here and i would surely reward the max points if answered.
here is the example to be more precise.
Material : Pen
Quantity : 10.
date : 01.06.2008.
TYransaction co01.
lets say at the time of creation the value of the material was 5 rs
a material document would be created with the value  : 50 rs.
Now for this prod. order goods receipt is being done on 01.07.2008.
Let the value be 4 rs now.
so the Material document would be created with a value of 40 rs.
I need to make this 50 rs.
I have got all the data to do it but i am not gettin the coreect BADI, i just want the BADI name to change the DMBTR value at the time of creation of material Document.
Thanks in Advance.

User-exit /BADI to change mseg during migo
https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=5435559
try this links

Similar Messages

  • Amount for production order goods receipt

    How does the system determine the amount of the product order goods receipt for make to order product that uses variant configuration?
    Meaning during sales order, the components are selected to make up that product.

    It is using Sales Order cost estimate because it is only calculated when the items are selected in sales order.
    If there are changes to the sales order, e.g. options are removed or added...
    how do I make sure the GR take the new value?
    I did the following test in QAS:
    - Production order is created but work not started. Production order deleted.
    - Make changes in sales order.
    - Re-do cost estimate in sales order. I do see that the calculated cost has changed.
    - Recreate production order and as per normal production steps
    - When do production order goods receipt, the value remains the old value and not the new one.
    Did I missed out or do the wrong step?
    However, that also does not help to explain why the value ended up as only $0.01 as same as MM costing view.

  • Production Order Goods Receipt  in Mass

    Hi Frds,
    My client need production order Goods Receipt  in mass i e at time number of production orders with batch creation,
    Could any light on this issue,
    Thanks
    Mohan M

    Dear,
    There is no T. code to do the GR in mass you need to use the BAPI BAPI_GOODSMVT_CREATE.
    Regards,
    R.Brahmankar

  • Changes in Production Orders

    Hi gurus,
    I want to track changes made by end users in the production orders in a report format. Which will tell what was old value and what is new value.
    What needs to be done for this?

    Dear
    Changes in Production Order can be  traced through following ways :
    1.Order Change Management :
    Frist a Overall profile should be configured in SPRO > PRoduction>Shop Floor Control > Operations>Change Management for Production Orders-->Define Overall Change Profile.
    Create a Change Number CC01 with Release Key
    In Object Types select/tick "Actv", "object", "MgtRec",
    You get the Change Number by Saving .
    Use this Change Number to Change BOM or Routings
    Then Release the Change Number useing Release Key till then you don't find the Change of BOM in Production Order.
    Then go to Oder Change Process T Code :- COCM
    Tick Change Number and Select the Change Number & Execute
    Select the Production Order, click on Procurement element icon you get another screen select and execute again.
    You get an Pop-Up screen. "Determine changes, Check changes, Change Original Order.
    you see the changes in BOM for Production Order i.e. after COCM.
    Then Confirm the Changes in Production Order then New changes will be Active in production Order.
    Use COCM1 to find out the details or CO03--Extra --change
    Please check link  : http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PPSFC/PPSFC.pdf
    2.To  get the changes in Production Order apply SAP Note 390635.
    3 .You can use T.code AUT10 to check the changes made to production orders in specified period.
    Regards
    JH
    Edited by: Jiaul Haque on Nov 28, 2010 2:11 PM

  • Multiple Posting change notice created for one material document

    Hi All,
    The scenario is that the user needs to transfer material from unrestricted to quality stock type. while doing so the storage type is different than the actual storage type for the material. Meaning if the material is normally stored in high rack storage type, when it is found that the material is damaged or expired it need to be moved to the quality storage type. For this the user will first create  material document in IM with movement type 322 transferring material from unrestricted stock to qualtiy stock. A PCN will be created in back ground which will in turn be converted manually by the user to a TO. while doing so the user will pick the quant manually from the required storage type and select the destination storage type as the quality or quanranntine area.
    The issue here is that system creates one PCN for each material document line item. The requirement is that the system should create only one PCN with multiple lines for one Material document.
    The setting in the movememnt type clearly says that it will behave as it is behaving.
    Is there any other way or setting by which we can create one PCN with multiple line items for a material document.
    Would look forward to your replies.
    Regards,
    Jeetendra

    Thanks and Sorry for the delayed reply. We have now convinced the users that the system behaviour is standard and we cannot change the same.
    To your question about the need to have one PCN with multiple lines please note that the setup is such that when material document is created for transferring material from unrestricted to quality and vice versa this document is created with multiple materials in one go. Now when the PCN is to be converted to TO then the user ends up in creating number of TO's equal to the number of lines in the Material Document. We wanted to avoid this and hence this was posted in SDN.

  • Link Material Document generated for material movement due to production

    Hello Expert,
    I am creating a zreport for Material Consumption during Production. I am assuming Confirmation entry in PP module as a base of this report and linking to Material Movement data in MM Module. But I am not able to link this data from tables.
    Can you pls guide me how to link Material Document generated for material movement due to production confirmation entry and actual production confirmation entry.
    Thanks
    Shailendra

    Hi Shilendra ,
    You can create a report with the logic. That all the materials which are created due to backflushing confirmation are created with movement type 131 and the component material are consumed by movement type 261.So you can create the report with this logic.
    Dont forget to award Points if it helps.
    Lekhram

  • Delivery number for a material document posted

    Hi experts,
    I need to delivery number for the material document number posted,
    I tried to use the field XBLNR from the table MKPF
    but i see that the feild is empty in the case of inbound delivery
    why is it so.
    How ever i can get the data from VBFA ,but can any one tell me the reason why XBLNR is empty in case of inbound delivery.
    Thanks a lot in Advance.

    Hi,
    If you do GR w.r.t. Inbound Delivery No in MIGO then it will not update "Reference" field i.e. XBLNR.
    To update same with Inbound Delivery No, you have to do "Post Goods Receipt" from Inbound Delivery Document itself in VL31N or VL32N.

  • Output for GR Material Document

    Hi Masters
         I have maintained condition record for output type WE01(GR Note version 1) for Material document(GR against purchase order).In both condition record and outpt type config I have maintained Dispatch time as 3(Send Application with own transaction) but while determining the output type it takes dispatch time as 1 and not listing in the T code MB90(Process output).
    What am I missing?
    Regards
    Mohan

    Hi ,
        check this for config......
    1. Maintain the Printer Name in SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Printer Setting
    2. Ensure that in SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Item Print Indicator, 1 stands for Matl Doc print out
    3. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Print Version, maintain Print Version 2
    4. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Maintain Print Indicator for GI/Transfer Posting Documents
    5. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Output Determination->Maintain Output Types, for the Output types WE01, WE02 and WE03, ensure the foll:
    a. Default Values: Dispatch Time is 3 or 4 as per reqmt. and Tr medium is 1
    b. Print Parameter is 7
    6. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Output Determination->Printer Det->Pr Det by Pl/StoLoc, maintain the Output device for all your Plants
    7. Go to MN21, for Tr Type WE, Print Version 3, maintain Print Item as 1.
    Now the settings are ready for Printing Material doc
    8. While doing MIGO, ensure that in General Tab, you get "3 Collective Slip" beside the Print Indicator and you tick mark the field.
    9. Now depending on the setting in 5a, the Matl doc is printed. If it is 3, you have to print it using MB90. If it is 4, it is printed immediately.
    regards,
    patil

  • User exit for different Material Document for different company code

    Hi,
    We want to have different no. range for Material document (GR) for different compnay code. Presently we have no. range at client level. Can we do with any userexit. If so pls. give the details.
    Regards
    Sai Krishna

    [user exit for generating external serial;
    [BADI MB_DOCUMENT_BADI;
    [user exit or any other enhancements during good receipt;

  • CIN - Excise value posting for the material document

    Hi,
    We have assigned the routine 356(FV64A356) in the Pricing Procedure for Depot Sales where Service team issues components for the Service repair job through a Goods Issue(MIGO-261 Mvt Type) document.We are also able to create a excise invoice for the material document.
    The flow is Service Order - Goods Issue - through resource related billing a DMR is generated for the labour as well as the Goods Issued(MIGO-261), from DMR a debit memo is raised to invoice the Customer.
    The formula in the routing is, during the creation of Billing or Proforma document it picks up the excise value posted for the delivery if the excise has been posted,if the delivery is not found, then it continues with the excise value calculated in the sales order (DMR in this case)
    Is there any way or any other routine "to check for the excise value posted for the delivery ,if the delivery is not found, then check for the material documents if any linked to DMR(through Service Order)".
    Could anyone help in this regard.
    Thanks,
    Ramki.

    Hi,
    While creating the excise challan using J1IF01 you can see a excise invoice selection tab, Select the J1IF01 line item & click on this tab, here you can select the excise invoice from which the base amount will be determined.
    Thanks & Regards,

  • How to extend Sales org for a material being Changed

    Hi Experts,
    i need to extend sales org , distribution Channel for a material .
    my table look like this and having 6 fields shown below
      1             2         3               4            5                     6
    Sales org | Des | Distn Chnl | desc |  Copy from So | Copy from Dstn Chnl
    If the user enters the existing value in Copy From SO and Copy Fron Distn Chnl  .  Then i need to copy all the values corresponding to the Existing SO and Distrn Chnl to the Newly entered Sales Org . 
    the table im displaying in ALV , if user perss F4 in copy From SO and Copy From Distn  , i need to show the existing values for the material being changed , this is working fine and i am able to get the existing values.
    After user selects one of the existing value for SO and Distrn channel  , i need to copy all the values to newly created So and distrn Chnl  .
    i dont know how to proceed . Please help me to solve this problem.
    Thanks,
    Shrikanth

    You can use AET to extend the sales area data of BP.  However, it wont add the fields automatically in GUI, But the generated fields are available in the relevant DB tables.
    BP GUI transaction is no more supported . Im not sure why you want to work on GUI.
    Regards,
    Shaik

  • Function Module to know the Acc doc no for a Material document.

    Dear Friends,
    What is the Function Module to know the Acc doc no for a Material document? Please help. Thanks in advance.
    Regards,
    RAMAN

    Hi Raman,
    I am not sure about your requirement,
    But i remember when i required the same like you i went to vrpma table to get the account document,
    I just did like a blind fold,
    as my company does all the billing accounts in the same month, my search criteria was blind.
    Also try with MKPF-XBLNR with the VBRK-XBLNR and get VBRK-VBELN
    from there goto BSEG.
    Thansk & regards,
    Dileep .C

  • 'BAPI_GOODSMVT_CREATE' takes more time for creating material document

    Hi Experts,
    I m using 'BAPI_GOODSMVT_CREATE' in my custom report, it takes more time for creating Material documents.
    Please let me know if there is any option to overcome this issue.
    Thanks in advance
    Regards,
    Leo

    Hi,
    please check if some of following OSS notes are not valid for your problem:
    [Note 838036 - AFS: Performance issues during GR with ref. to PO|https://service.sap.com/sap/support/notes/838036]
    [Note 391142 - Performance: Goods receipt for inbound delivery|https://service.sap.com/sap/support/notes/391142]
    [Note 1414418 - Goods receipt for customer returns: Various corrections|https://service.sap.com/sap/support/notes/1414418]
    The other idea is not to commit each call, but executing commit of packages e.g. after 1000 BAPI calls.
    But otherwise, I am afraid you can not do a lot about performance of standard BAPI. Maybe there is some customer enhancement which is taking too long inside the BAPI, but this has to be analysed by you. To analyse performance, just execute your program via tr. SE30.
    Regards
    Adrian

  • 'BAPI_GOODSMVT_CREATE' takes more time for creating material document for the 1st time

    Hi Experts,
    I am doing goods movement using BAPI_GOODSMVT_CREATE in my custom code.
    Then there is some functional configuration such that, material documents and TR and TO are getting created.
    Now I need to get TO and TR numbers from LTAK table passing material documnt number and year, which I got from above used BAPI.
    The problem I am facing is very strange.
    Only for the 1st time, I am not finding TR and TO values in LTAK table. And subsequent runs I get entries in LTAK in there is a wait time of 5 seconds after bapi call.
    I have found 'BAPI_GOODSMVT_CREATE' takes more time for creating material document with similar issue, but no solution or explanation.
    Note 838036 says something similar, but it seems obsolete.
    Kindly share your expertise and opinions.
    Thanks,
    Anil

    Hi,
    please check if some of following OSS notes are not valid for your problem:
    [Note 838036 - AFS: Performance issues during GR with ref. to PO|https://service.sap.com/sap/support/notes/838036]
    [Note 391142 - Performance: Goods receipt for inbound delivery|https://service.sap.com/sap/support/notes/391142]
    [Note 1414418 - Goods receipt for customer returns: Various corrections|https://service.sap.com/sap/support/notes/1414418]
    The other idea is not to commit each call, but executing commit of packages e.g. after 1000 BAPI calls.
    But otherwise, I am afraid you can not do a lot about performance of standard BAPI. Maybe there is some customer enhancement which is taking too long inside the BAPI, but this has to be analysed by you. To analyse performance, just execute your program via tr. SE30.
    Regards
    Adrian

  • BAPI for operation change in production order?

    Hi there,
    I want to change operation data in a production order and I can only find this BAPI:
    BAPI_ALM_ORDER_MAINTAIN
    Can this BAPI also be used for changing an production order? Because in the documentation of the BAPI this function isn't really mentioned...
    Can you give me some hints or the name of another BAPI doing this task?
    Kind regards
    Max

    yep it can be used for that, the documentation for this bapi is ( very unusual for bapis I know ) available
    call the bapi in se37. goto -> documentation
    I don't have an example for changing orders and operations but I use it to copy serviceorders (only difference between serviceorder and production order is that you can enter a customer at serviceorders)
    which are quite extensive with lot of operations and components and functional locations
    here my example for creation. for change I believe you also have to fill the UP structures accordingly to what you want to update
    kind regards
    arthur
    gs_meth-refnumber  = 1.
      gs_meth-objecttype = 'HEADER'.
      gs_meth-method     = 'CREATE'.
      gs_meth-objectkey  = c_init_ordid .
      append gs_meth to gt_meth.
      move-corresponding gs_meth to gs_ext.
      gs_meth-refnumber  = 1 .
      gs_meth-objecttype = 'PARTNER'.
      gs_meth-method     = 'CREATE'.
      gs_meth-objectkey  = c_init_ordid.
      append gs_meth to gt_meth.
      h_refnumber = 1.
      loop at gt_operations_i into gs_operations_i.
        concatenate c_init_ordid gs_operations_i-activity into gv_so_operation.
        gs_meth-refnumber  = h_refnumber.
        gs_meth-objecttype = 'OPERATION'.
        gs_meth-method     = 'CREATE'.
        gs_meth-objectkey  = gv_so_operation.
        append gs_meth to gt_meth.
        add 1 to h_refnumber.
      endloop.
      clear h_refnumber.
      loop at gt_components_i into gs_components_i.
        add 1 to h_refnumber.
        gs_meth-refnumber  = h_refnumber.
        gs_meth-objecttype = 'COMPONENT'.
        gs_meth-method     = 'CREATE'.
        concatenate c_init_ordid
                    gs_components_i-activity
                    gs_components_i-item_number
        into gs_meth-objectkey.
        append gs_meth to gt_meth.
      endloop.
      clear h_refnumber.
      loop at gt_texts into gs_texts.
        add 1 to h_refnumber.
        concatenate c_init_ordid gs_texts-activity into gv_so_operation.
        gs_meth-refnumber  = h_refnumber.
        gs_meth-objecttype = 'TEXT'.
        gs_meth-method     = 'CREATE'.
        gs_meth-objectkey  = gv_so_operation.
        append gs_meth to gt_meth.
      endloop.
    * gebruikte objecten cq functieplaatsen
      clear h_refnumber.
      loop at gt_objectlist_i into gs_objectlist_i.
        add 1 to h_refnumber.
        gs_meth-refnumber  = h_refnumber.
        gs_meth-objecttype = 'OBJECTLIST'.
        gs_meth-method     = 'CREATE'.
        gs_meth-objectkey  = c_init_ordid.
        append gs_meth to gt_meth.
      endloop.
      clear h_refnumber.
    if p_objrel = 'X' and gt_relation_i is not initial.
    * koppeling functieplaats met operatie
    * kunnen geen meervoudige koppelingen gemaakt worden in BAPI
    * dus hier 1 koppeling maken en na BAPI de rest aanleggen
      read table gt_relation_i into gs_relation_i index 1.
      add 1 to h_refnumber.
      gs_meth-refnumber  = h_refnumber.
      gs_meth-objecttype = 'OLISTRELATION'.
      gs_meth-method     = 'CREATE'.
      gs_meth-objectkey  = c_init_ordid.
      append gs_meth to gt_meth.
    endif.
      gs_meth-refnumber  = c_init_ordid.
      gs_meth-objecttype = space.
      gs_meth-method     = 'SAVE'.
      gs_meth-objectkey  = c_init_ordid.
      append gs_meth to gt_meth.
    * BAPI-call
      refresh: gt_ret, gt_numbers.
      clear:   gt_ret, gt_numbers.
      call function 'BAPI_ALM_ORDER_MAINTAIN'
        destination 'NONE'                       " --> Zie note 770626 !
        tables
          it_methods             = gt_meth
          it_header              = gt_header_i
    *       IT_HEADER_UP           =
    *       IT_HEADER_SRV          =
    *       IT_HEADER_SRV_UP       =
    *       IT_USERSTATUS          =
          it_partner             = gt_partner_i
    *       IT_PARTNER_UP          =
          it_operation           = gt_operations_i
    *       IT_OPERATION_UP        =
    *       IT_RELATION            =
    *       IT_RELATION_UP         =
          it_component           = gt_components_i
    *       IT_COMPONENT_UP        =
          it_objectlist           = gt_objectlist_i
          it_olist_relation       = gt_relation_i
          it_text                = gt_texts
          it_text_lines          = gt_text_lines
          extension_in           = gt_ext
          return                 = gt_ret
          et_numbers             = gt_numbers.
      call function 'BAPI_TRANSACTION_COMMIT'
        destination 'NONE'
        exporting
          wait          = 'X'
    *         IMPORTING
    *           RETURN        =
    *   Zie note 770626 ...
      call function 'RFC_CONNECTION_CLOSE'
        exporting
          destination                = 'NONE'
    *       TASKNAME                   =
        exceptions
          destination_not_open       = 1
          others                     = 2
    Edited by: A. de Smidt on Feb 26, 2009 5:20 PM

Maybe you are looking for

  • I can't install the drivers on Satellite A665

    Hi every body, I have a problem with my new Satellite A665 laptop. I downloaded TV tuner driver but I can't install it on my computer but every time when Im trying to install it the computer ask me the security question and I agree on that. After tha

  • MySAP Skills

    Sorry folks. This is an offbeat question. Appreciate if you could still spare a few moments to answer it. The phrase "mySAP" is normally prefixed to SAP Business suite components like PLM, CRM, SCM, SRM and ERP. What does one make out when someone sa

  • Result Analysis - Errror message

    Hi while we run the result analysis in KKAK we are getting "Cost element 910108052 (line ID ZTS) already used for line ID CSA. Need some help solving it. Thank you, Nivi

  • Maintenance Machine time in ERP

    Dear Gurus My client want to record there Maintenance Machine time in ERP, since they don't have any PM module. So is it possible to record these things in ERP and will get as a report?.....Vry urgent pls tell me the sol'n for this. regards PPR

  • Recursive logic

    Hi, I have the code below that does recursive calls. The final expression evaluates to a boolean when the recursion ends. However, there is loop hole in the logic below, that I have recognized but couldn't resolve though. private boolean isMoClassFou