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: 

Adding HR-Infotypes in User-Exit when saving one Infotype

103343
Active Participant
0 Kudos

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

1 ACCEPTED SOLUTION

LucianoBentiveg
Active Contributor
0 Kudos

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.

5 REPLIES 5

LucianoBentiveg
Active Contributor
0 Kudos

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.

0 Kudos

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

0 Kudos

Wouldn't it be easier to configure an action to call the two screens in sequence?

Alternatively, have you looked at BADI HRPAD00INFTY?

0 Kudos

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

0 Kudos

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