on 05-29-2017 9:18 AM
Hi all,
for ME21N/ME22N, we are implementing the badi ME_PROCESS_PO_CUST for PO validations. we could implement many validations in the method IF_EX_ME_PROCESS_PO_CUST~CHECK.
in ME22N, there for PO Header, there is Address tab, that gets populated with Vendor address by default, that use can change. in the method IF_EX_ME_PROCESS_PO_CUST~CHECK of badi ME_PROCESS_PO_CUST, how can we retrieve this current value.
The im_header->get_data( ), returns header data of type mepoheader, but it does not have runtime address fields.
it has ADRNR field, but that gets saved only after successful save.
Is there any way, to find the current runtime values of address tab of PO Header.
Thanks,
Madhu_1980.
Hi Madu,
This old discussion as well as this one both give useful hints on how to approach the issue.
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.
In your TL_PARTNERS you should have all the addresses you need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raymond,
DATA: i_ekko TYPE ekko,
e_name1 TYPE addr1_val-name1,
e_address TYPE addr1_val,
e_sadr TYPE sadr,
e_addr_complete TYPE szadr_addr1_complete.
ls_header = im_header->get_data( ).
MOVE-CORRESPONDING ls_header TO i_ekko.
CALL FUNCTION 'MM_ADDRESS_GET'
EXPORTING i_ekko = i_ekko
IMPORTING e_name1 = e_name1
e_address = e_address
e_sadr = e_sadr
e_addr_complete = e_addr_complete.
we can see the current runtime address in the structure e_address.
But this is working only in ME22N tcode.
In ME21N tcode, in the structure e_address, it is showing the vendor address values, but not the current values of PO Header Address tab.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Once you get ADRNR, you could use the FM or global data of group SZA1 (SAPLSZA1) to read data of currently displayed address from memory. You could also use MM_DELIVERY_ADDRESS_READ (function group MMDA) followed by ADDR_GET_COMPLETE with address handle to read any address from memory.
Another solution could be use of BAdI ADDRESS_CHECK (checking for transaction code or for BAPI in the Abap stack)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Simone,
I tried the method zcl_po->IF_PURCHASING_DOCUMENT~GET_PARTNERS.
It is providing TL_PARTNERS information, which has all fields of Partners tab in PO Header in ME22N.
It is not providing any fields like Street/House number in Address tab of PO Header.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.