Application Development and Automation 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: 
Read only

ME_PROCESS_REQ_CUST

Former Member
0 Likes
1,738

in method PROCESS_ACCOUNT, how to get the PR's item data as in EBAN/mereq_item internal table

8 REPLIES 8
Read only

Former Member
0 Likes
1,449

Hi,

Use method process_item and call method get_data() in this

ls_mepoitem = im_item->get_data( ).

where ls_mepoitem is of type mereq_item.

In ls_mepoitem you will get the required data.

Asha

Read only

0 Likes
1,449

Dear Asha,

I know that in method process_item i can always get the item's data.

What i need is , the accounting data ( cost center, Gl account) + mereq_item data..

I don't see that in method process_item i can get accounting data .

Whilst in method PROCESS_ACCOUNT I can get accounting data but not mereq_item data.. so can anybody advice how i can get both data at the same time

Read only

0 Likes
1,449

Hello Esther

IM_ACCOUNT_REF is available at SAP release >= ECC 6.0.

Perhaps the following coding may be helpful:


METHOD if_ex_me_process_req_cust~process_account.
* define local data
  DATA: lo_account    TYPE REF TO cl_po_accounting_handle_mm,
        lt_items      TYPE mmpur_models,
        ls_item       TYPE mmpur_model_type,
        lo_item       TYPE REF TO cl_req_item_proxy_mm,
        ls_data       type mereq_item.

  lo_account ?= im_account.

  CALL METHOD lo_account->get_items
*    EXPORTING
*      im_items_with_error =
*      im_enq_err_mat      =
*      im_enq_err_con      =
    IMPORTING
      ex_items            = lt_items.

  LOOP AT lt_items INTO ls_item.
    lo_item ?= ls_item-model.

    ls_data = lo_item->if_purchase_requisition_item~get_data( ).
  ENDLOOP.

ENDMETHOD.

Regards

Uwe

Read only

0 Likes
1,449

HI ESTER.

I do a validation in the "cost center" in method PROCESS_ACCOUNT method, but I do not see the data entry.

as it was that did this? can you please guide me?

thanks.

Read only

0 Likes
1,449

Hello,

Use the following code it will help,

method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ACCOUNT.

DATA: re_data TYPE exkn.

CALL METHOD im_account_ref->get_data

RECEIVING

re_data = re_data.

endmethod.

Regards,

Sam

Read only

0 Likes
1,449

How can you use here (PROCESS_ACCOUNT) mmpur_remove_messages_by_id ???

What is that ID ???

Thanks

Read only

Former Member
0 Likes
1,449

Hi Ester Johannes

The following code will do it.

method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ACCOUNT.

DATA: LV_REF_ITEM TYPE REF TO IF_PURCHASE_REQUISITION_ITEM,

lv_item1 TYPE mereq_item.

LV_REF_ITEM = IM_ACCOUNT_REF->GET_ITEM( ).

lv_item1 = LV_REF_ITEM->get_data( ).

endmethod.

Hope this helps

Sreenivas.

Read only

0 Likes
1,449

Hi,

I have the same problem like ester johannes - but the solution obove doesn't work. IM_ACCOUNT_REF doesn't exist - and IM_ACCOUNT doesn't hab a method GET_ITEM.

What SAP release are you using? Any other posibilities to get the item-data while processing the accouting-section?

Yours

Jürgen