‎2009 May 26 11:11 AM
Hi,
I am using BADI->ME_PROCESS_REQ_CUST, Method-->PROCESS_ACCOUNT and i want to make use of the data of importing parameter IM_ACCOUNT_REF and methods GET_DATA,GET_ITEM.
when i wrote the code in the below manner i am getting syntax error as 'The result type of the function method cannot be converted into the type of LS_MEPOITEM1' . .Please help
.
DATA: ls_mepoitem TYPE exkn,
ls_mepoitem1 type MEREQ_ITEM.
ls_mepoitem = IM_ACCOUNT_REF->get_data( ).
ls_mepoitem1 = IM_ACCOUNT_REF->get_item( ).
Thanks
K Srinivas
‎2009 May 26 11:21 AM
Hello Srinivas
The item returned by method GET_ITEM is again an object instance:
DATA:
lo_item TYPE REF TO IF_PURCHASE_REQUISITION_ITEM.
lo_item = IM_ACCOUNT_REF->get_item( ).
Regards
Uwe
‎2009 May 26 11:21 AM
Hello Srinivas
The item returned by method GET_ITEM is again an object instance:
DATA:
lo_item TYPE REF TO IF_PURCHASE_REQUISITION_ITEM.
lo_item = IM_ACCOUNT_REF->get_item( ).
Regards
Uwe
‎2009 May 26 11:33 AM
Thanks for reply. How can i make use of the data in lo_item. While debugging i can see the data of GET_DATA but for GET_ITEM i didnt understand. I have to retrieve WERKS value from this. Please suggest how to code furthur/
Thanks
K Srinivas
‎2009 May 26 11:36 AM
Hello Srinivas
Just call the GET_DATA method of the item instance:
DATA:
ls_data TYPE mereq_item,
lo_item TYPE REF TO IF_PURCHASE_REQUISITION_ITEM.
lo_item = IM_ACCOUNT_REF->get_item( ).
CHECK ( lo_Item IS BOUND ).
ls_data = lo_item->get_data( ).
IF ( ls_data-werks = ... ).
...
ENDIF.
Regards
Uwe