I am working on an enhacment in travel mangement area. The user wud create a travel expense receipt in portal and when they try to save the receipt I shud trigger this BADI . In badi we need to check for certain expense types if the total amount has been itemised or not. if not pop up and error message on portal side saying its needs to be itemised. The BADI which was suggested was BADI_TRIP_CHECK. How do I go about doing this ?
I have done this check for this particular requirement - this is a little complicated.
First - Raise a flag on the component which calls the itemization view.
Second - Put the check in the USER_CHECK_LINE_OF_RECEIPTS method.
Third - Check the ABAP stack in case the program SAPLPTRA_UTIL_ITEMIZATION is available. When this program is not available in the ABAP stack anymore, that means the program control is back with the main reciept screen.
This is a bit complicated, however I found the whole FI-TV module a challenge implementing.
Hope this helps.