Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BADI/Exit which triggers while PR check : ME51n

Former Member
0 Kudos

Hi Experts,

I am stuck up with an critical issue which is like an show stopper.

Is there any BADI/Exit which triggers while Purchase Requistion check i.e. ME51N?

Cheers

VJ

Edited by: Vishal Jindal on Apr 7, 2011 12:33 PM

Moderator message: moved back to ABAP forums.

Edited by: Thomas Zloch on Apr 7, 2011 1:58 PM

8 REPLIES 8

Former Member
0 Kudos

Hi Thomas,

I have already checked with BADIs ME_REQ_POSTED and other quite a few BADIs, but there is no such BADI which triggers during check and which is having method with parameters of type EBAN or EBKN.

VJ

0 Kudos

OK, please include this information in your initial posts to avoid misunderstandings.

Thomas

0 Kudos

Have you checked the BADI "ME_PROCESS_REQ_CUST", method "CHECK" ? Parameter IM_HEADER refers to the interface IF_PURCHASE_REQUISITION.

You can use the method IF_PURCHASE_REQUISITION->GET_ITEMS to get the item details of purchase requisition. Item Data of this method output will give the details TYPE REF TO IF_PURCHASE_REQUISITION_ITEM. You have to use IF_PURCHASE_REQUISITION_ITEM->IF_ACCT_CONTAINER_MM~GET_ITEMS to A/C assignment details.

[Make PR header text mandatory in ME51N or atleast error message if initial |; can be used as a reference.

0 Kudos

Hi Vinod,

Thanks for responding!!!

I am using the following code in the method 'CHECK'.

CALL METHOD IM_HEADER->GET_ITEMS( 
              RE_ITEMS = LS_ITEMS ).

but I am getting syntax error.

Apart from that I am in need of EBAN and EBKN values. Is it anyway possible to fetch the values of EBAN and EBKN from this method?

Cheers

VJ

0 Kudos

May be something wrong with the data type declaration. See the below code for extracting Item details(EBAN) during the method CHECK.

DATA : lt_item TYPE mmpur_requisition_items,
           ls_item TYPE mmpur_requisition_item,
           ls_item_data TYPE mereq_item.

    lt_item = im_header->get_items( ).
    LOOP AT lt_item INTO ls_item.
      CLEAR ls_item_data.
      ls_item_data = ls_item-item->get_data( ).  "Line item data EBAN"
    ENDLOOP.

Follow the similiar proceedure to get account assignment data as mentioned in my earlier post.

0 Kudos

Thanks a lot Vinod!! It's was helpful.

I have coded to retrieve the item data as well. Please see the below code .

METHOD IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM.
TYPES : BEGIN OF TY_EBAN_EBKN,
           BANFN          TYPE EBKN-BANFN,
           BNFPO          TYPE EBKN-BNFPO,
           WBS_ELMNT      TYPE ZPS_BOQ-WBS_ELMNT,
           MAT_CODE       TYPE EBAN-MATNR,
           MENGE          TYPE EBAN-MENGE,
         END OF TY_EBAN_EBKN.

  DATA:LT_ITEMS TYPE MMPUR_ACCOUNTING_LIST,
        LS_ITEM TYPE MMPUR_ACCOUNTING_TYPE,
        LS_ITEM_DATA_WBS TYPE EXKN,
        LS_ITEM_DATA_WBS1 TYPE EXKN,
        LT_ITEM_DATA_MAT TYPE TABLE OF MEREQ_ITEM,
        LT_ITEM_DATA_WBS TYPE TABLE OF EXKN,
        LT_ITEM_DATA_WBS1 TYPE TABLE OF EXKN.

LT_ITEMS =  IM_ITEM->IF_ACCT_CONTAINER_MM~GET_ITEMS( ). 

 LOOP AT LT_ITEMS INTO LS_ITEM.

    CLEAR LS_ITEM_DATA_WBS.
    LS_ITEM_DATA_WBS = LS_ITEM-MODEL->GET_EXKN( ).
    APPEND LS_ITEM_DATA_WBS TO LT_ITEM_DATA_WBS.
    CLEAR LS_ITEM_DATA_WBS.

  ENDLOOP.
ENDMETHOD.

I am facing one problem here. I am getting only one record in LT_ITEM_DATA_WBS internal table although there are 2 line items at item level. Actually what I want to exactly is, I want to combine the Material and WBS element in one internal table.

Can you please help me out how can i proceed with that and let me know if you need any further relevant info.

Cheers

VJ

Former Member
0 Kudos

Used exit MEREQ001.

0 Kudos

did you get all line items in one table in this exit?