2011 Aug 07 2:57 AM
Hi Experts,
We need to modify EKKO-IHREZ during PO save . We are using POST method of badi ME_PROCESS_PO_CUST but the value is not getting populated into EKKO . I have written the below code to modify EKKO-IHREZ .
DATA: ls_mepoheader TYPE mepoheader,
ls_mepoheader-ihrez = '123KK' .
CALL METHOD im_header->set_data
EXPORTING
im_data = ls_mepoheader.
If I write the above piece of code in method PROCESS_HEADER , it modifies EKKO-IHREZ but we need to modify EKKO-IHREZ during PO save .
Please let me know if I am missing anything in the coding or is there any other way ( user exit ) to modify EKKO-IHREZ during PO save .
Thanks in advance ,
Regards,
Kiran.
2011 Aug 07 4:51 AM
Hi
I believe it's too late: the processes for storing po data are called before triggering that method.
POST is to store data in own custom table, not to set tha data for standard table.
U can try to use the method CHECK
Max
Hi Experts,
We need to modify EKKO-IHREZ during PO save . We are using POST method of badi ME_PROCESS_PO_CUST but the value is not getting populated into EKKO . I have written the below code to modify EKKO-IHREZ .
DATA: ls_mepoheader TYPE mepoheader,
ls_mepoheader-ihrez = '123KK' .
CALL METHOD im_header->set_data
EXPORTING
im_data = ls_mepoheader.
If I write the above piece of code in method PROCESS_HEADER , it modifies EKKO-IHREZ but we need to modify EKKO-IHREZ during PO save .
Please let me know if I am missing anything in the coding or is there any other way ( user exit ) to modify EKKO-IHREZ during PO save .
Thanks in advance ,
Regards,
Kiran.
2011 Aug 07 4:51 AM
Hi
I believe it's too late: the processes for storing po data are called before triggering that method.
POST is to store data in own custom table, not to set tha data for standard table.
U can try to use the method CHECK
Max
2011 Aug 07 6:11 AM
Hi Max,
I tried CHECK method also but the EKKO-IHREZ was not modified .
Let me know if there is any way to achieve this .
Thanks,
Kiran .
2011 Aug 07 10:47 AM
Hi
uhm....I think this BADI allows to change the data by PROCESS methods only, if you need to change the header data at saving only you can use the user-exit EXIT_SAPMM06E_012.
Anyway you can try to use the method process_header but you have to check SY-UCOMM in order to understand if user has pressed saving button.
Max
2011 Aug 07 4:50 PM
Hi Max,
If PO is created through BAPI BAPI_PO_CREATE1 , is there a way to check the OK code since sy-ucomm will not be having the ok code while PO creation through BAPI . Exit EXIT_SAPMM06E_012 is not useful since EKKO is the importing structure not the Changing parameter .
Hi Prasenjit,
I need to modify IHREZ during PO save because sometimes user may enter manually EKKO-IHREZ and the manually entered data needs to be considered .
If IHREZ is initial then plant from first line item needs to be populated into IHREZ . I can write the code in HEADER method itself but the problem is user might change the plant in first line item multiple times . In this case I could not find any way to identify whether user has changed the plant or not .
For ex : Let us consider user has entered plant R001 , then as per the logic I will pass R001 to EKKO-IHREZ in the HEADER method . Again user might change EKKO-IHREZ or Plant in the first line item in the same ME21N screen .
Thanks ,
Kiran.
2011 Aug 11 11:20 PM
Hi ,
The issue is solved . PO data can't be changed in POST or CHECK method . It can only be changed in PROCESS* methods . I used some static variable logic to resolve the issue .
Thanks for the inputs .
2012 Jan 05 8:34 AM
2012 Jul 17 12:11 AM
I have the same issue here. Can you please specify how did you update PO header values when you tried to SAVE the PO. That sure will be a lot of help for me. Please let me know. Thanks
2011 Aug 07 8:44 AM
I mean u sud be using PROCESS_HEADER as it will modify the data and then while posting it will get posted
I did the same with header text information and it works for me.
The methods u are using are too late and i believe not for the purpose of modifying values.
Can you plz specify wat problem u have or why u thnk u sud not be using process_header may be i can help
Edited by: Prasenjit S. Bist on Aug 7, 2011 9:46 AM
2012 Jul 17 12:14 AM
Hello Prasenjit,
I want to Update the IHREZ field during SAVE once all the Item Values are populated. I have tried to put the Code in CHECK or POST methods It doesnt work. When I SAVE the PROCESS_HEADER Method doesnt get triggered at all. So I dont know how I can trigger this to set the IHREZ Field. Can you please let me know How did you achieve this? Thanks
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |