BADI ME_REQ_POSTED in Transaction ME55

Hi all,
I'm trying to implement BADI ME_REQ_POSTED to prevent users releasing purchase requisitions in transaction ME55 which they created themselves.
I've got the code below to work to a certain extent, an error will be displayed when you click on one of your own requisitions, however, if you then click the 'release' button of a requisition which wasn't created by you, both documents are released.
I have a feeling that this is due to the releasing function not being complete when the error message is shown, so it continues when the second requisition is clicked, validating both documents. I'm very new to ABAP so open to any suggestions!
method IF_EX_ME_REQ_POSTED~POSTED.
  if sy-tcode = 'ME55'.
    DATA: ls_header TYPE UEBAN.
    loop at im_eban into ls_header.
    endloop.
    if ls_header-ernam = sy-uname.
      MESSAGE ID 'ZVAL' TYPE 'E' NUMBER '010'.
    endif.
  endif.
endmethod.
Thanks,
Richard

Hi Richard,
Did you find solution to your problem?I have nearly same problem too.
If you find,can you tell the solution you find?
Thanks

Similar Messages

  • Badi ME_REQ_POSTED  For CJ20N Transaction

    Dear All,
    I am creating PR from PS using tcode: CJ20N and i need to check PR Requisitioner fields through CJ20N ,
    I am able to give error message for PR Requisitioner field through BADI ME_REQ_POSTED . My problem is as follows
    Suppose First time I enter wrong value (Ex. ABC ) in Requisitioner field , then it gives error message, then I give correct  Value (Ex. 1101_003 ) in Requisitioner Field  At that time also it is giving the error message.
    When I give correct value in Requisitioner Field the new value of Requisitioner is not coming in IM_EBAN
    I need to check every time latest value of Requisitioner Field in IM_EBAN in CJ20N.
    Following code I have written in IF_EX_ME_REQ_POSTED~POSTED
    IF SY-TCODE = 'CJ20N' .
        C_ATINN = 'PR_REQUISITIONER'.
        CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
          EXPORTING
            INPUT  = C_ATINN
          IMPORTING
            OUTPUT = C_ATINN.
        LOOP AT IM_EBAN INTO L_S_EBAN WHERE LOEKZ IS INITIAL.
          CLEAR W_AFNAM.
          SELECT SINGLE ATWRT  INTO W_AFNAM
              FROM CAWN WHERE ATINN = C_ATINN
                          AND ATWRT = L_S_EBAN-AFNAM.
          IF SY-SUBRC <> 0.
            MESSAGE E499(SY) WITH  'Invalid requisitioner'
          ENDIF.
        ENDLOOP.
      ENDIF.
    Already searched on SDN.
    Please help me why the latest value which we enter in requisitioner is not coming in IM_EBAN
    Thanks in Advance
    Regard's
    Shabbir
    Any Help !!!
    Edited by: Shabbir Kureshi on Jul 15, 2010 1:01 PM
    Edited by: Shabbir Kureshi on Jul 15, 2010 2:08 PM

    Hello Shabbir
    If I understand you correctly then you want to prevent the creation of a purchase requisition in case of an invalid Requisitioner.
    In this case I would assume that BADI ME_REQ_POSTED is the wrong one because BAdI method implies that the PR will be saved. Why?
    There is no exception (not usual for BAdI methods) nor a CHANGING parameter like CH_FAILED defined.
    I assume that the correct BAdI for your purpose would be ME_PROCESS_REQ. Final checks BEFORE saving the PR are implemented in interface method IF_EX_ME_PROCESS_REQ~CHECK.
    In case of failure you set CH_FAILED = 'X'. In order to set an error message you may have a look at the following coding:
    METHOD if_ex_me_process_req~check .
      INCLUDE mm_messages_mac.
      DATA: ls_mereqitems        TYPE MMPUR_REQUISITION_ITEMS,
            ls_mereqitem         TYPE MMPUR_REQUISITION_ITEM,
            l_mereqitem          TYPE mereq_item,
            l_msgty              TYPE sy-msgty,
            l_msgno              TYPE t100c-msgnr.
    *-Get the item data
      ls_mereqitems = im_header->get_items( ).
    *-Get the configuration of the messages from T100S
      l_msgno = '173'.
    *-Check if the PR date is in the future
      LOOP at ls_mereqitems into ls_mereqitem.
        l_mereqitem = ls_mereqitem-item->get_data( ).
        CHECK     l_mereqitem-badat > sy-datlo
        AND   NOT l_msgno IS INITIAL.
        CALL FUNCTION 'READ_CUSTOMIZED_MESSAGE'
          EXPORTING
            i_arbgb = 'FICUSTOM'
            i_dtype = '-'
            i_msgnr = l_msgno
          IMPORTING
            e_msgty = l_msgty.
        IF 1 = 2.
          MESSAGE w173(ficustom). "WHEN POSTING
    *    MESSAGE w170(ficustom). "WHEN HOLDING
        ENDIF.
        IF NOT l_msgty = '-'.
          IF l_msgty = 'E'.
            ch_failed = ' '.
          ENDIF.
          sy-msgno = l_msgno.
          mmpur_message l_msgty 'FICUSTOM' sy-msgno
          l_mereqitem-bnfpo space space space.
        ENDIF.
      ENDLOOP.
    ENDMETHOD.
    Regards
      Uwe

  • Help Needed in badi ME_REQ_POSTED

    Hi all
    Actually i wanted to modify the release code IM_EBAN-FRGZU based on some conditions using BADI(ME_REQ_POSTED)
    But its not allowing me to do it..its saying IM_EBAN can't be modified...
    I tried ME590001 - EXIT_SAPLME59_001 aslo but its not stopping either in ME54 or ME55.
    Could you please give me the alternate solution to modify the release status while in the transaction?
    Thanks
    Govi

    Hi Govi,
    try this one:
    EXIT_SAPLMEPI_003                Customer Exit for Changing Purchase Requisition Data
    Regards,
    Clemens

  • Changing data captured via ME52N through BADI - ME_REQ_POSTED not working!

    Hi All,
    I am trying to change the 'Release Date' value everytime some data is changed on a purchase requisition via transaction ME52N.  I am using BADI 'ME_REQ_POSTED' via my own implementation of interface method 'IF_EX_ME_REQ_POSTED~POSTED'.
    Everything works and I can access all the data that I need except the fact that the standard variables with item data (i.e. 'IM_EBAN') cannot be changed and so I am forced to rather change table EBAN directly by using a 'MODIFY' statement after processing the data within the BAdi method.
    However when I check table EBAN via se16 I find that the field that I want to change (i.e. EBAN-FRGDT) does not change at all even though the transaction states that the document has been saved successfully and my BADI implementation has been executed in full.
    Therefore how can I ensure that the field is updated via this BADI or via a direct update within the BAdi implementation?
    Thanks.

    Hi,
    I have solved this one.
    Thanks.

  • Regarding the BADI ME_REQ_POSTED after saving the tcode ME51N

    Hi,
    Currenlty i am using the badi ME_REQ_POSTED to update the header texts in ME51N while creating the PR.
    I am getting the PR number through IM_EBAN.
    My issue is that i have written the code in the badi to pass the input of that PR number in table RSDBS to get the reservation number.
    But once the transaction ME51N got saved, then only the table RSDBS is getting updated with the generated PR number.
    Is there any way to get updates of the table RSDBS before the transaction got saved.
    Please let me know if my question is not clear.
    Thanks & Regards.
    Prabu

    Hi,
    I don't think this is possible functionally? To achieve this, you need to modify the std code.
    Regards,
    Raj

  • Exit/Badi in the transaction of production order create or change (CO02)

    hi all,
    I need an exit/Badi in the transaction of production order create or change (preferably during SAVE).
    I want to change structure AFVGD-usr02,AFVGD-usr03 .
    <b>PPCO0007 Exit when saving production order</b>
    the exit is not applicable EXIT_SAPLCOZV_001 .

    Hi
    we around 200 exit for this tcode i found only three badi for this tcode.
    AFABD_CHANGE          Change Relationship
    CAUFVD_CHANGE        BAdI: Overall Network Scheduling with Selection Option
    SIDAT_UPDATE            Change date of price simulation.
    check with this goto se18 and F4 thn give the Package as CO.enter u get this three.
    reward pointd if use full

  • User exit or badi for me52n transaction.

    Hi all,
           i have a requirement to write a user exit or badi for me52n transaction. the requirement is in header section, only one plant should be accepted. that is in the first row one plant will be inserted. in the second row if we are inserting another plant other the first row plant, it should not accept it and it should raise an error.
    that is from the second row onwards, every plant should match with the first row plant.
    if any part of this issue is unclear, plz let me know so that i can explain it clearly
    this is urgent requirement.
    please let me know the solution as soon as possible.
    points will be awarded.
    thanking u in advance.
    A.srinivas.

    In this version exit EXIT_SAPLMEREQ_005 should exists (look at OSS <a href="https://service.sap.com/sap/support/notes/843446">Note 843446 - MEREQ001: Cannot call up external service data in user exit</a> this note refers to the exit and is applicable in  4.70. Look also at OSS <a href="https://service.sap.com/sap/support/notes/310154">Note 310154 - ME21N/ME51N: Customer-specific check, generating error log</a>
    Regards

  • How to search for a BADI in a transaction

    Hi All,
    Please let me know the steps to find a BADI for a transaction.
    Thanks,
    Jaffer Ali.S

    check this.
    u can find BADI's in different ways...
    1>First go to any transaction->iN THE menu bar SYSTEM->STATUS->Get the program name ->double click->u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..
    2>Goto SE24->Give class name as CL_EXITHANDLER->Display->double click on get_instance mathod->Now u will go inside the method->Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..
    There are multiple ways of searching for BADI.
    • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
    • Finding BADI Using SQL Trace (TCODE-ST05).
    • Finding BADI Using Repository Information System (TCODE- SE84).
    1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.
    Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI’s will be listed.
    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
    2. Start transaction ST05 (Performance Analysis).
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    3. Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction VD02 for which you want to find BADI.
    Click on the Display push buttons.
    Get the Package Name. (Package VS in this case)
    Go to TCode: SE84->Enhancements->Business Add-inns->Definition
    Enter the Package Name and Execute.
    Here you get a list of all the Enhancement BADI’s for the given package MB.
    The simplese way for finding BADI is
    1. chooes Tcode Program & package for that Tcode.
    2. Go to Tcode se18
    3. Press F4
    4. search by package or by program.
    Regards
    Kiran Sure

  • BADI/Exit for transaction FB05/F-36

    Can anybody help me regarding exit/BADI for transaction FB05/F-36?
    I have tried exits in CMOD such as: F050S001 FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
    F050S002 FIDCC1: Change IDoc/do not send
    F050S003 FIDCC2: Change IDoc/do not send
    F050S004 FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
    F050S005 FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
    F050S006 FI Outgoing IDoc: Reset Clearing in FI Document
    F050S007 FIDCCH Outbound: Influence on IDoc for Document Change
    F180A001 Balance Sheet Adjustment
    FARC0002 Additional Checks for Archiving MM Vendor Master Data
    FEDI0001 Function exits for EDI in FI
    RFAVIS01 Customer Exit for Changing Payment Advice Segment Text
    RFEPOS00 Line item display: Checking of selection conditions
    RFKORIEX Automatic Correspondence
    SAPLF051 Workflow for FI (Pre-Capture, Release for Payment)
    But none of these seem to work.
    Can anybody tell me which BADI or Exit that I can use?

    To check for the suitable badi, Go to transaction SE24 and give the Object type as CL_EXITHANDLER and click on Display button.
    Double click on method GET_INSTANCE, put a break point on case statement.
    Execute your transaction and look for variable EXIT_NAME at your scenario then It will show the available badi's.
    You can find the exits in many ways.
    Get the developement class of the transaction code from SE93.
    Then go to transaction SMOD and press F4 and give the Development class in Press ENTER, then it will show all the exits available for that transaction.
    Or
    Go to transaction SE80 and give the development class name and then expand the enhancements tree view then you will get the list of userexits for that corresponding dev class.
    Reward if it is useful.
    Thanks,
    Srinivas

  • BADi called from transaction FB60

    Hi all
    I am looking for a BADi called from transaction FB60 in ECC 6.0. This is needed due to the fact we will develope a solution where we transfer the cost from an invoice booked to an intern order and transfer the cost and currency to CRM 7.0. Please if there is anybody who know a Badi that is triggered when the transaction FB60 is Saved, it will be very help full to us.
    Best Regards
    Camilla

    Hi,
    Re: Need user exit or BADI for FB60
    Best regards, Christian

  • User exit/Badi for MM41 transaction

    Hi guyz,
    Could you please tell me any User exit or badi for MM41 transaction, which will be triggered at the time of SAVE Article?
    Thanks,

    Hi guyz,
    Could you please tell me any User exit or badi for MM41 transaction, which will be triggered at the time of SAVE Article?
    Thanks,

  • User Exit / BADI for MEK1 transaction

    Hi All,
       Can anybody help me to know UserExit or BADI for the transaction MEK1?.
       Thanks
    Rgds,
    Sudhakar

    User Exits for the Tcode MEK1 are
    AMPL0001  User subscreen for additional data on AMPL
    LMEDR001  Enhancements to print program
    LMELA002  Adopt batch no. from shipping notification when posting
    LMELA010  Inbound shipping notification: Transfer item data from
    LMEQR001  User exit for source determination
    LMEXF001  Conditions in Purchasing Documents Without Invoice Rece
    LWSUS001  Individual customer source determination in Retail
    M06B0001  Role determination for purchase requisition release
    M06B0002  Changes to comm. structure for purchase requisition rel
    M06B0003  Number range and document number
    M06B0004  Number range and document number
    M06B0005  Changes to comm. structure for overall release of requi
    M06E0004  Changes to communication structure for release purch. d
    M06E0005  Role determination for release of purchasing documents
    ME590001  Grouping of requsitions for PO split in ME59
    MEETA001  Define schedule line type (backlog, immed. req., previe
    MEFLD004  Determine earliest delivery date f. check w. GR (only P
    MELAB001  Gen. forecast delivery schedules: Transfer schedule imp
    MEQUERY1  Enhancement to Document Overview ME21N/ME51N
    MEVME001  WE default quantity calc. and over/ underdelivery toler
    MM06E001  User exits for EDI inbound and outbound purchasing docu
    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 P
    MM06E008  Monitoring of contr. target value in case of release or
    MM06E009  Relevant texts for "Texts exist" indicator
    MM06E010  Field selection for vendor address
    MMAL0001  ALE source list distribution: Outbound processing
    MMAL0002  ALE source list distribution: Inbound processing
    MMAL0003  ALE purcasing info record distribution: Outbound proces
    MMAL0004  ALE purchasing info record distribution: Inbound proces
    MMDA0001  Default delivery addresses
    MMFAB001  User exit for generation of release order
    MRFLB001  Control Items for Contract Release Order
    Hope this helps

  • Exit or Badi for Migo transaction for given condition

    Hi,
    I need exit or Badi for MIGO transaction for the following condition ( When the goods receipt for the PO is initiated, prior to posting the accounting document).
    Please let me know
    Regards
    Ramesh

    Hi
    In rel 4.6C you can find these BADIs:
    - MB_DOCUMENT_BADI or MB_DOCUMENT_UPDATE
    and these exits: MBCF0002, MB_CF001
    Max

  • BADI in Billing Transaction (VF01)

    Dear All,
    I am new to BADIs Development. And I want to put a BADI in Billing Transaction VF01. My users want some extra fields for putting the data. So please guide me how can I do that.
    Regards,
    Vishal

    Hi vishal
    if u specify exact fields and requirements , i think more forum memebers can guide u.
    take help of technical consultant for finding out exact BADI  in applicable abap code u can use t.code SE17 and Se18 for the same.
    a generic info for you is from sap help check this if it helps
    Enhancement of Tables of Billing Document  
    Use
    For all components of the billing document there are customer includes that you can use to add your own fields without the need for modifications.
    Features
    All layers use the same customer includes. This means that, for example, when you include a field in the customer include of the document header, this field exists in the database layer, the logical layer, and the display layer. You cannot enhance the structures of the inbound interface of BAPI_ISTBILLDOC_CREATEMULTIPLE using customer includes. In accordance with the guidelines for programming BAPIs, you have to use the import table EXTENSIONIN to fill the fields in the customer include of the billing document.
    For technical reasons, there are two customer includes in the components of the billing document. One customer include is designed for fields of a character nature that can be transferred automatically. The transfer is supported by predefined BAPI table enhancements. If you use this predefined BAPI table enhancement when you fill table EXTENSIONIN, the fields in the customer include are provided with data automatically. You do not need a BAdI implementation. For more information, see the section  Customer Enhancement and Modification of BAPIs (CA-BFA) in the documentation for SAP NetWeaver under Cross-Services ® Further Development, Modifications, u2026 (CA-BFA).
    The predefined BAPI table enhancements also include the above-mentioned customer includes. The following table shows the names of the BAPI table enhancements and customer includes:
    Part     BAPI Table Enhancement     Customer Include
    Header     BAPI_TE_FKKINVBILL_H     CI_FKKINVBILL_H
    Items     BAPI_TE_FKKINVBILL_I     CI_FKKINVBILL_I
    Tax Items     BAPI_TE_FKKINVBILL_T     CI_FKKINVBILL_T
    Additional Items     BAPI_TE_FKKINVBILL_A     CI_FKKINVBILL_A
    A further customer include is designed for customer-defined fields that are not of a character nature or required for mapping. An example is additional currency fields. For these fields you have to implement a method of the BAdI ISTINV_BAPIBILL. The following table shows the names of the customer includes and the related methods that you have to implement for the transfer of the data:
    Part     BAdI Method     Customer Include
    Header     MAP_HEADER     CI_M_FKKINVBILL_H
    Items     MAP_ITEM     CI_M_FKKINVBILL_I          
    Tax Items     MAP_TAXITEM     CI_M_FKKINVBILL_T          
    Additional Items     MAP_ADDITEM     CI_M_FKKINVBILL_A
    The following figure shows how you can use the EXTENSION table to fill customer-defined fields:
           1.      The standard SAP fields are provided with data automatically. This means, for example, that the values of the structure HEADERS are transferred to the standard fields of the structure FKKINVBILL_H. Usually no BAdI implementation is required.
           2.      Use the customer include CI_FKKINVBILL_H for customer-defined character fields whose value is to be transferred from the interface to the billing document header unchanged. This include is also included in the BAPI table enhancement BAPI_TE_FKKINVBILL_H. Entries in table EXTENSIONIN that refer to this structure are processed automatically. A BAdI implementation is not required. However, we recommend BAdI implementation for checking. In the same way, you can add character fields to other parts of the billing document and provide them with data.
           3.      If you want to add a numerical field to the billing document header, you have to use the customer include CI_M_FKKINVBILL_H. Also define a BAPI table enhancement. We recommend that you only use character fields in the BAPI table enhancement. Implement method MAP_HEADER of the BAdI ISTINV_BILL. Use your BAPI table enhancement to identify the corresponding entries in table EXTENSIONIN in the method. Convert the character field from your BAPI table enhancement into the numerical field from the customer include CI_M_FKKINVBILL_H. In the same way, you can add numerical fields to other parts of the billing document and provide them with data.
           4.      You can also use the EXTENSIONIN table to provide a customer-defined table with values.
    Regards
    Mandar

  • BAPI / BADI for KE21N transaction

    Hi all,
    Please does anybody know a BAPI or BADI for KE21N transaction.
    I need to update some fields on it.
    Tks,
    Daniela

    Hi Daniela Machado,
    Try this for CO PA Planning data..
    BAPI_COPAPLANNING_GETDATA                            Read CO-PA Planning Data                                                  
    BAPI_COPAPLANNING_POSTDATA  
      Write CO-PA Planning data    
    Also try,
    BAPI_COPAQUERY_GETACC_ACTDATA 
    BAPI COPAQuery.GetAccountBasedActualData                                 
    BAPI_COPAQUERY_GETACC_PLANDATA
    BAPI COPAQuery.GetAccountBasedPlannningData                              
    BAPI_COPAQUERY_GETCOST_ACTDATA
    BAPI COPAQuery.GetCostingBasedActualData                                 
    BAPI_COPAQUERY_GETCOST_PLANDAT
    BAPI COPAQuery.GetCostingBasedPlanningData       
    Regards,
    Tanveer.
    <b>Please mark helpful answers    </b>

Maybe you are looking for