Purchase Requisition - Validate Cost Center

Hi,
I need to check the data when creating a Purchase Requisition with reference to an existing Purchase Requisition. Currently, I am using the user exit EXIT_SAPLMEREQ_005 to carry out these checks.
One of the checks that I need to do is to validate Cost Center. However, in this user exit, there is no cost center found in any of the imported parameters. Hence, I tried to use the function module 'COBL_RECEIVE'. However, the Cost Center retrieved is not refreshed and is incorrect. Are there any other ways where I can retrieve the correct Cost Center that is populated from the reference Purchase Requisition?
Will appreciate any help in resolving this issue.
Thanks lots.
Cheers,
Liyan

Hi
use the BADI in SE18 Tcode
ME_REQ_POSTED
implement this and use
the Method POSTED has the parameter IM_EBKN which has KOSTL field
this will work
see the sample code for this BADI
BAdI Name: ZPUR_RFQ (Implementation name) Purchase Requisitions
Definition Name: ME_REQ_POSTED
Interface Name : IF_EX_ME_REQ_POSTED
Implementing Class: ZCL_IM_PUR_REQ
Method :            POSTED
METHOD if_ex_me_req_posted~posted .
  TYPE-POOLS: pgrt.
  DATA: t_txpdat TYPE STANDARD TABLE OF txpdat.
  DATA: s_txpdat TYPE txpdat.
  DATA: t_ident  TYPE pgrt_t_obj_ident.
  DATA: s_ident  TYPE pgrt_obj_ident.
  DATA: ident_tmp TYPE eketkey.
  DATA: nmrid_init TYPE txpdat-nmrid.
  DATA t_obj_event TYPE pgrt_t_obj_event.
  DATA s_obj_event TYPE pgrt_obj_event.
  DATA t_event     TYPE pgrt_t_event.
  DATA s_event     TYPE pgrt_event.
  DATA change_yes  TYPE c.
    IF l_s_eban-estkz NE 'B'.
      CLEAR v_mtart.
      SELECT SINGLE  mtart INTO v_mtart FROM mara WHERE matnr = l_s_eban-matnr.
      IF v_mtart EQ 'ZERS' OR v_mtart EQ 'FHMI' OR v_mtart EQ 'UNBW'.
        MESSAGE e000(zm_msg) WITH 'You are not allowed' 'to create PR for stock items'.
      ENDIF.
    ENDIF.
    IF  l_s_eban-knttp NE 'F' OR l_s_eban-pstyp NE '9'.
      IF l_s_eban-knttp NE 'A'.
        IF ( l_s_eban-pstyp NE '9' AND l_s_eban-pstyp NE 'D' )  AND l_s_eban-matnr EQ space.
          MESSAGE e000(zm_msg) WITH 'You cannot create' 'a PR without material number'.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDMETHOD.
reward points if useful
regards
Anji

Similar Messages

  • Purchase requisition and cost center authorization check

    Hi all,
    in a R/3 4.7, I need to check the cost center (or profit center) when managing (create/modify/view) purchase requisitions.
    I have not found any auths object which perform this check.
    Any idea ?
    A BADI seems to be he only solution, inserting an authorizaton check.
    Thanks
    Andrea

    Hi
    use the BADI in SE18 Tcode
    ME_REQ_POSTED
    implement this and use
    the Method POSTED has the parameter IM_EBKN which has KOSTL field
    this will work
    see the sample code for this BADI
    BAdI Name: ZPUR_RFQ (Implementation name) Purchase Requisitions
    Definition Name: ME_REQ_POSTED
    Interface Name : IF_EX_ME_REQ_POSTED
    Implementing Class: ZCL_IM_PUR_REQ
    Method :            POSTED
    METHOD if_ex_me_req_posted~posted .
      TYPE-POOLS: pgrt.
      DATA: t_txpdat TYPE STANDARD TABLE OF txpdat.
      DATA: s_txpdat TYPE txpdat.
      DATA: t_ident  TYPE pgrt_t_obj_ident.
      DATA: s_ident  TYPE pgrt_obj_ident.
      DATA: ident_tmp TYPE eketkey.
      DATA: nmrid_init TYPE txpdat-nmrid.
      DATA t_obj_event TYPE pgrt_t_obj_event.
      DATA s_obj_event TYPE pgrt_obj_event.
      DATA t_event     TYPE pgrt_t_event.
      DATA s_event     TYPE pgrt_event.
      DATA change_yes  TYPE c.
        IF l_s_eban-estkz NE 'B'.
          CLEAR v_mtart.
          SELECT SINGLE  mtart INTO v_mtart FROM mara WHERE matnr = l_s_eban-matnr.
          IF v_mtart EQ 'ZERS' OR v_mtart EQ 'FHMI' OR v_mtart EQ 'UNBW'.
            MESSAGE e000(zm_msg) WITH 'You are not allowed' 'to create PR for stock items'.
          ENDIF.
        ENDIF.
        IF  l_s_eban-knttp NE 'F' OR l_s_eban-pstyp NE '9'.
          IF l_s_eban-knttp NE 'A'.
            IF ( l_s_eban-pstyp NE '9' AND l_s_eban-pstyp NE 'D' )  AND l_s_eban-matnr EQ space.
              MESSAGE e000(zm_msg) WITH 'You cannot create' 'a PR without material number'.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDMETHOD.
    reward points if useful
    regards
    Anji

  • Create Purchase Order to cost center

    Hi,
    Will it be possible to create a purchase requisition from the MRP run which has account assignment K and default a cost center.
    At the moment I need manually to update the requisition item line with 'k' and costcenter before converting to a purchase order.
    br,
    Anders

    The purpose of MRP run is to make sure that you always have enough stock.
    An order to cost center will not increase stock.
    Means: MRP is not able to create requisitions for cost center consumption. If you change a requisition created by MRP to be ordered to a cost center, then the next MRP run will create a new requisition to stock.

  • Is there is a way to have a link from purchase order to cost center report.

    Is there is a way to have a link from purchase order to cost center report.
    I am meaning kind of:
    Standard way to customized this link?
    or
    User exit to have this link in place
    or
    Any other solution
    Thanks

    For me it does not make any sense from going from PO to cost center report.
    However, if you want to see the purchase order cost incurred with a cost center, execute KSB1 report. Within the layout, bring "Purchasing Document" field, where you can see the purchase order number in cost center line item report.

  • How to change purchase order's cost center in batch

    Dear all :
    how to change purchase order's cost center in batch?

    Dear Manish :
    thanks so much for you reply.
    the filed which i wanted to change it's content is cost center (KOSTL) in table EKKN.
    i couldn't find it in this t-code when i select fields.

  • Purchase order with cost center

    I have 1 purchase order raised against cost center. for which gr, iv & payment  also done but. client want to return part of the goods.
    What can be the best process to do this.
    Thanks,
    Kiran

    Hi,
    Talk to  your business team, what  is real requirement now and also consult with FI/CO team
    As payment done, you can go for creating a Return PO and then do  GR with 161 movement type( if excise,do J1IS for to reverse excise and then print with J1IV) and finally go for credit memo in MIRO.
    OR 
    Considering  payment done to vendor as wrongly/ by mistake,so 1st check accounting document number for which vendor (with account number) in t.code:FBL1N & then reverse it with t.code: F-02 and finally clear it with t.code: F-44.Reverse all GR and MIRO document.
    Regards,
    Biju K

  • Purchase Order For Cost Center

    Hi,
    1. Please explain as I am trying to create a PO and i gave Account type: K(Cost center). I got the following error
    "Create Account 140000 as a cost element in controlling area 4000 "
    How can i solve this problem. I actually created a cost center : 4000. How to assign a cost element to controlling area.
    2.Is it Necessary to maintain the G/L A/c while procuring for Cost center??
    Or Cost Center is Sufficient ??

    HI Kapil,
    For any accounting entry you need to define a General Ledger Account where the details (Amount) of the transaction will be stored.
    Just by maintaining cost centre will not help in completing any transaction involving accounts. So you need to  maintain G/L account in the controlling area of your company code.
    You can use T Code FS00 to create new G/L account in the chart of accounts.
    In the edit cost element Tab you can give the cost center that you want.
    I hope this helps.
    thanks
    rahul goel

  • Validate cost center in settlement rule while creating WO in IW31

    Hi All,
    I have a requirement to check whether the cost centers in settlement tab is blocked or not. If it is blocked need to give an error.
    Is it possible to implement this using an user exit?..
    Thanks,
    Spandana

    Hi Chetan,
    I agree with you that when PR is created thro repair order the A/C assignment category will be 'F',I am not concerned about that and its a SAP std.I am concerned about the automatic cost center population on the PR created from that order.I'll explain you in detail - It goes like this, We are creating a Service Order in IW31for a material X and this material goes sequentialy in operation which it requires, it depends on the control key SM01 whether the operation is to be processed internally or externally,So when it goes for external processing for which the key SM02 is configured and while saving this order a PR is created from this order and as you said this this PR will have A/c assignment category 'F' and its relevant G/L a/c and the order in it.So if you check the cost center field which is in between this G/L a/c and the order it will not appear as it has to be entered manually.So i need this to be automatically determined.
    Hope this clarifies.
    Thx
    Benny

  • MM Open Purchase Order by Cost Center

    Does anyone knows of a report that can give me Open Purchase orders Orders by Cost Centers?
    Thanks for your help

    hi,
    Here is your solution:
    Check table EKBE..in SE16....
    Here AccoutAssigned field is ZEEKN which shows the PO for account assignment...
    Now for that PO see the Field ELIKZ ...if its ticked then its open PO....
    hope it helps...
    Regards
    Priyanka.P

  • Disable or Validate Order or Cost center in MIGO for Mvmt type 201/261

    Hi All,
    I want to disable or validate 'Order' field in MIGO for the goods issue if the movement type is 201.
    I want to disable or validate  'Cost Center' field in MIGO for the goods issue if the movement type is 261.
    User do not want 'Order' field in MIGO for movement type 201 & User do not want 'Cost centre' field in MIGO for movement type 261.
    Thanks
    Pabi

    Hi
    go to OMJJ
    here select move type and then give move type 201
    now select 201 and click on Field selection (ENJOY)
    now just remove the order field from here
    similarly do for 261 movememt
    this will affect to whole client

  • Blocking certain cost center in MIGO/MB1A

    Experts-
    We have one cost center defined specially for transactions going through MM interface. We are using 201/202/161/101/122 movement types in interface.
    We donu2019t want this Cost center to be used for goods issue in MB1A, MIGO etc.
    Are there any u2018user exitsu2019 available to validate cost center in these transaction. Say: If transaction is MIGO/MB1A and cost center is u2018XXXXu2019 donu2019t post transaction and give error.
    Thanks for your help-

    Hi,
    As of my knowledge there is no possibility to do in MIGO.
    Validation & Substitution can only be used in your case.
    I have another solution but i am not sure whether we use.
    Go to Spro-Mat. Mgmt->Inv. Mgmt & Phy. Inv-> Goods Issue / Trf. mat ->Select Set Manual account ssignment
    Make the field Account assignment Supressed for particular Mov type. ( inyour case 201).
    Please let me know if any of my words are wrong.
    Reg,
    Ashok

  • Purchase Requisition Authorization based on Storage Location

    Hi MM Gurus,
    Our client has got a specific requirement to control the security of purchase requsition creation, change and release based on the storage locations. We have found the authorization object M_BANF_LGO which is to restrict the access of PR based on storage location in purchase requsitions.
    The issue is the purchase requsition BAPI does not check this authorization object as per standard SAP.
    Does anyone know how to handle the security of purchase requsition based on storage location?
    FYI - Our PR release strategy is at item level and not at document level.
    Thanks,
    Shekhar

    Thank you for the reply. In case of purchase requsition for cost center, you can still enter the value of storage location. The storage location comes into picture when the goods receipts are posted against this purchase. However, the storage location value can be entered at PR level.
    We have storage location field as "Required" field in all purchase requsitions as there is only one plant and each storage location represents the division.

  • Standard BW Report for Purchase Requisitions

    Hi All,
    My client is looking for some requisition based report (besides the standard SAP MM reports). Are there any BW reports that will provide details on say, requisitions per cost cent, materials, etc..
    I know this may seem like a strange request being that you can get this info from the PO standpoint but I figured I would put it out there..
    Thanks!

    Hi,
    As you want BW report so since standard info cubes are present in BW for PR's or in gernal for procuremnt and you can get develop your report from thier .
    Lekhram

  • Cost center not populated in Purchase requisition for a third party order

    Hello,
    We are currently testing the Third party order flow which includes :
    1. Creation of a sales order with item category TAS
    2. A purchasing contract is maintained for a sales order item at the schedule line level.
    (In the purchasing contract, account assignment is already maintained for each contract item, meaning a G/L Account and a cost center).
    3. Automatic creation of the Purchase requisition when the sales order is saved.
    >> The account assignment is not copied from the contract to the Purchase requisition. Do you know why and how I can do that ?
    Thanks
    Best regards
    Benjamin

    Hi Palani,
    if i am not wrong This WBS in location or additional tabs are used for settlement purpose. For PR creation by maintenance Orders can have Order number as account assignment.
    Please reply
    Thanks
    Sunil

  • How to assign default cost center and G/L account in Purchase requisition

    Hi,
    While creating the  purchase requisition ME51N in account assignment we have to enetr cost center name and G/L account but every time we have to enter this how to assign this as defaut value , like cost center : MSMISC and account 42XXXXX.
      REGARDS,
        ZAFAR

    hi
    if the field is required then u have to enter them manually
    so if this are not required then goto OKB9 here give the default cost center for the Gl acct

Maybe you are looking for

  • My iPod is Causing my PC to crash when I plug the iPod Touch in.

    I've plugged my iPod Touch into my laptop (USB) port and it immediately caused my laptop to crash. I allowed the PC to reboot and tried again in a different port with the same results. Any suggestions as what may be the problem. Never had a hint befo

  • Error while relating sequence to a table

    thanks for a quick reply. i incorporated the suggestions that i got from here and i am getting the following error while i am trying to create a trigger: ERROR at line 1: ORA-04089: cannot create triggers on objects owned by SYS It is pretty self-exp

  • 3rd party extensions not working in 2014.1 -seeming disaster!

    When I updated to 2014.1 my 3rd party extensions will not activate in Live view. Yes I am using fluid grid layouts. Does anyone know a quick work around? I could not have imagined this happening!!

  • Problem in reading csv file in servlet

    Hi everyone, I m getting an ClassCastExeption while importing a .csv file to databse... It works fine in case of .xls... I m using jxl from Jakarta...and the code is as follows... Thanks in advance.. FileItemFactory factory1 = new DiskFileItemFactory

  • Quick advice needed...

    I have a collection of sorting algorithms which are all implemented. All of these classes have the method 'print' and 'randomise' (generates a random array of integers). This is obviously redundant, writing these two methods in every class. Should i