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: 

Retrieving previous header data in PO line in IF_EX_ME_PROCESS_PO_CUST

Former Member
0 Kudos

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

2 REPLIES 2

uwe_schieferstein
Active Contributor
0 Kudos

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

0 Kudos

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