In Enhancement MEREQ001 - need to import Purchase Requisition Number

Hi ,
I need to import the Purchase Requisition Number and Item Number when the user enters T.code ME52N / ME53N
From that i need to fetch the data from the Table EBAN , for my Custom Screen which i added using Screen Exit.
My Question is in Exit MEREQ001 (CMOD) , which Function Module and field  i will use to import that PR Number and Item Field.
Prakash K

Which enhancement component of MEREQ001 is being used ? I could see most of the enhancement components (eg. EXIT_SAPLMEREQ_001) having the importing parameter IM_REQ_ITEM (type ref to IF_PURCHASE_REQUISITION_ITEM).  Extract the PR header data using the interface method IF_PURCHASE_REQUISITION_ITEM->GET_REQUISITION.  This method will return the structure RE_REQUISITION (type ref to IF_PURCHASE_REQUISITION).
Use the interface methods IF_PURCHASE_REQUISITION->GET_DATA (for header data) and IF_PURCHASE_REQUISITION->GET_ITEMS (for item data) for capturing required information.  If you are using the enhancement components which is having the importing parameter IM_REQ_HEADER ( type ref to IF_PURCHASE_REQUISTION, you can directly use the methods mentioned above.
Regards, Vinod

Similar Messages

  • Import Purchase Requisitions from one Operating Unit to a different Operati

    The need is to import Purchase Requisitions from one Operating Unit to a different Operating Unit.
    There are 2 operating unit with one inventory orgs in each. But the 1st is OU( It is a club) merely creates Purchase Requisition, and its not a advisable process to have a separate Purchasing process in that OU as it is too small ( but for financial reasons it has to be defined as a separate OU). So we want the Purchase Requisitions created in the 1st OU to be imported in the 2nd OU. Is there any way we can achieve this. Note: Since Order Management is not implemented we cant use the Internal customer setup and we wont like the PO to be created in the 1st OU as we do in standard Intercompany invoicing process.
    Any solutions/Pointers/workaround for this.

    As long as you have the same master org in the 2 operating units, all you have to do is
    INSERT INTO mtl_system_items_interface
                (organization_code, segment1, transaction_type, set_process_id, process_flag)
       (SELECT '&new_Org', msi.segment1, 'CREATE', 100, 1
          FROM mtl_system_items_b msi
         WHERE organization_id = &old)And run the Import Items request.
    Hope this helps,
    Sandeep Gandhi

  • BAPI_PO_CHANGE me22n add profit center for purchase requisition number

    Hello all,
    I have to add an item line for a specific sales order( p_vbeln ).
    for that i use BAPI_SALESORDER_CHANGE and it works and the item is inserted.
    ( p_posnr = sales order item and ln_etnr = schedule_line = 1 )
    Now I have to maintain the specific po item line and to insert the Profit Center related to the Purchase Requisition Number that was assigned to the above sales order item like using transaction ME22N.
    when i use the transaction all i have to do is to ADD the Purchase requisition number to the PO Order Number and to add the PROFIT CENTER.
    for this i use BAPI_PO_CHANGE.
    i colect the folowing data:
    from table VBFA( vbelv = sales order number vbeln = l_ebeln)
    PO Number = p_ebeln.
    from table VBEP ( vbeln = sales order number, posnr = the previously inserted sales order item )
    Purchase Requisition Number = l_banfn
    Purchase Requisition Item = l_bnfpo
    from table VBAP (vbeln = sales order number, posnr = the previously inserted sales order item )
    Profit Center = l_prctr
    from table EKKN
    select max(  ebelp )
    from ekkn
    into l_ebelp
    where ebeln = l_ebeln.
    add 10 to l_ebelp
    Purchase Order Item = l_ebelp .
    and i move the data:
      i_t_poitem-po_item = l_ebelp.
      i_t_poitem-preq_no = l_banfn.
      i_t_poitem-preq_item = l_bnfpo.
      i_t_poitem-acctasscat = cc_x.
      APPEND i_t_poitem.
      i_t_poitemx-po_item = l_ebelp.
      i_t_poitemx-po_itemx = cc_x.
      i_t_poitemx-preq_no = cc_x.
      i_t_poitemx-preq_item = cc_x.
      i_t_poitemx-acctasscat = cc_x.
      APPEND i_t_poitemx.
      i_t_poaccount-po_item = l_ebelp.
      i_t_poaccount-itm_number = p_posnr.
      i_t_poaccount-SCHED_LINE = ln_etnr.
      i_t_poaccount-profit_ctr = l_prctr.
      APPEND i_t_poaccount.
      i_t_poaccountx-po_item = l_ebelp.
      i_t_poaccountx-profit_ctr = cc_x.
      APPEND i_t_poaccountx.
    then i use the function BAPI_PO_CHANGE:
          purchaseorder                = p_ebeln
          testrun                          = l_test
         return                            = i_t_return_po
         poitem                          = i_t_poitem
         poitemx                        = i_t_poitemx
         poaccount                    = i_t_poaccount
         poaccountx                   = i_t_poaccountx.
    BUT i get the folowing result ( messages in return table)
    Insert item for PO-order                                                                               
    Message:  Changing of PO using Enjoy BAPI unsuccessful ;                                                
      Message:  Purchase order item 00120 still contains faulty account assignments ;   
      Message:  Enter Profit Center ;                         
    what should i do?
    best regards,

    i debugged the function.
    first the data from poaccount is copied in lt_account.
    then this happens:
      PERFORM get_current_data
          TABLES    poitem               poschedule               poaccount
                    pocondheader         pocond
                    poexpimpitem         allversions              popartner
                    potextheader         potextitem               return
                    l_po                 lf_header_currency
                    expheader            exppoexpimpheader.
      exppoexpimpheader = poexpimpheader. "foreign trade export workaround
    after this form is executed poaccount-profit_ctr is empty.
    lt_account-profit_ctr in not empty but then it is not anymore.
    in the form this happens:
    item data
      CALL METHOD im_po->get_items
          ex_items = lt_items.
      LOOP AT lt_items INTO an_item.
        l_item ?= an_item-model.
        CALL METHOD l_item->get_data
            ex_data = ls_mepoitem.
        ls_mepoitem-ebeln = ls_header-ebeln.
        APPEND ls_mepoitem TO lt_item.
        CALL METHOD l_item->get_po_accountings
            ex_accountings = lt_accountings.
        LOOP AT lt_accountings INTO an_item.
          l_accounting ?= an_item-model.
          CALL METHOD l_accounting->get_data
              ex_data = ls_mepoaccounting.
          ls_mepoaccounting-ebeln = ls_header-ebeln.
          APPEND ls_mepoaccounting TO lt_account.
    item conditions
    foreign trade (item data; EIPO)
    so it acctualy copies every item from purchase number ebeln in lt_item.
    for each one of them it copies the account data into lt_account.
    so the last loop is for the item that i want to enhance.
    here it copies all the necessary data in lt_account except of course the profit center because that's the one that i need to insert.
    after this loop there is a form:
      PERFORM move_account_out TABLES lt_account
                               USING  header_currency.
    where the ext_poaccount is the poaccount parameter.
    this form:
    clears ext_poaccount.
    copies the data from lt_account into ext_poaccount.
    and returns the ext_poaccount with the empty Profit center field
    and so after performing get_current_data my parameter is deleted.
    then it's almost the end of the function and nothing else related to the poaccount parameter.
    so it's no use for me to insert the field Profit_Center?
    is there another FM that i should use to be able to insert the profit center?
    what should i do?
    Best regards,

  • Restriction for purchase Requisition Number in ME21N

    Hi All,
    I want to raise an error message in ME21N, if the user creating PO without perchase rechase requisition number. For this i choosed one BADI.
    Definition Name: ME_PROCESS_PO_CUST
    Interface Name : IF_EX_ME_PROCESS_PO_CUST
    i have implemented the BADI  ZCHECK_PR
    I have written code like this in PROCESS_ITEM method
    DATA: ls_mepoitem TYPE mepoitem,
            ls_customer TYPE mepo_badi_exampl,
            ls_tbsg     TYPE tbsg.
      INCLUDE mm_messages_mac. "useful macros for message handling
    * here we check customers data
      ls_mepoitem = im_item->get_data( ).
    if ls_mepoitem-bstyp = 'ZV01'.
       if ls_mepoitem-banfn is INITIAL.
          message 'Enter Purchase Requisition Number' type 'E'.
    Saved & Activated  this.
    But while testing this in ME21N, it is not at all going to debug mode( I have created PO for ZV01 order type only).
    Is there any thing not finished for BADI?
    Can any one help me.
    Thank You.

    Very strange, just try deactivating and deleting your implementation and create a fresh one in the same client where you are testing and assign it to a transport request and check.
    Actually this BADI is already migrated to an Enhance spot in ECC 6 with same name 'ME_PROCESS_PO_CUST' but I still believe that SIMPLE badi implementation is still supported. OR Better do it with the latest way.
    Create an enhancement implementation of Enh spot ME_PROCESS_PO_CUST in SE19 and then for that Enh implementation, create a BADI implementation and an implementing class. Code the required thing in the implementing class methods and then check if it works. It's actually almost same way as implementing a simple BADI. If you need any help, search Forums or get back here.
    Pls note that Enh framework implementations are much faster than conventional BADIs and should always be used.

  • User Exit for ME52N with Purchase Requisition number & line item number

    Does anyone know which user exit I could use to get at the purchase requisition number and line item number when I am trying to change a PR.  I see various exits with im_req_item but when I code a popup in the include it is not appearing.  I am just not finding the right exit.

    You can use enhancement MEREQ001, function exit EXIT_SAPLMEREQ_005. This enhancement description gives impression that it can only be used if you have custom fields but it can be used even when you don't have custom fields.

  • Fetch Sales Order number VBELN from Purchase requisition number BANFN

    I'm not able to find a suitable method to fetch the sales order number(VBELN) from the purchase requisition number(BANFN).
    I tried using VBEP table to fetch the data, but it is giving serious performance issues, as in for fetching one record it is taking approx 20 seconds!!!
    Kindly suggest a suitable method for this.
    I've used the query as folllows:
    select single vbeln banfn
    from vbep
    into (wa_vbep-vbeln, wa_vbep-banfn)
    where banfn eq wa_eban_zdd1_x-banfn.
    where: wa_vbep is the workarea having two fields vbeln and banfn, and wa_eban_zdd1_x-banfn is the reference preq number.
    Scenario in brief described below:
    Whenever a direct delivery sales order is created on a supply chain plant, a dummy purchase requisition without source of supply is created automatically at preferred supplying plant for the customer in the sales order. Direct Delivery Sales Orders which are still in Open status and for the associated dummy purchase requisitions with these sales order, the deletion flag set has to be unchecked.
    in this case, only one sales order is created corresponding to a preq..
    BAPI: BAPI_PR_GETDETAIL is not giving entries for the table as this is a special case of direct delivery from the production plant directly to the customer, bypassing the warehouse / distribution center...
    selection screen has input fields preq, matnr(product) and plant. we fetch entries depending on the data filled in selection screen and also they should be of document type(BSART in EBAN table) ZDD1 and deletion indicator is set(LOEKZ in EBAN).
    then we check if the sales order corresponding to the preq is in open status...
    for this i need to programmatically fetch the sales order number corresponding to the preq...
    this is causing a performance issue as i could find only one way -- fetching sales order number from VBEP table corresponding to BANFN... indexing for easier also didnt work...
    no other way i could find to fetch sales order number corresponding to the preq number....
    there is a bapi: BAPI_PR_GETDETAIL, but this is not fetching entries to the changing tables related to sales order...
    also EBKN table doesnt have any entries as this is a special case of direct delivery preq..
    Guess i couldnt find anyother way...

    I'm not sure as to why the select query was still throwing performance issues. I could see that the index had been created on only BANFN in the DB. Prior to creating the index, it was taking approx 20 seconds per entry, but after creating the index, it took 13seconds approx.
    I used the select query as follows:
    select single vbeln banfn
    from vbep
    into (wa_vbep-vbeln, wa_vbep-banfn)
    where banfn eq wa_eban_zdd1_x-banfn.
    where: wa_vbep is the workarea having two fields vbeln and banfn, and wa_eban_zdd1_x-banfn is the reference preq number.
    I tried a few other combinations also, but  those also didnt work effectively:
    select vbeln banfn
    from vbep
    into (wa_vbep-vbeln, wa_vbep-banfn)
    where banfn eq wa_eban_zdd1_x-banfn.
    without using SINGLE in the select query as the select query would implicitly pickup only a single record,
    select vbeln banfn
    from vbep
    into wa_vbep
    where banfn eq wa_eban_zdd1_x-banfn.
    and another query where the INTO statement was directed directly to a workarea.
    But unfortunately, nothing seemed to be working.
    The index i had created was on BANFN alone in the VBEP table.

  • How to add a new line item to a Purchase Requisition number

    Hello All,
    Can anyone please provide me with some FM or BAPI to add a new line item to an existing Purchase Requisition number.
    Can it be done using BAPI_REQUISITION_CHANGE; if yes, then how do I pass the parameters into the BAPI tables..?
    Useful pointers would be appreciated...!!
    Thanks & Regards,
    Tarun Gambhir

    Thanks for the quick reply.
    I want to update the table EBAN, so should I use the parameter table XEBAN to put in the new line item and then execute..
    Also to fill up this table I need to pass certain value, so can I use BAPI_REQUISITON_GETDETAIL and pass the same details as found from the same BAPI and create a new line item...
    Tarun Gambhir

  • Number of PO with Purchase requisition number not null

    Hi Experts,
    I need to number of PO with Purchase requisition number not null in ECC
    T-CODE nse16n and table name =EKPO
    But when I make EKPO-BANFN not equal NULL it doesnt work ? how can do that ?
    I custom my data source 2LIS_02_SCL with EKET.BANFN I want to check my DS with ECC data .
    Thanks and best regards

    IF you need to check the number of PO's with Purchase requisition number not null then simply open the table EKPO in SE12, click on Contents and against the field BANFN right click on the empty box where you enter values and click on Options. From the pop up window selecte Not Equal to and check the Number of Entries in the table. You will get the desired result even though the volume of data might be large.

  • User Exit for Purchase Requisition Number Range

    Dear Experts,
    I searched on sdn, i got M06B0003 &M06B0004 this 2 user exit for PR Number range.
    I have activated both User exits but while creating PR is not getting effect of that user exit.
    I have checked by putting Break-point in respective user exit but while saving the PR it should go to that break-point but it not going there aslo.
    And also i have checked user exit MM06E003 but it is for Purchase Order number range.And for PO it is working.
    Please help me to solve this issue.Solution will be appreciated.

    Sorry that badi will not help try this one ...EXIT_SAPLMEREQ_009 in MEREQ001 where the export parameters is purchase requisition number....
    Shailaja Ainala.

  • Purchase requisition  number Range in MRP Run (MD02)

    Hi Experts ,
    When I run the MRP through T-Code MD02 even in test mode the Purchase requisition number getting consumed with out saving the entries.
    for eg:- number range = 100 to 200.
    when I execute the MD02 by selecting the indicator "Display results before they are saved " system showed a Purchase requisition number 100 and exit with out saving the entries.Next time when I execute the same MD02 system is displaying the purchase requisation number as 101, where as i have not used PR number 100 at all.
    Please guide me....

    Nothing is missing.  This is standard behavior.  It appears to me that SAP makes no effort to ensure that all Purchase request numbers are contiguous.
    You can try turning off number range buffering.  This will reduce the number of gaps in your purchase req number sequences.  However, I don't know if it will eliminate all gaps.  Be aware that there is a performance tradeoff when you deactivate buffering.  Making this change is considered to be a system modification, and is not supported by SAP.

  • Purchase Requisition number (current number) not seen correctly in OMI2

    Hi All,
    I see purchase requisition number created for the last number in the number range defined for Purchase Req., but i do not see the last number in the "current number" area. What are the possible reason for this ?
    Edited by: PSS on May 26, 2011 7:47 PM

    This is not usually considered to be a problem.  Are you using number range buffering?
    Best Regards,

  • Purchase Requisition number not changing when sales order item is rejected

    Hi all,
    I have a requirement to change the sales order status to 'TECO' when ever some reason for rejection is selected in the status tab at the item level.The status should change from 'TECO' when i remove the reason for rejection.
    The status change is happening correctly.I have achieved it using user exit.
    CASE 1 : Initially, when a new item is added in the Sales order the purchase requisition number appears in the schedule lines tab of the item level. This is as expected.
    CASE 2 :When the same item is blocked (by entering a reason for rejection in status tab of VA02 ) then the purchase requisition number is not present in the schedule lines tab.This is as expected.
    But i face the following issue.
    CASE3 : Again if the blocked item is unblocked (By removing the reason for rejection in status tab of VA02 ) then the purchase requisition number does not appear again in the schedule lines tab.The purchase requisition number is expected to appear again.
    This happens in case of DROP SHIPMENT scenario. I understand that in case of dropshipment scenario the purchase requisition number is triggered by item category and schedule lines only.
    I tried to make the changes(to change the status ) in user exits 'MV45AFZZ' and also 'MV45AFZB'.But i face the issue in both the exits.Please let me know if there are any means to solve this issue(as mentioned in case 3).

    Many thanks for your answer. It help me to solve the issue.
    So applying note 738171, with transaction OVB5 (or VOFM, requirements->subsequent functions->Purch.requisitions) we create one new requirement, ie RV07A900, and then we apply the rule that if we have delivery or billing block, that is, VBAK-LIFSK or VBAK-FAKSK not empty, then we set an error with a code similar to this:
                da_sy-msgid = 'Z1'.    (message class)
                da_sy-msgno = '001'.  (message number)
                error_exception = true.
    and then the PR is not created.

  • Import Purchase Requisition

    Hi All,
    I've run the Min-max planning report and Requisition Import report. The import result is
    Number of approved requisitions created = 1
    Number of unapproved requisitions created = 0
    Number of interface lines in error = 0
    I cannot see any requisition in Requisition Summary. After trying to run the import again, the result was:
    No requisitions were created
    Number of interface lines in error = 0
    Do you have any idea where the requisition is blocked?
    Thanks a lot,

    How you are running these reports. Are these issue related with OA Framework?
    Explain this issue.

  • Need to reset Purchase Requisition

    Dear All,
    I am new to Oracle EBS i just want to know the script which can reset the WorkFlow for Purchase Requisition.
    I am know about the Purchase Order script which can reset the WorkFlow poxrespo.sql.

    See if these can help
    Troubleshooting for Requisitions / Purchase Orders in Process or Pre-Approved Status [Document 225017.1]
    How to Diagnose Purchasing Document Approval Routing [Document 603232.1]
    All Purchase Orders or Requisitions Getting Stuck in Pre-Approved or In Process Status - Troubleshooting Checklist [Document 1104843.1]

  • Problem in Purchase Requisition Number Range (Skipping)

    While creating the Purchase Requisition, the PR Number is skipping by 10, for example, first PR is 10000000, send is 10000010 and so on.. on the Quality Server
    The same is OK in Development Server. Pls. note that I have used the Standard Number Range.
    Pls. guide.

    To add on Arun's answer. The setting in trs SNRO is client independent. You should press the "display" button there (the glasses) and check the field "No. of numbers in buffer". The standard SAP setting is 10 and changing this setting is a modification to standard.
    The scenario is as follows. Each time your application server needs to allocate new number to a PReq it contacts the database server, which keeps track of the number range. Even if your system (Q) is a single server system, the principle is still the same.
    The point is that the application server doesn't take one next number from the database server, but 10 numbers. Next time it needs to allocate new number to a PReq, it doesn't have to call the DB server again - it merely takes the next number from the "bundle" it already got. The reason is to save time.
    This works fine as long as the application server is up and running all the time - no "holes" are generated. It can however happen that the application server "forgets" the buffer, e.g. when the server is taken down (this is however not the only way). In this case, all the numbers it got from the DB server get lost and the application server takes out new ten.
    As I mentioned above, this function is impossible to change without modification to SAP standard. Please consider well your business need to have the consequent numbers. Most of the companies manage with this setting.

Maybe you are looking for

  • Download to mini fails

    Just installed my new mini and as soon as I connect it to my machine it starts downloading the songs from itunes to the mini. After 2 or 3 songs an error message occurs saying that an unknown error occurred (-36) and download has been stopped. Anyone

  • Exporting Emails with Photoshop Elements 10

    I have been attempting to resolve this issue for two weeks with no resolve.  I set up an email system with the wizard, and I receive the following error message:Connection to server has failed Acct. "' Server '', Protocol: SMTP,

  • Itunes internet connection error

    When I try to install ITunes, an error pops up saying, "We're unable to connect to the download server. It seems that you internet connection is down or firewalled." I checked my internet, and its fine. This usually happens with every program I try t

  • Photos - can't transfer them into iphoto.

    I recently lost all the contents of OSX. I purchased iPod Photo Liberator to transfer my photos from my iPod photo and the photos are back on my HD - but I can transfer them into iphoto - it won't let me. Any ideas?

  • No streaming from iTunes to my ATV

    All was well until I "upgraded" to Lion AND the latest iTunes update, now there is no streaming from itunes to my ATV. Any ideas? Thanks FR