11-08-2006 11:52 AM
Hi,
How can I call method get_previous_data included in parameter re_header from method get_header, included in parameter im_item from method process_item (implementation of badi interface IF_EX_ME_PROCESS_PO_CUST)?.
It should be something similar to
call method im_item->re_header->get_previous_data ...
but the system does not allow this.
Rgds,
Jose
11-08-2006 8:18 PM
Hello Jose
The interface method <IF_EX_ME_PROCESS_PO_CUST>->process_item imports im_item which is of type IF_PURCHASE_ORDER_ITEM_MM.
Now you have to call method im_item->get_header:
[code]DATA:
lif_header TYPE REF TO IF_PURCHASE_ORDER_MM.
CALL METHOD im_item->get_header
RETURNING
re_header = lif_header.
The functional call looks like:
lif_header = im_item->get_header( ).
*$Comment: Im am not sure if a cast to a class is required, e.g.:
DATA:
lo_header TYPE REF TO <class implementing IF_PURCHASE_ORDER_MM>.
lo_header ?= im_item->get_header( ).
Finally call your required method:
DATA:
ls_header TYPE MEPOHEADER.
CALL METHOD lif_header->GET_PREVIOUS_DATA
EXPORTING
ex_data = ls_header.[/code]
Regards
Uwe
11-09-2006 8:35 AM
Thanks Uwe, one of this days I will have to decide to dive deep into objets.
By the way, the system gives me an error message when trying to reward your points.
Best regards,
Jose