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: 

Enhancement for update PR

chin_yunonn
Explorer
0 Kudos

Hi,

My requirement is to update a PR customize Zfield whenever a work order is created in transaction iw31. After the work order is created (means after user press save), the PR is also created but without the Zfield, because the Zfield is not in the screen and should be retrieve from another place.

So my question is where to update the PR exactly. I tried in the BADI WORKORDER_UPDATE through several methods such as (AT_SAVE, NUMBER_SWITCH, etc ) and also BADI IWO1_PREQ_BADI. But at the moment there, the PR is not yet being created, so I am not able to update it.

I search around saying that it is not possible to change the PR elsewhere but in the change mode of work order ( iw32). Is that so and if that happens what should I do in my case.

Please Help.

Thanks.

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

You could CALL a Z_FM (RFC enabled) IN BACKGROUND TASK in one of the BAdI (somewhere just before COMMIT-WORK) when this FM will execute the PR will exist (Execution after end of Update tasks)

Regards,

Raymond

0 Kudos

Hi,

Thanks for the reply, however, my main problem now is I am not sure the BADI I am currently using is the right one or not.

I find where it commit works in the standard program and there is no BADI around just before commit work. Correct me if I am wrong. So I dont think that will work either.

I search around and found no such cases as mine, so i was wondering if there is a proper BADI for enhancing the PR created through work order. Currently the BADI I am using is for workorder update.

Thanks.

0 Kudos

Hi,

Put a breakpoint in GET_INSTANCE method of CL_EXITHANDLER class.

Then create a PR through IW31, then the contol will stop each time a BADI is getting called.

Find the suitable BADi or write a sample code and check.

You could see your zfield in the input structure populated with other fields of your PR.(Your Zfield has to present in header structure of PR)

Then populate your zfield and pass it to the structure before creating it in your BADI implementation.

Cheers,

Raja.D

former_member184111
Active Contributor
0 Kudos

Hi Chin,

I have a similar requirement. Did you find the correct BADI to achieve this?

Thanks,

Anubhav