Application Development and Automation 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: 
Read only

Syntax error in BADI ME_PROCESS_REQ_CUST

Former Member
0 Likes
620

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

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
548

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

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
549

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

Read only

0 Likes
548

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

Read only

0 Likes
548

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