Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
jaheer_hussain
Active Contributor

JAHEER HUSSAIN,CRISTAL.

______________________________________________________________________________________________________________________________
Hi,

Objective:

    Recently I have implemeted Badi(ME_PROCESS_PO_CUST)  for 'Not allowing create PO(with dcoument type NBPJ and CRPJ) without PR.

If user tries to create PO(PO document type PJCR or NBPJ) with out PR,then system will throw error message.The Error message is "There is NO Purchase Requisition for this PO !".

How to do this?

You can use transaction SE18 to Implement it.

1.Go to transaction SE18.

2.Press 'Display'.

3.From the menu Implementation->Create

4.Give your implemenation name as below(starts with Z..) Here I have given as  zme_process_po_cust.

5.Then give implementation  short text as you like.

6. Then click 'Interface ' tab and select   method 'PROCESS ITEM' (BY DOUBLE CLICKING)

7.In this method,please add the following coding.

method if_ex_me_process_po_cust~process_item.


  include mm_messages_mac . "useful macros for message handling


  CALL FUNCTION 'MEPO_DOC_HEADER_GET'


    IMPORTING


      EX_EKKO = LS_MEPOHEADER.



  IF ( LS_MEPOHEADER-BSART = 'NBPJ' OR LS_MEPOHEADER-BSART = 'PJCR' ) .  "here I am checking my document type



    CALL METHOD IM_ITEM->GET_DATA


      RECEIVING


        RE_DATA = LS_MEPOITEM.



    IF LS_MEPOITEM-BANFN IS INITIAL.


     MESSAGE E025(ZQ).

   

    ENDIF.



  ENDIF.

endmethod.

--------------------------------------------------------------------------

How to create error message?

Here my error message  is E025 with message class ZQ.You can use transction code SE91,you can create your own message.

8.Finally 'SAVE' and  'ACTIVATE'.

9.Now try to create PO with your own PO document type without PR,then you will get error message and without rcreating PR,you can not complete your PO..However you can 'HOLD' your PO.

I welcome your suggestion,please.Thank you.

4 Comments
Labels in this area