cancel
Showing results for 
Search instead for 
Did you mean: 

User-exit for autopopulate nickname field in pa40

former_member333737
Active Participant
0 Kudos

Hello Experts,

In transaction PA40 Create Personal data there is a screen field named Nickname which is Mandatory.

I want to autopopulate this nickname field when i enter first name last name, the first name field should enter the nickname.

Is there any user-exit for such a requirement.

Thanks in advance,

Thanks & Regards,

Nikhil K.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nikihil,

You can use the User Exit that you identified but the function exit to use is EXIT_SAPFP50M_001. This is one you should use to default values in infotypes and the EXIT_SAPFP50M_002 is used to do checks and not manipulate the valuse. This is one of the right ways to do it and I have implemented it before and it works fine. You may want to call the following methods to get current Infotype values from the screen and the proposed values to be updated with.

CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn

EXPORTING

prelp =

IMPORTING

pnnnn = .

and

CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

EXPORTING

pnnnn =

IMPORTING

prelp = .

former_member333737
Active Participant
0 Kudos

Hi All,

I am writing the code in the exit EXIT_SAPFP50M_002, the requirement is like when i write the first name last name in pa30 the nickname should get auto populated after pressing the save button but nickname being mandatory, my code will not trigger since I need to add a check when i am imputting the first name and last name

Is there any other way to full-fill this requirement.

Thanks,

Nikhil,

former_member201275
Active Contributor
0 Kudos

You need to use badi HRPAD00INFTY. There are 3 methods in there so you need to be careful where you insert your code as otherwise you may update more than once. Also you need ot include a check on transaction code as this is also run for PA30 and PA20.

former_member333737
Active Participant
0 Kudos

Hi Gemini,

thanks for the help.

I found the badi but can you help me on this, do I need to make a new method or include the code in the existing method.

I am not sure how will i call this in my std program.

Thanks,

Nikhil K.

former_member333737
Active Participant
0 Kudos

Hello Experts,

I have found a enhancement PBAS0001 where in exit EXIT_SAPFP50M_002 I can add a check for populating nickname when I click on save button.

Let me know if this is the right way to do it.

Has anyone done such kind of enhancement?

Thanks,

Nikhil

Former Member
0 Kudos

You can use either of 2 that is user-exit of BAdI as both are called for the PA maintenance purpose.

With user exit the problem is you will not have infotype as importing parameter whereas in BAdI 'HRPAD00INFTY' you have infotype as importing paramter. In case of BAdI you can use AFTER_INPUT method for this.