2006 Jul 10 7:00 AM
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
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
2006 Jul 10 7:12 AM
2006 Jul 10 7:14 AM
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
2006 Jul 10 7:18 AM
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
2006 Jul 10 7:40 AM
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
2006 Jul 10 7:34 AM
you can use PROCESS_HEADER and call method GET_ITEMS, but your code looks alright to me, method CLOSE should suffice your requirement.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |