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 Badi CHECK Method

Former Member
0 Likes
3,085

have put the folowing code in CHECK Method

METHOD if_ex_me_process_req_cust~check .

*

DATA i_items TYPE mmpur_requisition_items.

DATA: wa_item LIKE LINE OF i_items,

lv_if_item TYPE REF TO if_purchase_requisition_item,

lt_itm_data TYPE mereq_item.

*

break ranjeet.

CALL METHOD im_header->get_items

RECEIVING

re_items = i_items.

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.

in the above code i am not able to get the account assgn. details like in PROCESS_ACCOUNT Method how can i do that.

i have to put some conditions combining item details and Account Assignments, same is not possible in PROCESS_ACCOUNT Method as in this i am not able to get Item details as in PROCESS_ITEM and vice versa.

so i want to check condition in CHECK Method.

thanx

abhishek

2 REPLIES 2
Read only

Former Member
0 Likes
862

Hi Abhishek,

in your code lv_if_item is the reference to interface IF_PURCHASE_REQUISITION_ITEM.

You can get the account assignment details using the call to the method

CALL METHOD lv_if_item->if_acct_container_mm~get_items

RECEIVING

re_items = l_account_list.

l_account_list is table type mm_pur_accounting_list. The underlying structure contains reference to IF_ACCOUNTING_MODEL_MM. This interface contains a method get_ekkn. The full coding will be as follows,

data: l_account_list TYPE mmpur_accounting_list,

l_account_line TYPE mmpur_accounting_type,

ls_exkn TYPE exkn,

CALL METHOD lv_if_item->if_acct_container_mm~get_items

RECEIVING

re_items = l_account_list.

CHECK l_account_list IS NOT INITIAL.

LOOP AT l_account_list INTO l_account_line.

CALL METHOD l_account_line-model->get_exkn

RECEIVING

re_exkn = ls_exkn.

ENDLOOP.

Ravi

Read only

0 Likes
862

Tks u, the answer is helpful.