04-10-2006 8:11 AM
Hi forum,
I try to add an infotype 0019 when saving infotyp 2001 in PA30.
I decided to use user-exit EXIT_SAPFP50M_002, becaus I have to do some logic before adding 0019.
First try was to use HR_MAINTAIN_MASTERDATA but this function seems to use the same dialog-modules than PA30 does. After saving 0019 and coming back to 2001 dialog the screen is destroyed and program stops with an error.
Next try was to use RH_INSERT_INFTY, but this works only with PD-Infotypes. (says BEGDA < ENDDA)
I don't really want to insert Data direkt with SQL-command, because I need to get it replicated via ALE later.
Any suggestions?
Herbert
04-10-2006 1:58 PM
You can use FM HR_INFOTYPE_OPERATION with operation 'INS'.
Example:
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = p2006-infty
number = pernr-pernr
subtype = p2006-subty
validityend = p2006-endda
validitybegin = p2006-begda
record = p2006
operation = 'INS'
nocommit = 'X'
IMPORTING
return = l_return
key = l_key.
04-10-2006 1:58 PM
You can use FM HR_INFOTYPE_OPERATION with operation 'INS'.
Example:
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = p2006-infty
number = pernr-pernr
subtype = p2006-subty
validityend = p2006-endda
validitybegin = p2006-begda
record = p2006
operation = 'INS'
nocommit = 'X'
IMPORTING
return = l_return
key = l_key.
04-10-2006 2:05 PM
Hi Peluka,
I already tried HR_INFOTYPE_OPERATION but found that it calls HR_MAINTAIN_MASTERDATA too. So it doesn't work too.
Thanks for thinking about my problem.
Herbert
04-10-2006 4:19 PM
Wouldn't it be easier to configure an action to call the two screens in sequence?
Alternatively, have you looked at BADI HRPAD00INFTY?
04-10-2006 4:27 PM
Hi,
The User exit gets triggered during the PAI/PBO for all PA infotypes.. you might fall into an endless loop if you try to save another infotype within this exit. Have you tried the option of Dynamic Actions? (V_T588Z)
Regards,
Suresh Datti
04-10-2006 4:47 PM
Hi again,
@Chris Bain:
BADI looks interesting, but since I haven't any experiences with BADIs until now, I hesitate to implement this. But Thank you for the hint.
@Suresh Datti:
"endless loop"! In fact, I got this. That was the point, when your suggestion showed me the way to go.
I now call an external Form-Routine from dynamic measure to do some logic. The result of this logic is passed back to dynamic measure via structure RP50D. Then there the insert-command for the next infotype is startet.
And it works. No more muddled screen. Everything fine.
Thank you all
Herbert