My requirement is to get the PO number for the particular invoice in SRM system. I know I can get this from Item Level details using FM BBP_PD_INV_GETDETAILS. but is there any other way so that i can directly get the PO number for the Invoice. I checked in header data also which is returned through this above FM but it does not contain the PO number.
In sort can you please tell me ..Is there any table or any FM or any other way to get the PO number using Invoice number or GUID.Thanks in advance..
Please find the link below
Thanks for the reply. But I already gone thru this link. as i already said we can get PO number at Item level details of invoice. I dont want to go thru this way. Since my requirement is to get the PO number of the invoice so that i can fetch required details from the PO and update the Invoice accordingly.
So for that i have used below logic can anybody verify that It wuld be always correct :
CALL FUNCTION 'BBP_PD_INV_GETDETAIL'
i_guid = is_header-guid
e_header = ls_header
e_item = lt_item
e_account = lt_account
e_tax = lt_tax.
LOOP AT lt_item INTO ls_item.
l_ponum = ls_item-be_refobj.
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
i_object_id = l_ponum
e_header = is_header_po.
Copy the required PO header fields into invoice header fields