Application Development 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: 

ME21N address enhancement using ME_PROCESS_PO_CUST - PROCESS_HEADER

Former Member
0 Kudos

Hi Experts,

We are enhancing the PO address on header with reference to partner functions.

I was able to find the BADI ME_PROCESS_PO_CUST and method PROCESS_HEADER, which can updated the PO header with address but I am not able to access the partner function details with in the method PROCESS_HEADER for cross reference.

Can any one help on how to get the partner function details in the PROCESS_HEADER method.

Thanks in advance.

Regards,

Harish

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

I think it will stored at item level get the details of the item at PROCESS_HEADER

Regards

Shiva

6 REPLIES 6

Former Member
0 Kudos

Hi

I think it will stored at item level get the details of the item at PROCESS_HEADER

Regards

Shiva

0 Kudos

Hi Shiva,

Thanks for the response. To be precise, I am looking for partner function details on the PO header.

Can you please give me more technical details. I am not able to get the partner details from GET_ITEMS method from Interface IF_PURCHASE_ORDER_MM.

Regards,

Harish

0 Kudos

Hi All,

Here is how I was able to access the PO header partner information in ME_PROCESS_PO_CUST - PROCESS_HEADER method.

CALL METHOD im_header->GET_DATA

RECEIVING

RE_DATA = wal_ekko.

***Widening cast for reference.

Data:

zcl_po TYPE REF TO CL_PO_HEADER_HANDLE_MM,

zim_header TYPE REF TO IF_PURCHASE_ORDER_MM,

tl_partners type MMPUR_PARTNER_ALL_TAB,

wal_partners type LINE OF MMPUR_PARTNER_ALL_TAB.

zIM_HEADER = IM_HEADER.

zcl_po ?= zIM_HEADER.

CALL METHOD zcl_po->IF_PURCHASING_DOCUMENT~GET_PARTNERS

RECEIVING

RE_PART = tl_partners.

read table tl_partners into wal_partners with KEY DATA-PARVW = 'BA'.

if sy-subrc is INITIAL.

wal_ekko-ADRNR = wal_partners-DATA-ADDRNUMBER.

CALL METHOD IM_HEADER->SET_DATA

EXPORTING

IM_DATA = wal_ekko.

endif.

Regards,

Harish

Former Member
0 Kudos

thanks

Former Member
0 Kudos

Hi guys,

I am back to the same question updating the PO address with reference to partner function (ordering address-OA) …as always user requirement changed :-).

My requirement is to update the PO header address according to partner function (OA type) and also user may change the vendor in the partner function (OA) while creating PO. By default system provides the vendor address (Funct type-VN) in the header.

I was able update the PO header address with OA type vender in the partners by implementing ME_PROCESS_PO_CUST - PROCESS_HEADER method.

But the issue is when PO header is processed and when user changes the vendor in the partner (func - OA) (I mean in the partner Tab). User expects to see the changed address in the header.

I tried to change the header address by implementing ME_PROCESS_PO_CUST - CHECK method but it is NOT reflecting the changes on the screen(Address tab) , weird thing is communication tab field(Salesperson,telephone) are changing and can be seen on the screen.

Here is the code I wrote in Check method.

data:

zcl_po type ref to cl_po_header_handle_mm,

call method im_header->get_data

receiving

re_data = wal_ekko.

zcl_po ?= im_header.

zcl_po->my_cust_firewall_on = 'X'.

***.....Changes the address number..

wal_ekko-adrnr = '0000024999'

call method im_header->set_data

EXPORTING

im_data = wal_ekko.

Please let me know if anybody facing the same issue with PO address changing.

Thanks in advance.

Regards,

Harish

anil_w
Explorer
0 Kudos

You could directly access the partner functions from the memory since there is no method to set the partners back into the PO

data: w_xmmpa_fname(35) type c value '(SAPLEKPA)XMMPA[]'.

data: xmmpa type standard table of mmpa.

field-symbols: <x> type any.

assign (w_xmmpa_fname) to <x>.

xmmpa[] = <x>.

modify xmmpa[] and then set it back to <x>

<x> = xmmpa[].