Skip to Content

BAdI ME_PROCESS_REQ_CUST - How to know which items are selected?

Dec 05, 2016 at 07:00 PM


avatar image
Former Member

In the BAdI ME_PROCESS_REQ_CUST or the PR User-exits, how to know which items are selected on the screen?

I'm in ME51N/ME52N and I want to loop in all the items of the PR and only update the items that are selected on the screen.

Is there a method (using IM_HEADER or IM_ITEM) that give this information?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Carlo Kenzo Feitoza May 24, 2017 at 09:29 AM

Hi Émanuel,

You can use method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM from interface of BAdI ME_PROCESS_REQ_CUST to get information from the item that is currently been processed.

In this same method, you can get all item using:

DATA: lt_req_items TYPE mmpur_requisition_items,
      lw_req_item  TYPE mmpur_requisition_item,
      lw_item_data TYPE mereq_item.

  lt_req_items = im_item->get_requisition( )->get_items(
*      im_auth_check = MMPUR_NO
*      im_release_op = MMPUR_NO

Then to get data from items, loop through the table, like:

  LOOP AT lt_req_items INTO lw_req_item.
    lw_item_data = lw_req_item-item->get_data( ).
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
May 24, 2017 at 11:56 AM

If you actually want to get the list of currently selected rows in the transaction displayed ALV grid, you could use some assign to CALL_VIEW(SAPLMEGUI)->MY_GRID, reference to an instance of class CL_GUI_ALV_GRID to get list of selected rows. Else could you elaborate on what/when/why you want to get this list?

10 |10000 characters needed characters left characters exceeded