cancel
Showing results for 
Search instead for 
Did you mean: 

Validate Trip at "Save & Send for approval" Level and throw an error message without further processing on SAP TM portal.

Former Member
0 Kudos

Hi Guys,

I have an issue with my Travel Application, once user lands onto Review Page and selects "save & send for approval" submits it - i have a condition to check if my trip has got any attachments thereby throwing an error if the condition fails on the same Review Screen without further processing of Saving the trip to SAP DB.

Please suggest.

Regards,

Praveen Kambala.

Accepted Solutions (0)

Answers (3)

Answers (3)

steffen_brauner
Explorer
0 Kudos

Hello,


I've been searching for a suitable solution. This one might be helpful:

Have a look at FITE_VC_REVIEW. We check now in WDDOMODIFY of REVIEW_VIEW (post-exit) if there are any attachment using FM PTRA_SCREEN_MEM_TRIP_GET with employeenumber + tripnumber. If et_receipts is initial there is no further check. If et_receipts contains at least one entry we try to find a corresponding entry in TOAHR for employee/trip.

If there is no entry in TOAHR but an entry in et_receipts we report an error message. To prevent the expense report can be forwarded for approval we set the element "SAVEANDSUBMIT_CONTAINER" invisible so the only thing the employee might do is attaching attachments or saving the expense report as a draft. That's it!

Regards,

Steffen

Former Member
0 Kudos

Hi Praveen,

this might be a bit late, only came across the post now dealing with a similar issue.

I found that the FPM service calls the SAVE or SAVE_AND_SEND method in the FITE_VC_REVIEW web dynpro component. In the Methods list of the component Controller there is a method SAVEEXPENSEREPORT. This calls the wd_assist - Save_expense_report method of the class CL_FITE_ASSISTANCE based on the l_submit value, it will either save or save and send.

You can Enhance this method and possibly achieve what you are trying to do.

I hope this helps as it worked for what I was trying to do

Former Member
0 Kudos

Can anyone help me, i am still unable to get which button is pressed on Review Screen of SAP Travel Application Expense report creation. I want to know if user has clicked "SAVE"/"SAVE & SEND FOR APPROVAL"/"PREVIOUS STEP"....Please help me.

Former Member
0 Kudos

Hi Pravin

Check Webdynpro Component FITV_FPM and layout view

There is a button "Button_Save" or there should be a already created custom button.

When you debug with onaction method for the button it should stop here.

So on the post exit use the f.m to get the attachments on the trip and throw required error mesaage.

Basic point is you have to look in FITV_FPM and Layout view.

Hope this helps.

Bhanu

Former Member
0 Kudos

Hi Bhanu,

First of all thanks alot for your quick response, i tried this way earlier but my problem is

1. On receipts screen if i click on Review Button - "FORWARD" button navigation action is called.

The same way on Third Screen(Review screen) if i select "SAVE"/"SAVE & SEND FOR APPROVAL" radio button and click "SAVE" button the same "FORWARD" button navigation action is called so now i am unable to understand if i am in second screen or third screen where as i want to exactly figure out if the user has selected "SAVE & SEND FOR APPROVAL" radio button and clicked on "SAVE" button on Review screen but not Receipts screen.

Hope you got my point, please suggest.

Thanks,

Praveen Kambala.

Former Member
0 Kudos

Hi Pravin,

If i understand correctly "Forward" button is triggered on "Receipts" screen and "Review screen" when you click on "Review" and "Save& send for approval" respectivley???

And you want to display the custom message on review screen only when there are no attachments.

For this you have to find out the current view name the user is in

For example:

On post exit forward button:

Check view name if "Receipts"

dont do anything

if "Review screen"

check condition

throw error.

endif.

To get the current view name :http://scn.sap.com/thread/613025

Second option would be a little more of coding but you can use it for future if any more changes are required:

For review screen create a custom button to check your condition and it should only be visible on this screen.

Hope this helps

Bhanu

Former Member
0 Kudos

Thanks alot for your clear reply Bhanu, i will try this way and get back with the result.

Final help, how to stop navigating from Review screen when i try to display the error for attachments.

Regards,

Praveen Kambala.

Former Member
0 Kudos

Hi Bhanu,

I have a problem here, In forward button post exit in FITV_FPM component we cant retrieve view name from where FPM is called for eg. When i click on any button on FPM on Travel expense report screens FITV_FPM is called but since i am writing an exit in this component action methods itself so i am unable to retrieve from where this is called. Any piece of code to retrieve from where this is being called.

Regards,

Praveen Kambala.

Former Member
0 Kudos

Ahh....i thought so anyways why dont you create a custom button for the review screen?

Thats the only solution i can think off ...

Or else wait if any experts here can give a better way to do this.

Former Member
0 Kudos

Praveen,

Why dont you check this at general data view where user adds attachments ?

There you can easily check this without a confusion on forward button.

Former Member
0 Kudos

Yes Bhanu as you said we can check it initially itself without any confusion but my client is interested in doing this way as we have enhanced Review view with some alv table which shows receipts that require attachments and its pertaining data. So at this stage they want us to check users input on attachments.

Well i am trying this in so many different ways, i will see.

Regards,

Praveen Kambala.

Former Member
0 Kudos

Bhanu,

I tried somehow filling some static custom attributes in cl_fite_assistance like the last view name whiel navigating away from the view and checked the same in FITV_FPM FORWARD Method's post exit, finally trying to get all the values in FITV_FPM for validation properly but the final challenge is i have to stop executing the ON_SAVE method and throw an error right away on Review screen, moreover the error should give ease to the user to do some actions on Review screen.

Regards,

Praveen Kambala.

Former Member
0 Kudos

Hi Bhanu,

Could you please tell me if there is any way to throw an error on Review screen(FITE_VC_REVIEW) by validating the attachments on FITV_FPM Component. When i finally got the data of the view, button clicked on FPM now in this final stage i am unable to stop processing the save function since while delegating the component from review screen after clicking SUBMIT button it is going to FITV_FPM and then calling ON_SAVE method in FITE_VC_REVIEW component controller method so its like my error is shown on the final confirmation screen with SAVE successfull message, whereas i want to stop this SAVE execution part and throw the error and not allow the user to submit trip.

Please help.

Regards,

Praveen Kambala.

Former Member
0 Kudos

Hi Praveen,

Put a break point in WDDOAFTERACTION of the layout view of the component FITV_FPM.

When you click on save it should stop here

So here you can check if there are any attachments (By using static attributes of the class etc same way as you are doing )

Check the navigation_save method of custom controller NAVIGATION this is triggered for ON_SAVE.

so you might need to do the validation in pre-exit of this method.

Hope this helps.

Bhanu