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: 

ME_PROCESS_REQ_CUST help reqd.

Former Member
0 Kudos

i am usning the BADI ZME_PROCESS_REQ_CUST

i want to put check that user will not enter duplicate material in one PR i am trying to do in CHECK method and used the following code but i am not getting the item details


METHOD if_ex_me_process_req_cust~check .
*
  DATA i_items   TYPE  mmpur_requisition_items.

  CALL METHOD im_header->get_items
    RECEIVING
      re_items = i_items.

ENDMETHOD.

which method will give the item details so that i can check the duplicate material codes

thanx in advance

5 REPLIES 5

Former Member
0 Kudos

any help

Former Member
0 Kudos

Hi Abhishek,

Have you tried using PROCESS_ITEM method for this BADI?

This method has import parameter as IM_ITEM.

using this ,

call method IM_ITEM-> get_data ,

You should be able to get Item data.

Regards,

Akshay Bhagwat

0 Kudos

Dear Akshay,

This method will go the data for only 1 item but i want to check the wholee rows that the duplicate material is not entered in the list.

i hope u got it.

abhishek

0 Kudos

Hi Abhishek,

In that case you will have to use check method only.

Just check the code added in BOLD.

It will retrieve item data

METHOD if_ex_me_process_req_cust~check .

*

DATA i_items TYPE mmpur_requisition_items.

<b>Data: wa_item like line of i_items,

lv_if_item type ref to IF_PURCHASE_REQUISITION_ITEM,

lt_itm_data type MEREQ_ITEM.</b>

CALL METHOD im_header->get_items

RECEIVING

re_items = i_items.

<b> loop at i_items into wa_item.

lv_if_item = wa_item-item.

CALL METHOD lv_if_item->get_data

receiving

re_data = lt_itm_data

.

endloop.

*lt_itm_data now will have data related to item.</b>

ENDMETHOD.

Hope this helps.

Regards,

Akshay Bhagwat

Message was edited by: Akshay Bhagwat

Former Member
0 Kudos

you can use PROCESS_HEADER and call method GET_ITEMS, but your code looks alright to me, method CLOSE should suffice your requirement.