What is the BADI  while SAVING purchase order using me22n?

what is the BADI  while SAVING purchase order using me22n?
while i will save purchase order through me22n, badi should be fire what is badi for that?
regards,
dushyant.

Dushyant,
Hopefully you know how to implement the BADI ME_PROCESS_PO_CUST now.
The following are the codes that you can put in the method "Post".
  DATA: LW_HEADER        TYPE MEPOHEADER,
        LW_POSTED_HEADER TYPE MEPOHEADER,
        LW_VALID         TYPE MMPUR_BOOL,
        ITAB_ITEM        TYPE PURCHASE_ORDER_ITEMS,
        LW_ITEM          TYPE MEPOITEM,
        ITEM_INTERFACE   TYPE PURCHASE_ORDER_ITEM,
        ITAB_ACCT        TYPE PURCHASE_ORDER_ACCOUNTINGS,
        ACCT_INTERFACE   TYPE PURCHASE_ORDER_ACCOUNTING,
        LW_ACCT          TYPE MEPOACCOUNTING,
        LW_POSTED_ACCT   TYPE MEPOACCOUNTING,
        W_ACCT_CHANGED  TYPE C,
        W_GRANT_AMT      TYPE EKPO-NETWR,
        W_FINANCE_AMT    TYPE EKPO-NETWR,
        W_FLAG           TYPE C.
Check if PO header data is valid
  CLEAR LW_VALID.
  CALL METHOD IM_HEADER->IS_VALID
    RECEIVING
      RE_VALID = LW_VALID.
  CHECK LW_VALID = 'X'.
PO header data is valid
Get the newly updated PO header data
  CLEAR LW_HEADER.
  CALL METHOD IM_HEADER->GET_DATA
    RECEIVING
      RE_DATA = LW_HEADER.
Get the posted PO header data
  CLEAR LW_POSTED_HEADER.
  CALL METHOD IM_HEADER->GET_PERSISTENT_DATA
    IMPORTING
      EX_DATA = LW_POSTED_HEADER
    EXCEPTIONS
      NO_DATA = 1.
  IF SY-SUBRC <> 0.
    CLEAR LW_POSTED_HEADER.
  ENDIF.
Get PO line items
  REFRESH ITAB_ITEM.
  CALL METHOD IM_HEADER->GET_ITEMS
    RECEIVING
      RE_ITEMS = ITAB_ITEM.
  LOOP AT ITAB_ITEM INTO ITEM_INTERFACE.
Check if PO line item is valid
    CLEAR LW_VALID.
    CALL METHOD ITEM_INTERFACE-ITEM->IS_VALID
      RECEIVING
        RE_VALID = LW_VALID.
    IF LW_VALID <> 'X'.
This PO line item is not valid
      CLEAR W_ACCT_CHANGED.
      EXIT.
    ENDIF.
    CLEAR LW_ITEM.
    CALL METHOD ITEM_INTERFACE-ITEM->GET_DATA
      RECEIVING
        RE_DATA = LW_ITEM.
Get the account interface
    REFRESH ITAB_ACCT.
    CALL METHOD ITEM_INTERFACE-ITEM->GET_ACCOUNTINGS
      RECEIVING
        RE_ACCOUNTINGS = ITAB_ACCT.
    LOOP AT ITAB_ACCT INTO ACCT_INTERFACE.
      CLEAR LW_ACCT.
Get the newly updated PO item data
      CALL METHOD ACCT_INTERFACE-ACCOUNTING->GET_DATA
        RECEIVING
          RE_DATA = LW_ACCT.
      CLEAR LW_POSTED_ACCT.
Get the posted PO item data
      CALL METHOD ACCT_INTERFACE-ACCOUNTING->GET_PERSISTENT_DATA
        IMPORTING
          EX_DATA = LW_POSTED_ACCT
        EXCEPTIONS
          NO_DATA = 1.
      IF SY-SUBRC > 0.
        CLEAR LW_POSTED_ACCT.
      ENDIF.
      IF LW_ACCT-LOEKZ <> LW_POSTED_ACCT-LOEKZ OR
         LW_ACCT-KOSTL <> LW_POSTED_ACCT-KOSTL OR
         LW_ACCT-PRCTR <> LW_POSTED_ACCT-PRCTR OR
         LW_ACCT-PS_PSP_PNR <> LW_POSTED_ACCT-PS_PSP_PNR.
Account assignment was changed
We will force this PO to go through workflow
        W_ACCT_CHANGED = 'Y'.
      ENDIF.
    ENDLOOP.
  ENDLOOP.

Similar Messages

  • User exit or BADI while saving purchase order

    Hello,
    I want to use an user exit or BADI while saving of purchase order. The objective is to check the material group of the line item while saving. We don´t want to allow to save purchase orders for one material group.
    Can you please guide me.
    Thanks
    Srinivasan

    Hi
    The Business Add-In (BAdI) ME_PROCESS_PO_CUST enables you to extend the business logic of the Enjoy purchase order on an individual basis.
    You can thus influence the dialog transactions ME21N, ME22N, ME23N, and ME29N, and the BAPIs BAPI_PO_CREATE1 and BAPI_PO_CHANGE.
    Typical applications for this BAdI include:
    Processing of own objects
    Processing of additional data on standard objects
    Implementation of additional checks and derivationsChange of data in standard fields
    Change in field selection
    you can use this BADI for checking the material group
    Thanks & Regards
    Kishore

  • Error while saving purchase order

    Hi all,
    While saving purchase order i am getting the following error.
    Syntax error in program SAPLV61A
    in include RV64A932
    in line 10
    Statement"*&"is not defined.check your spelling.
    Thanks& Regards,
    Hari.

    Hi Hari,
    I've just encountered the same problem as you have now in your latest post.
    Normally the include that you mentioned is a formula condition value include which you can modify but you probably have
    to register this object first on the SAP OSS pages to get an Access key to modify it.
    After you've obtained a key launch transaction VOFM and comment out the line "TABLES: VBRK, VBAK".
    As you see below SAP did exactly the same thing in several other includes.
    Include FV64A582
    -> is a formula condition value
        tx VOFM
                -> Formulas
         -> Condition Value
         -> Routine number 582
    At line 37 I commented out "TABLES: VBRK, VBAK." which is not used
    anyway in this include.
    On top of that SAP commented out these definitions in several other
    includes: eg. FOICH002, FOICH002, OI_LV61ATOI.
    If other persons have comments on this topic please respond/advise.
    Hari, inform us if this resolved your problem.
    Also reward points if my post aided you in resolving your issue.
    Thank you for feedback.
    Best regards,
    Tom Cockaert.

  • How to Assigning the number ranges for Purchase Order using EXIT_SAPMM06E_0

    How to Assigning the number ranges for Purchase Order using EXIT_SAPMM06E_001 using Functional Module NUMBER_GET_NEXT explain me ?

    Hi,
    First go thourh the FM import export parameters list.
    Try to create an internal table of type INRI-NRRANGENR for number ranges.
    We can provide the lower and higher values for this table so that what ever PO is created will be with that range.
    Try to create the ncessary ones using this FM.
    In the Exit, EXIT_SAPMM06E_001,
    the Export parameters are-
    EKKO-EBELN- the PO ios created with in that specified range
    Range as INRI-NRRANGENR - Here try to assign the Internal table that was populated in the FM.
    Try to code this in the Include provded and keep Breakpint and check the PO number generated.
    Reply if u need more help on this.
    Reward if helpful.
    Best Wishes,
    Chandralekha

  • Update ZPURCHASE THROUGH BADI .. at the time of saving Purchase Order

    Dear All Gurus,
    I have a situation wherein i have to save the Purchase Order Details in My DB table (ZPURCHASE ) at the time of Purchase Order Creation through BADI...
    Fields of ZPURCHASE are (Mandt,EBELN,BUKRS)
    Can some one guide me how can i achieve this..
    I tried doing it through User Exits.. i have written a piece of code when saving the purchase order but my problem is .. The purchase order numbers are generated only after SAVE is complete..
    The other alternative i want to try is through BADI.
    Looking forward for your reply.
    Thanks !!

    > I have a situation wherein i have to save the Purchase Order Details in My DB table (ZPURCHASE ) at the time of Purchase Order Creation through BADI...
    > Fields of ZPURCHASE are (Mandt,EBELN,BUKRS)
    I have no solution for your actual problem (wrong forum, you should try the MM forum) but I wonder why you just don't use the data that is already there in EKKO and EKPO?
    Markus

  • Issue while saving Purchase Order

    Dear all
    I am trying to save a Purchase order, the taxes in Purchase order -> Invoice -> Taxes are not getting populated corectly.
    Is there any user exit/Badi to populate the same.
    Thanks in advance.
    Regards
    Dinesh

    if tax rate not triggered in po mean, some where wrong in ur tax process , pls check the blw
    If its Taxinn procedure,
    1- check in FTXP the tax code is created towards ur tax procedure and country
    2- check in FV12 for the condition types say JMOP,JEC1 and others, whthere tax rate and validity are defined properly.
    3- for JMX1 cond type , keep its 100%
    4- check in obbg , the tax proce is assinged to ur country or not??
    let me knw, if u r not able to solve???

  • User exit at the time of saving purchase order

    Hi experts
    There are some plants for which we need to auto GR. Is there any user exit available which will check these plants in PO at the time of saving PO document and do auto GR.
    Regards

    Enhancement                                                                               
    MEVME001                                WE default quantity calc. and over/ underdelivery tolerance    
    MM06E001                                User exits for EDI inbound and outbound purchasing documents   
    MM06E003                                Number range and document number                               
    MM06E004                                Control import data screens in purchase order                  
    MM06E005                                Customer fields in purchasing document                         
    MM06E007                                Change document for requisitions upon conversion into PO       
    MM06E008                                Monitoring of contr. target value in case of release orders    
    MM06E009                                Relevant texts for "Texts exist" indicator                     
    MM06E010                                Field selection for vendor address                             
    MM06E011                                Activate PReq Block                                            
    MMAL0001                                ALE source list distribution: Outbound processing              
    MMAL0002                                ALE source list distribution: Inbound processing               
    MMAL0003                                ALE purcasing info record distribution: Outbound processing    
    MMAL0004                                ALE purchasing info record distribution: Inbound processing    
    MMDA0001                                Default delivery addresses                                     
    MMFAB001                                User exit for generation of release order                      
    MRFLB001                                Control Items for Contract Release Order                       
    AMPL0001                                User subscreen for additional data on AMPL                     
    LMEDR001                                Enhancements to print program                                  
    LMELA002                                Adopt batch no. from shipping notification when posting a GR   
    LMELA010                                Inbound shipping notification: Transfer item data from IDOC    
    LMEQR001                                User exit for source determination                             
    LMEXF001                                Conditions in Purchasing Documents Without Invoice Receipt     
    LWSUS001                                Customer-Specific Source Determination in Retail               
    M06B0001                                Role determination for purchase requisition release            
    M06B0002                                Changes to comm. structure for purchase requisition release    
    M06B0003                                Number range and document number                               
    MEQUERY1                                Enhancement to Document Overview ME21N/ME51N                   
    MELAB001                                Gen. forecast delivery schedules: Transfer schedule implem.  
    MEFLD004                                Determine earliest delivery date f. check w. GR (only PO)    
    MEETA001                                Define schedule line type (backlog, immed. req., preview)    
    ME590001                                Grouping of requsitions for PO split in ME59                 
    M06E0005                                Role determination for release of purchasing documents       
    M06E0004                                Changes to communication structure for release purch. doc.   
    M06B0005                                Changes to comm. structure for overall release of requisn.   
    M06B0004                                Number range and document number                             
    User exit for me21n

  • Problem while displaying Purchase order using me9f

    Hi All,
    I have copied ME9F as ZME9F, and SAPFM06P as ZSAPFM06P (print program of purchase order). Now when I display the PO using ME23n, there is no problem and PO is getting displayed absolutely fine. But When I display the same PO using ZME9F, the vendor address in the PO is getting printed at the item level instead of header level.
    The vendor address should be displayed at the top and not at the item level.
    When I analysed the code, I found in case of ZME9F AND ME23N, the values of NAST structure and ENT_SCREEN are different. These values are passed as input values to the Function Module ME_READ_PO_FOR_PRINTING.
    Please let me know how do I fix this issue, such that vendor address is displayed at the header level instaed of item level.
    Thanks !!!

    Hi,
    First you creat a PO using BAPI_PO_CREATE , once PO is created then you use the FM BAPI_PO_CHANGE and update the condtions in PO. See the code below given.
    Fm lt_cond-condition_no = lvc_knumv.
    lt_cond-itm_number = gt_output-ebelp.
    lt_cond-cond_type = 'FRB1'.
    lt_cond-cond_st_no = '020'.
    lt_condx-condition_no = lvc_knumv.
    lt_condx-itm_number = gt_output-ebelp.
    lt_condx-itm_numberx = 'X'.
    lt_condx-cond_st_no = lt_cond-cond_st_no.
    lt_condx-cond_st_nox = 'X'.
    lt_condx-cond_type = 'X'.
    lt_cond-cond_value = gt_output-frcst.
    lt_condx-cond_value = 'X'.
    lt_cond-currency = p_cndcur.
    lt_condx-currency = 'X'.
    lt_cond-vendor_no = gt_output-frvndr.
    lt_condx-vendor_no = 'X'.
    lt_cond-change_id = 'I'.
    lt_condx-change_id = 'X'.
    APPEND lt_cond.
    APPEND lt_condx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
    purchaseorder = gt_output-ebeln
    TABLES
    return = lt_return
    * poitem = lt_poitem
    * poitemx = lt_poitemx
    pocond = lt_cond
    pocondx = lt_condx.
    Thanks.

  • To change the header text of Purchase order using BAPI

    Hi,
    I am using BAPI_PO_CHANGE to change the header text of PO. But it s not reflecting. Can anyone help me by providing solution for this.
    <i><b>Points will be rewarded for the useful answers.</b></i>

    Hi,
    I need to change the text using this BAPI alone. I am using this because i need to change many parameters of PO.
    Can u please say me solution using BAPI_PO_CHANGE. I need to know what are all the parameters need to be passed to BAPI to change the text.
    Thank you for replying.

  • "Procurement Wizard"  window opens for a particular warehouse while saving Sales Order

    Hello All,
    We have upgraded SAP B1 8.8 to SAP B1 9.0
    My client is facing one of problem while saving Sales order using particular warehouse.
    Actually client is having 4 warehouses (A,B,C,D) in which if they use one particular warehouse "A" for saving Sales order they are facing a issue. The scenario is here below:
    1. Client selects all required details of sales order with along with particular warehouse "A".
    2. On saving SO "Procurement Wizard" is automatically triggered even if procurement document field is unchecked in logistic tab of SO.
    3. This is happening only for a particular warehouse "A". Whereas if I select other 3 warehouses (B,C,D) the system saves SO without trigerring "Procurement Wizard".
    Client is using SAP B1 9.0 PL 08 
    We don't want this  "Procurement Wizard" window to open for this. As we haven't selected any check box for  "Procurement Wizard" so it should not open for a particular warehouse "A".
    Do you think any issue with my warehouse or system settings? Please let me know.
    Please refer screen shots.
    Thanks in advance.

    Hi Saurabh,
    As per your Screen Shot, I think you have Add-on.
    Please stop that Add-on and then check above Scenario.
    Thanks
    Regards::::
    Atul Chakraborty

  • Bad performance updating purchase order (ME22N)

    Hello!
    Recently, we face bad performance updating purchase orders using transaction ME22N. The problem occurs since we implemented change documents for a custom table T. T is used to store additional data to purchase order positions using BAdIs ME_PROCESS_PO_CUST and ME_GUI_PO_CUST.
    I've created a change document C_T for T using transaction SCDO. The update module of the change document is triggered in the method POST of BAdI ME_PROCESS_PO_CUST.
    Checking transaction SM13, I recognized that the update requests of ME22n have status INIT for several minutes before they are processed. I also tried to exclude the call of the update module for change document C_T (in Method POST) - the performance problem still occurs!
    The problem only occurs with transaction ME22N, thus I assume that the reason is the new change document C_T.
    Thanks for your help!
    Greetings,
    Wolfgang

    I agree with vikram, we don't have enough information, even not a small hint on usage of this field, so which answer do you expect (The quality of an answer depends ...) This analysis must be executed on your system...
    From a technical point of view, the BAPI_PO_CHANGE has EXTENSIONIN table parameter, fill it using structure BAPI_TE_MEPOITEM[X] alreading containing CI_EKPODB (*) and CI_EKPODBX (**)
    Regards,
    Raymond
    (*) I guess you have used this include
    (**) I guess you forgot this one (same field names but data element always BAPIUPDATE)

  • What is the exact difference between Purchse order and purchase requisition

    Hi all,
    What is the exact difference between Purchse order and purchase requisition.
    Thx

    Hi,
    <b>Purchase Requisition</b>-> Staff in an orgn places Pur requisition for want of some goods/products - ME51
    Related Table EBAN
    Request for Quotation(RFQ)-> The Purchase dept in the orgn calls/requests for the quotation for the products against which PR was raised. - ME41
    Vendor Evaluation->After receving the RFQ's, after comparison a Vendor is finalised based on the terms and conditions.
    <b>Purchase Order(PO)</b>-> Pur order was issued to that vendor asking him to supply the goods/products -ME21N
    Tables:EKKO,EKPO
    Goods Receipt Note(GRN)->Vendor supplies the material/Products to the orgn-
    MB01
    Goods Issue (GI) -> People receives their respective itesm for which they have placed the Requisitions
    Vendor, Material ,Qty are mandatory for PO.
    Regards,
    Padmam.

  • Is it possible to change the vendor in a saved Purchase order

    Is it possible to change the vendor in a saved Purchase order
    Regards
    Amit

    Hello, Amit,
    no, but you can change the partner functions in the PO, like "Invoicing Party", "Vendor", "Goods Supplier" -- depends on you customizing for partner schemas.
    However, this should be used only in case when during the purchase order lifecycle the partner has been changed (as result of merger, bankrupcy, factoring); otherwise, it is much easier to simply delete the PO and create a new one.
    Kind Regards
    TomT

  • WHATS THE FLOW OF A PURCHASE ORDER WITH REGARS TO MATERIAL MANAGEMENT ?

    WHATS THE FLOW OF A PURCHASE ORDER WITH REGARDS TO MATERIAL MANAGEMENT ?

    Hi
    see the MM flow with related Transaction codes
    MM Cycle:
    Purchase Requisition-> Staff in an orgn places Pur requisition for want of some goods/products - ME51
    Request for Quotation(RFQ)-> The Purchase dept in the orgn calls/requests for the quotation for the products against which PR was raised. - ME41
    Vendor Evaluation->After receving the RFQ's, after comparison a Vendor is finalised based on the terms and conditions.
    Purchase Order(PO)-> Pur order was issued to that vendor asking him to supply the goods/products -ME21N
    Goods Receipt Note(GRN)->Vendor supplies the material/Products to the orgn-
    MB01
    Goods Issue (GI)  -> People receives their respective itesm for which they have placed the Requisitions
    Invoice Verification-> ALong with the Material Vendor submits a Invoice for which the Company Pays the amount - .MIRO
    Data to FI -> data will be posted to FI as per the vendor invoices
    you better go through all these links u will get all the info what ever u need
    for mm
    http://www.sapgenie.com/abap/tables_mm.htm
    http://www.sap-img.com/sap-download/sap-tables.zip
    http://www.allsaplinks.com/material_management.html
    http://www.training-classes.com/course_hierarchy/courses/2614_SAP_R_3_MM_Invoice_Verification_-_Rel_4_x.php
    http://www.sapfriends.com/sapstuff.html
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSMAT/PSMAT.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAARCMM/CAARCMM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_MM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOMDMM/LOMDMM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMMM/BCBMTWFMMM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MMIVMVAL/MMIVMVAL.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MMWMLVS/MMWMLVS.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MMISVE/MMISVE.pdf
    Reward points if useful
    regards
    Anji

  • While creating Purchase order the system is showing error: vendor 200001145

    Hi experts,
    while creating Purchase order the system is showing error: vendor 200001145 on line 00010 for ctype ZB12 not defined as head office vendor.
    Plz  give solution for this.
    Thanks&Regards
    sreenivas

    Hi,
    Please check vendor schema maintained in the vendor master,. through this condition type arepicking from system
    Aboue condition type not mainatained inthe caluation schame ,which you assigend to vendorand purchasing organization
    regards
    Channa
    Edited by: channadodawad on Dec 3, 2009 9:22 AM

Maybe you are looking for

  • Difference b/w scanning TEXT vs. IMAGES (or printing to pdf in PREVIEW)?

    I have my scanner set to 300 dpi Color TIFF. Is this giving me something different when I scan a text document or when I scan a series of images? Do these then get /converted/ in some way that I am not understanding when I print to pdf in PREVIEW? I

  • Problem in File Sender Communication channel

    Dear all, We have FIle TO RFC scenario, which have been running in Production since long time. Problem :  Many of the time we have obsereved that even if the FTP is up and running , but file is not getting picked from ftp server. File name and all ot

  • Synchronization of FM in background mode

    Hi all! I need to implement a function module in background mode that contains a call transaction. The problem is that i need a synchronization between consecutive calls, so i have to insure that one FM is processsed completely to start the next one.

  • Another BC Question (Installing Windows WITHOUT Boot Camp)

    Is it possible (and/or even advisable) to install Windows on my second internal without Boot Camp? (i.e. reformatting the entire drive as one Master Boot Record Partition, then boot and install from Windows disc directly)? If so, are there instructio

  • Mail will not close

    My mail app will not quit I have tried to quit it but it just makes a beep sound and then will not close. I can't shut down because mail keeps stopping the shut down. Any help would be appreciated.