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

PO Save BAPI ME_PROCESS_PO_CUST~POST

0 Likes
5,396

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.

1 ACCEPTED SOLUTION
Read only

Former Member
3,189

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

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

9 REPLIES 9
Read only

Former Member
3,190

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

Read only

0 Likes
3,189

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 .

Read only

0 Likes
3,189

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

Read only

0 Likes
3,189

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.

Read only

0 Likes
3,189

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 .

Read only

0 Likes
3,189

Please Explain in detail how u solved the issue..

Read only

0 Likes
3,189

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

Read only

Former Member
0 Likes
3,189

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

Read only

0 Likes
3,189

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