Purchase Requistion (ME51N) : BADI ME_REQ_POSTED

Hi,
        I have used ME_REQ_POSTED-post(Method) Badi to check custom consistency in ME51N. If there is any error the badi throws the Message and returns to t-code : using leave to transaction  sy-tcode which is working fine, but the problem is that even the creation of the PR is manually stopped the PR number is generated and not saved(say: 8000012). Next time when I am creating a new PR with the same consisentcy check and if it gets through a new  number is generated with (say 8000013) but not with (8000012).If this case araises there will be problem with number range allocation each and every time they get exhausted?
Kindly post the solution if any one has ever faced.....
Thanks in advance for the help.
with regards,
krishna Mukthineni.

Hello Krishna
Most likely you are not using the correct BAdI. As the name implies (ME_REQ_POSTED) we have passed the last checkpoints already. The method IF_EX_ME_REQ_POSTED~POSTED is not intended to block the posting since it does not contain any exceptions.
I assume that BAdI ME_PROCESS_REQ_CUST is the one you should implement. Its interface method CHECK ( Closing Check ) allows you to block saving the purchase requisition. If you set its CHANGING parameter CH_FAILED = 'X' then saving should not be possible.
Regards
  Uwe

Similar Messages

  • Triggering an IDOC on Purchase Requistion creation

    I would like to trigger an IDOC upon purchase requistion create.   I seem to see only an idoc to create Purchase Reqs into SAP(inbound), nothing outbound.
    Basically, I want when a purchase req is created in SAP to trigger an IDOC.  I would then pick up that idoc to trigger an external business process flow.
    Thanks

    Hi
    Can you please elaborate on what business process you want to trigger??
    There is a way to trigger the follow-on processing for the purchase requisition using BADI ME_REQ_POSTED.
    Regards
    Prasad

  • Regarding Valuation tab in the Purchase requistion

    Sapgurus,
    i would like to omit the valuation tab in the Purchase requistion(ME51N) so that i dont want to display any value of the material  while creating the document.
    Please i need solution from your side.
    Thanking you
    Praveer

    hiding the field may be a solution if you always create requisitions with material masters, but in general you can create PRs without material master. In that case the user has to specify the price, which is not possible if the field is hidden. In other words, if you want to work with  release strategy at any time in future, then you just cannot, as you you dont have a price for PRs that have no material number.

  • 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

  • User Exit -- To include purchase requistion/purchase order in COOIS report

    In a MTO envirnoment, trying to include purchase requistion/purchase order
    with requested delivery date information in COOIS report. Is there a
    user exit for this ?

    Hi,
    Please follow this an Example:-
    The COOIS report (Order Info System) gives the complete information regarding Production Order like header report, Operation report, Component Report, document report. 
    This document deals with the addition of extra fields in the output display of COOIS. 
    For the demo purpose, I have added the material group (MATKL) for the production order material for header report. 
    BADI Name: WORKORDER_INFOSYSTEM
    Method: TABLES_MODIFY_LAY 
    In the method TABLES_MODIFY_LAY there are many table parameters for different data display of the production order .In this scenario only the header detail structure is being extended with append structure. 
    Add the extra fields to be displayed to through append structure to IOHEADER_TAB, here MATKL. 
    In the method write the code for updating the field value. 
    DATA : BEGIN OF st_matkl,
               matkl TYPE matkl,
               END OF st_matkl.
      DATA : st_header TYPE ioheader.
      LOOP AT ct_ioheader INTO st_header.
        IF NOT st_header IS INITIAL.
          SELECT SINGLE  matkl
                 FROM mara
                 INTO st_matkl
                 WHERE matnr = st_header-matnr.
        ENDIF.
        st_header-matkl = st_matkl-matkl.
        MODIFY ct_ioheader FROM st_header.
      ENDLOOP.
    Regards,
    Ravi

  • 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

  • How to change the Purchase Organization filed in the Purchase requistion..

    Hello All,
    I am creating the requirement of material through MD62. Later I am runiing MRP through MDO3 to create the purchase requistion against that. Now my requirement is that if the source list is not maintainted ( ME01) for that material, I want to change the purchase organization field for the puchasre requistion created through MD03.
    Can any one help me how can  I changed that though programming. Any user exit or badi for that .
    Note* : I am working in SAP 4.6 system.
    Thanks and Regards,

    Hi, Umesh:
         Picture1 is  my OPJP initial screen ,I want to change to be Picture B . but I got an error .
         In fact , I  don't have project stock . but I have sales order stock.
         I try to change 'Q' to other option . but I got the same error.
    picture 1
    picture 2

  • I want to make Requistioner field Mandatory in the Purchase requistion.

    Whenever i create purchase requistion i want to make  Requistioner field mandatory. I have checked the filed selection NBB and changed to mandatory and ME51 also  made mandatory after that also whenever i create with ME51 PR is going to next screen without asking for requistioner.
    Please let me know where actullay i have to make mandatory so that whenever i create it should ask the requistioner.
    Thanks.

    H,
    You also select the field Requisitioner as mandatory for below field selection>
    AKTH,ME51 & ME51N
    Because always the field selection: mandatoey , display & optional    will work in
    Setting Priority
        Hide 1
        Display 2
        Required entry 3
        Optional entry 4
    SAM
    Edited by: Saminathan Gopalan on Jun 22, 2010 3:25 PM

  • Purchase requistion TABLE

    Hi I am trying to create a purchase order through ME51N. Now i want to relase this purchse order through a bdc for the treansaction ME54N. When i tried to do a BDC, it not working. now how will i release the PR,? Can I relase the PR by forcing the values in the batabase table? if so, then what are the tables that stores all the release status for a Purchase requistion.
    Plz answer its very urgent.

    Please check for Exit
    Transaction Code - ME51N                    Create Purchase Requisition
    Exit Name           Description
    MEREQ001            Customers' Own Data in Purchase Requisition
    No of Exits:          1
    Transaction Code - ME54N                    Release Purchase Requisition
    Exit Name           Description
    MEREQ001            Customers' Own Data in Purchase Requisition
    No of Exits:          1
    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.sap-img.com/ab038.htm
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
    Rewards if useful.........
    Minal

  • 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.

  • Default Purchasing group in Purchase Requistion

    Hi,
    I need to default the purchasing group in the purchase requistion item. I found a BADI ME_PROCESS_REQ
    but this is internal use only for sap.
    Regards.
    Khusro Habib

    Hi,
      is it that u have to hardcode the value of purchase org in the item. i mean is it always the same value you have to pass....
    Madhavi

  • 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

  • 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

  • Error while Creating PO from Purchase Requistion in Third Party  Sales

    Dear Team,
                          While Creating the Purchase Order from Purchase Requistion in Third Party Sales. When I am saving the PO I am getting the Error in GL Account Cannot be Used. I have disabled the field G/L Account in settings of Account Assignment Category of Third Party. Still I am facing that Error while Creating Purchase Order.  Can you guide me where we do this Assignment of G/L Account so that I can change the G/L Account.
    Thanks,
    Farhan.

    Dear Farhan,
    1. Go to T. Code: FS00 and enter GL number and Company Code and go to Tab: Create/bank/interest, write down the field status group.
    2. Go to T. Code: OBC4 and Select your Field Status Variant and Double Click: Field Status Group (From Left-hand Dialog Structure)
    Double-Click on to Field Status Group (as noted down from in Step 1).
    From Select group, Select Additional account assignments and make Earmarked Funds, as optional.
    Best Regards,
    Amit

  • Error in vendor selection while creating Purchase requistions

    Hi,
    I was using bapi_requestion_create to create purchase requistion with different quotas for different vendors.
    Ex: vendor A   with 60%
          vendor B   with 40%
    If the required quantity is 100 items then it has to split 60 items to vendor A and create seperate Puechase Requistion.
    and for 40items with another Purchase requsition.
    Currently iam able to split the noof purshcase requisiton but it was picking only with one vendor.
    MY Code :
    *******Split PRs with respect to Quota ************************
          data : lv_lines type i,
                 lv_qty type  p DECIMALS 4.
          lv_qty = it_oo-qty.
          DESCRIBE TABLE t_equp LINES lv_lines.
          IF lv_lines GT 1.
            clear : w_equp.
            loop at t_equp into w_equp
                          where qunum = w_equk-qunum.
              refresh : t_req_item.
              clear   : w_eord,
                        t_req_item[],
                        t_req_item.
              READ TABLE t_eord INTO w_eord
              WITH KEY matnr = it_oo_sum_purch-matnr_sap
                       werks = it_oo_sum_purch-plant
                       lifnr = w_equp-lifnr.
              if sy-subrc is initial.
                it_oo_purch-AGREE     = w_eord-EBELN. "To Fill ALV
                it_oo_purch-ITEM      = w_eord-EBELP. "To Fill ALV
                it_oo_purch-FORNEC    = w_equp-LIFNR. "To Fill ALV
                t_req_item-doc_type   = c_zbmr.
                t_req_item-pur_group  = it_oo-ekgrp.
                t_req_item-material   = it_oo_sum_purch-matnr_sap.
                t_req_item-plant      = it_oo_sum_purch-plant.
              t_req_item-AGREEMENT   = w_eord-EBELN.
              t_req_item-AGMT_ITEM   = w_eord-EBELP.
              t_req_item-FIXED_VEND  = w_equp-LIFNR.
              t_req_item-QUOTA_ARR   = w_equk-qunum.
              t_req_item-QUOTARRITM  = w_equp-qupos.
                t_req_item-gr_ind     = c_x.
                t_req_item-ir_ind     = c_x.
              t_req_item-MRP_CONTR   = 'NOV'.
                CONCATENATE it_oo_sum_purch-due_dte+4(4)
                            it_oo_sum_purch-due_dte+2(2)
                            it_oo_sum_purch-due_dte(2)
                            INTO t_req_item-deliv_date.
                t_req_item-QUANTITY   = ( w_equp-QUOTE / 100 ) * lv_QTY.
              endif.
    ********Rounding off values*******************
              data : lv_int(20) type c,
                     lv_dec(20) type c,
                     lv_tot(20) type c.
              clear : lv_int ,
                     lv_dec,
                     lv_tot.
              lv_tot = t_req_item-QUANTITY.
              split lv_tot at '.' into lv_int lv_dec.
              if lv_dec(1) ge '5'.
                lv_int = lv_int + 1.
              endif.
              t_req_item-QUANTITY = lv_int.
              APPEND t_req_item.
              clear : v_number.
      Create purchase requisition by group
              CALL FUNCTION 'BAPI_REQUISITION_CREATE'
                   IMPORTING
                        number            = v_number
                   TABLES
                        requisition_items = t_req_item
                        return            = t_return.
    ERRO
              IF t_return-type CO 'AE'.
                CLEAR: v_msg, v_x.
                CALL FUNCTION 'WRITE_MESSAGE'
                     EXPORTING
                          msgid = sy-msgid
                          msgno = sy-msgno
                          msgty = sy-msgty
                          msgv1 = sy-msgv1
                          msgv2 = sy-msgv2
                          msgv3 = sy-msgv3
                          msgv4 = sy-msgv4
                     IMPORTING
                          messg = v_msg.
                PERFORM zf_grava_log_erro_oo
                              USING it_oo_purch it_oo_sum_purch v_msg v_x.
    SUCESSO - Atualiza Tabela zsytmm_pr_po
              ELSE.
                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                     EXPORTING
                          WAIT = c_X.
                CLEAR: v_msg, v_x.
                CONCATENATE text-026  v_number INTO v_msg
                                      SEPARATED BY space.
                it_oo_sum_purch-QTY =    t_req_item-QUANTITY.
                PERFORM zf_grava_log_sucesso_oo
                          USING it_oo_purch it_oo_sum_purch v_msg v_x.
                CLEAR: zsytmm_pr_po.
                vl_item = c_00001.
                zsytmm_pr_po-banfn    = v_number.
                zsytmm_pr_po-bnfpo    = vl_item.
                zsytmm_pr_po-ebeln    = c_false.
                zsytmm_pr_po-ebelp    = c_false.
                zsytmm_pr_po-zshmode  = it_oo_purch-shipm.
                MODIFY  zsytmm_pr_po.
              ENDIF.
            endloop.

    Hi,
    You have to fill DES_VENDOR & FIXED_VEND of structure REQUISITION_ITEMS while calling BAPI.  But while going through your code,
    * t_req_item-FIXED_VEND = w_equp-LIFNR
    is commented, uncomment the same and add line for DES_VENDOR also.
    Regards
    Vinod

Maybe you are looking for

  • Users cannot connect to shares or sync Exchange via company wifi

    Hello, I am posting this because my users can connect to the company wifi (guest and private) with no problem.  They can use the internet, but nobody can reach network shares, nor can they setup or sync Exchange email via the wifi.  Currently, anybod

  • LR3 can't find files after copying my previous hard drive to a new Lacie Thunderbolt drive

    I transferred my LR3 files from my WD hard drive to my new Lacie Thunderbolt drive and now I can only get the preview and it says the file is missing.  Is there a setting I need to change that I am not aware of?

  • IPhone 4 Resolution

    Hello, i just finished building a new app i have been working on for months, its targeted towards the 3Gs resolution, any sources or anybody know how this will be handled? Du i have to redesign it? When will the SDK have handling for that? Do i need

  • Regd Integrated ITS passing parameter

    Hi , We are using Integrated ITS 6.40 . SAP Basis support pack is 18. We are facing difficulty in passing parameters from Portal IAC iView through application parameter property to ITS 6.40. I have given the screenfield name in the application parame

  • Errors trying to print to previously working printer  - console sys PPD bad

    Printing worked fine until today. Now even trying to do a print preview gets an error dialog and logs these errors to the console: 2007-03-19 10:35:43.528 Safari[336] InkChecker could not get ppd for HPColor_LaserJet2600n 2007-03-19 10:35:47.746 Safa