02-09-2007 10:39 AM
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
09-27-2007 2:28 PM
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( ).
...
09-20-2011 7:17 PM
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
09-21-2011 4:37 AM
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