06-11-2008 7:12 AM
Hi,
I've created a custom infotype - 9002 & am doing processing in the user exit - EXIT_SAPFP50M_002 (as suggested [here|http://sapdev.co.uk/enhance/enhance_hrpbopai.htm]). Specifically, I'm inserting one more record into the infotype. To insert records, I'm making use of the FM - HR_INFOTYPE_OPERATION. This call is in a Z report & I'm invoking it through SUBMIT & RETURN.
My problem is that this FM is calling my exit (the one mentioned above) again! (I can see this as I've set a breakpoint in the include ZXPADU02) Since the data is same, all checks are getting passed & the same code is getting executed twice.
I'm trying to use SET & GET PARAMETER calls to prevent the second execution; which doesn't seem to be the best approach.
Is there any other way to circumvent the second call? Any help would be appreciated.
Thanks,
KKR
06-11-2008 8:12 AM
Dear KKR,
Hope you had a look at the Include LXPADF01 for the Sample Code for Infotype 0008.
Look at it it migh give you more clue of how to use the Function Exit EXIT_SAPFP50M_02.
Moreover if you have a look at the FM HR_INFOTYPE_OPERATION - you can see that there is a further check function HR_INFOTYPE_CHECKEXISTENCE which is being used which also calls your Function Exit - So this is the reason why your Function gets executed Twice.
I Hope this information helps you to some extent.
Encourage others to answer your queries by suitably rewarding them
Thanks
Venugopal
06-11-2008 8:12 AM
Dear KKR,
Hope you had a look at the Include LXPADF01 for the Sample Code for Infotype 0008.
Look at it it migh give you more clue of how to use the Function Exit EXIT_SAPFP50M_02.
Moreover if you have a look at the FM HR_INFOTYPE_OPERATION - you can see that there is a further check function HR_INFOTYPE_CHECKEXISTENCE which is being used which also calls your Function Exit - So this is the reason why your Function gets executed Twice.
I Hope this information helps you to some extent.
Encourage others to answer your queries by suitably rewarding them
Thanks
Venugopal
06-13-2008 2:44 PM
Hi Venugopal,
Appreciate your reply. The reason the exit was getting called twice is that the FM - HR_INFOTYPE_OPERATION executes a BDC on the PA30 screen to input data. So the exit gets called again during the PAI. I prevent the second call from going through by checking the variable IPSYST-IINIT (Infotype initialized in the exit) -- It is incremented in the second call.
Couldn't think of anything better.. Suggestions are welcome.
Regards,
KKR
Edited by: KKR on Jun 13, 2008 7:15 PM