07-21-2010 10:49 AM
Hi,
I need a BADI or EXIT that i can change the ekko-frgzu, actually i want to restart the release strategy based on some condition like ZTERM changes.
I found some exits but they are not proper for my purpose.
How can i do that ?
Thanks.
07-21-2010 11:19 AM
Hi,
Try to use BADI ME_PROCESS_PO_CUST. use the method PROCESS_HEADER .
In this use the method GET_PREVIOUS_DATA and GET_DATA to read the ZTERM and then on change use the method SET_DATA to change the Release status of PO.
07-21-2010 12:25 PM
Thanks for your reply.
I tried both Header and Post methods but i could not get the desired result with the following code:
method IF_EX_ME_PROCESS_PO_CUST~POST.
Data: ex_data type MEPOHEADER, new type MEPOHEADER,
data1 type MEPOHEADER.
CALL METHOD im_header->get_previous_data
IMPORTING
ex_data = ex_data.
CALL METHOD im_header->get_data
RECEIVING
re_data = new.
MOVE-CORRESPONDING new to data1.
if ( new-zterm <> ex_data-zterm ).
data1-frgzu = ''.
data1-frgke = ''.
data1-frgrl = 'X'.
CALL METHOD im_header->set_data
EXPORTING im_data = data1.
endif.
endmethod.
Release is still not at the beginning, PO seems released i mean.
07-22-2010 7:17 AM
Hi,
try to use the method SET_CHANGED at the end of the logic.
method IF_EX_ME_PROCESS_PO_CUST~PROCESS HEADER
Data: ex_data type MEPOHEADER,
data1 type MEPOHEADER.
CALL METHOD im_header->get_previous_data
IMPORTING
ex_data = ex_data.
CALL METHOD im_header->get_data
RECEIVING
re_data = data1.
if ( new-zterm NE ex_data-zterm ).
data1-frgzu = ''.
data1-frgke = ''.
data1-frgrl = 'X'.
CALL METHOD im_header->set_data
EXPORTING im_data = data1.
use the SET_CHANGED method here
endif.
endmethod.
07-22-2010 7:28 AM
Hi,
Check this BAPI ME_BAPI_PO_CUST.
and CH_POHEADER-REL_STATUS
you can change the value but i think this bapi is getting called in BAPI po change.
Thanks.