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: 

Purchase order : get Account assignment into BADI

Former Member
0 Kudos
1,639

Hi,

i'm using the BADI ME_PROCESS_REQ_CUST method POST ; in this method i need to access to items and it's work (i use im_header->get_items( ) ). But now i need to access to Account assignment, how can i do this ? the only object available is im_header.

Be careful, i can't read database because when i create a new document, the data are not saved again.

Thanks for help.

Cheer

1 ACCEPTED SOLUTION

Former Member
0 Kudos
316

IM_HEADER->get_items( ) returns the internal table RE_ITEMS type ref to MMPUR_REQUISITION_IITEMS (of line type MMPUR_REQUISITION_ITEM) which gives the list of line items.

Loop through the internal table RE_ITEMS, refer to the component RE_ITEMS-ITEM (type ref to IF_PURCHASE_REQUISITION_ITEM) & use the method RE_ITEMS-ITEM->IF_ACCT_CONTAINER_MM~GET_ITEMS( ) to get the account assignment details related to each item. This method is to be called in the loop for each line item.

Regards, Vinod

P.S : Is it purchase order or Purchase requisition ? By going through the post it is PR, your subject line seems to be wrong.

Edited by: Vinod Kumar on Jul 15, 2011 2:21 PM

4 REPLIES 4

Former Member
0 Kudos
317

IM_HEADER->get_items( ) returns the internal table RE_ITEMS type ref to MMPUR_REQUISITION_IITEMS (of line type MMPUR_REQUISITION_ITEM) which gives the list of line items.

Loop through the internal table RE_ITEMS, refer to the component RE_ITEMS-ITEM (type ref to IF_PURCHASE_REQUISITION_ITEM) & use the method RE_ITEMS-ITEM->IF_ACCT_CONTAINER_MM~GET_ITEMS( ) to get the account assignment details related to each item. This method is to be called in the loop for each line item.

Regards, Vinod

P.S : Is it purchase order or Purchase requisition ? By going through the post it is PR, your subject line seems to be wrong.

Edited by: Vinod Kumar on Jul 15, 2011 2:21 PM

0 Kudos
316

Hi Vinod,

thanks for your reply. Yes you're right it's for PO, so the BADI name is ME_PROCESS_PO_CUST.

Thanks for the method IF_ACCT_CONTAINER_MM, i'm going to test it.

Cheers

0 Kudos
316

It's work fine, thanks a lot.

diego_pinel
Explorer
0 Kudos
316

Bravo!

Thank you so much!!