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

Call a method

Former Member
0 Likes
1,244

Hi All,

My requirement is to call a method (GET_SCHEDULES which is in the parameter of IM_ITEM) of BADI (ME_PROCESS_PO_CUST) method PROCESS_ITEM to get the delivery date.

Problem here is the receiving parameter of method GET_SCHEDULES is not a structure instead it is referring a line type (PURCHASE_ORDER_SCHEDULE) inurn which refers a interface SCHEDULE in that it is calling many methods in that I need to call the method GET_DATA in this parameter RE_DATA I am having the delivery date.

Guide me how to call the above within that BADI so as to get the delivery date. Suggest me any other way to get the delivery date.

Regards

Paul

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
937

Hi,

Please find the sample code,

[method IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER.

DATA:lmepoheader TYPE mepoheader.

data: itm_data type mepoitem.

DATA: lv_reslo TYPE ekpo-reslo.

DATA: it_items TYPE purchase_order_items,

wa_items LIKE LINE OF it_items.

CALL METHOD im_header->get_data

RECEIVING

re_data = lmepoheader.

CALL METHOD im_header->get_items

receiving

re_items = it_items.

LOOP AT it_items INTO wa_items.

CALL METHOD wa_items-item->get_data

receiving

re_data = itm_data.

lv_reslo = itm_data-reslo.

ENDLOOP.

endmethod.]

Regards

Kiran Sure

2 REPLIES 2
Read only

Former Member
0 Likes
938

Hi,

Please find the sample code,

[method IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER.

DATA:lmepoheader TYPE mepoheader.

data: itm_data type mepoitem.

DATA: lv_reslo TYPE ekpo-reslo.

DATA: it_items TYPE purchase_order_items,

wa_items LIKE LINE OF it_items.

CALL METHOD im_header->get_data

RECEIVING

re_data = lmepoheader.

CALL METHOD im_header->get_items

receiving

re_items = it_items.

LOOP AT it_items INTO wa_items.

CALL METHOD wa_items-item->get_data

receiving

re_data = itm_data.

lv_reslo = itm_data-reslo.

ENDLOOP.

endmethod.]

Regards

Kiran Sure

Read only

uwe_schieferstein
Active Contributor
0 Likes
937

Hello Paul

The same logic can be applied for your method:


method IF_EX_ME_PROCESS_PO_CUST~PROCESS_SCHEDULE.
DATA: ls_schedule    TYPE meposchedule.


  CALL METHOD im_schedule->get_data
    RECEIVING
      re_data = ls_schedule.
" Or function method call:
  ls_schedule = im_schedule->get_data( ).

  IF ( ls_schedule-EEIND > ... ).  " delivery date

  ENDIF. 

endmethod.

Regards

Uwe