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: 

Implementation BAPI ME_GUI_PO_CUST

Former Member
0 Kudos

Hi all,

i implemented BAPI ME_GUI_PO_CUST to add an additional screen to purchase order

I copied the biggest part from the great example from SAP.

It is nearly working but i do not understand this code line:

<b> mmpur_dynamic_cast l_item im_model.</b>

What does it effect and what does it mean?

Thanks a lot.

Regards

Sabine

3 REPLIES 3

Former Member
0 Kudos

The object im_model may include a header object as well as an item object.

The paramter im_name tells you which screen is processed.

Now you have to cast the "neutral" im_model to l_item or l_header.

See example:

DATA: l_header TYPE REF TO if_purchase_order_mm,

l_item TYPE REF TO if_purchase_order_item_mm,

ls_mepoheader TYPE mepoheader,

ls_mepoitem TYPE mepoitem.

CASE im_name.

WHEN 'SCREEN_ITEM'

mmpur_dynamic_cast l_item im_model.

ls_mepoitem = l_item->get_data( ).

...

WHEN 'SCREEN_HEADER'.

mmpur_dynamic_cast l_header im_model.

ls_mepoheader = l_header->get_data( ).

...

0 Kudos

HI All,

If any one of you could possible tell me that whether or not

we can get the item data in the header tab.

it is as if i want to call the following code

WHEN 'SCREEN_HEADER'.

mmpur_dynamic_cast l_item im_model.

ls_mepoitem = l_item->get_data( ).

I tried this code but was not successful.

Could you tell me if it is possible??

Thanks in Advance,

Sumit

0 Kudos

HI All,

>

> If any one of you could possible tell me that whether or not

> we can get the item data in the header tab.

>

> it is as if i want to call the following code

>

> WHEN 'SCREEN_HEADER'.

> mmpur_dynamic_cast l_header im_model.--> this marco will prepare header data.

> mmpur_dynamic_cast l_item im_model..--> this marco will prepare item data.

> -->here, you need to get items from header , using method lt_items = l_header->get_item().

>

> I tried this code but was not successful.

> Could you tell me if it is possible??

>

> Thanks in Advance,

> Sumit

regards

Prabhu