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: 

IW31 / IW32 Automatic triggering of Cost determination (Ctrl + F5)

kannan_ganesan
Explorer
0 Kudos
998

Hi Experts,

Recently we did enhance budget check against Maintenance order.  During the course of implementation, there was a need for Clicking the "Determine Costs" button in order to carry out the cost calculation to check against budget.  It does work fine with this extract click.  In addition we also need to save the Save button to effect the changes.  The user exit used for this change is IWO10009.

The above coding implemented to check whether the manual clicking of "Determine costs" happened prior to saving the work order.  From user stand point why the user do extract step to click. 

Appreciate experts to provide options to automatically trigger the "Determine Costs" while the user clicks the Save button prior to saving the work order.  Though it is one click for saving one order but it is very frustrating.  

Thanks,

G Kannan

1 ACCEPTED SOLUTION

karun_prabhu
Active Contributor
0 Kudos
217

Hello Kannan.

     There is one FM SAPGUI_SET_FUNCTIONCODE that can trigger PAI events automatically on providing function code.      

     I guess BAPI_ALM_ORDER_MAINTAIN will help you determine cost with method CALCULATE.

     Read its documentation for more information.

Regards.

5 REPLIES 5

karun_prabhu
Active Contributor
0 Kudos
218

Hello Kannan.

     There is one FM SAPGUI_SET_FUNCTIONCODE that can trigger PAI events automatically on providing function code.      

     I guess BAPI_ALM_ORDER_MAINTAIN will help you determine cost with method CALCULATE.

     Read its documentation for more information.

Regards.

0 Kudos
217

Dear Arun Prabhu,

Thanks for the information.  Could you explain bit more details how we can implement this so that I can explain my Abaper to carry out the changes. 

Best Regards,

G. Kannan

0 Kudos
217

Kannan,

     You can try passing the function code of DETERMINE COSTS (Ctrl+F5) to the FM SAPGUI_SET_FUNCTIONCODE .

     For instance,

          CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

              EXPORTING

                FUNCTIONCODE           = 'KOER' "Function code of DETERMINE COSTS

              EXCEPTIONS

                FUNCTION_NOT_SUPPORTED = 1

                OTHERS                                  = 2.

     For the BAPI, ask your ABAPer to refer its documentation.

0 Kudos
217

Dear Arun Prabhu,

Thanks for the details.  My Abaper did try this option and confirmed it is working. 

Best Regards,

G. Kannan

0 Kudos
217

Hi Ganesan,

Can you please share how you resolved this.

We are having the same issue. Tried calling FM CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE' as mentioned in solution, but still the (SAPLICO1)LAST_KGR[ ] is not populated in the exit.

Thanks.

Raju.