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

ME_PROCESS_PO_CUST PROCESS_HEADER help

Former Member
0 Likes
3,528

Hi friends

I want to do some validation at header based on items uisng method PROCESS_HEADER.

please can you tell me how can i get the items in header method.

i am poor OOPS pgming. please any one correct my code as given below.

i am trying to fetch the itm data from hdr as follows , but its going to dump.

DATA:lmepoheader TYPE mepoheader.

data: ls_item type line of PURCHASE_ORDER_ITEMS.

data: ls_itm type ref to IF_PURCHASE_ORDER_ITEM_MM.

data: itm_data type mepoitem.

DATA: lv_reslo TYPE ekpo-reslo.

CALL METHOD im_header->get_data

RECEIVING

re_data = lmepoheader.

CALL METHOD im_header->get_items

receiving

re_items = ls_item.

CALL METHOD ls_itm->get_data

receiving

re_data = itm_data.

lv_reslo = itm_data-reslo. "Issuing Storg

please tell me whre i amdoing wrong.

Thanks

Ramesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,572

Hi,

Please find the corrected 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.]

Reward points if you find it helpful.

Regards,

Prasanna

2 REPLIES 2
Read only

Former Member
0 Likes
1,573

Hi,

Please find the corrected 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.]

Reward points if you find it helpful.

Regards,

Prasanna

Read only

Former Member
0 Likes
1,572

Hi Ramesh,

You should not validate the items in the PROCESS_HEADER method the reason being that this method is only for processing of PO Header. Method PROCESS_ITEM should be used for processing and checking of PO Items. Please refer to the corresponding methods documentation using the steps below.

1. Execute SE24 and input the Interface name IF_EX_ME_PROCESS_PO_CUST.

2. Place the cursor on the relevant method and follow the menu path Goto->Documentation->To component or simply press F9.

Hope this is clear to you.

If at all you want to still continue the same way as you were doing then the only option I can see to avoid the dump is to add the following code.


DATA:lmepoheader TYPE mepoheader.
data: ls_item type PURCHASE_ORDER_ITEMS.
data: wa_item LIKE LINE OF ls_item.
data: itm_data type mepoitem.
DATA: lv_reslo TYPE ekpo-reslo.

CALL METHOD im_header->get_data
RECEIVING
re_data = lmepoheader.

CALL METHOD im_header->get_items
receiving
re_items = ls_item.

loop at ls_item into wa_item.

CALL METHOD wa_item-item->get_data
receiving
re_data = itm_data.

lv_reslo = itm_data-reslo. "Issuing Storg
endloop.

Reward if useful.

Thanks and Regards,

Maddineni Bharath.