cancel
Showing results for 
Search instead for 
Did you mean: 

How to validate data input in PA30 (Maintain HR Master Data)

Former Member
0 Kudos

Dear Friends,

I am doing PA30 (Maintain HR Master Data) , entry Personnel no. (e.g. 1733), typing Infotype 2001 (Absences) and select Sty 1040 Maternity Leave ( in SPRO -> Time Management -> Time Data Recording and Administration -> Absences -> Absence Catalog -> Define Absence Type ). then click Create button to Create Absence.

I want to validate data input when click Create button, If the Gender of 1733 = female it can be created absence but when the gender is male it can't be processed.

Or we could show the message "Select Error" after selecting Subtype Maternity Leave if the gender = male

I am sorry for my english, hoping your help.

Thanks in advance,

Ferry

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member185540
Active Participant
0 Kudos

Use user exit.

ZXPADu1 or ZXPADU 2

jagan_gunja
Active Contributor
0 Kudos

User exits are in the includes LXPADU01 & 02 as provided by SAP and used by user function/s in employee data maintenance program modules. 

It is a common practice that these includes are copied to ZXPADU01 & 02 and they are in turn included in the SAP include or program.. 

You can display the include and see where it is used.

Former Member
0 Kudos

Greetings,

if the validation will show "error/warning messages" you can consult your ABAP Technical consultant to do a "USER EXIT" for validation.

it's can be done for all type of leaves.

Regards,

Fahad

Former Member
0 Kudos

Hi Ferry

Have u solved your problem ? Because i have same requirement as yours. And its very helpful if you can share the solution when u already solved it..^^

Thanks before

Shr

Former Member
0 Kudos

Hi Sheeren,

I am learning how to create dynamic action, I got the informations via google, just typing "how to create dynamic action sap-hr", it takes time for me to learn it for I am very beginner in SAP. I will share with you here if I have solved it.

Regards,

Ferry

Former Member
0 Kudos

Hi,

I think you can achive tihs by writing a dynamic action.

Check the IT0002 before creating the IT 2001 with subtype 1040.

Sty Field N FC No S Variable function part

1040 04 01 P P0002-GESC1 = '0'.

Regards,

Srini.

Former Member
0 Kudos

Yes, indeed the dynamic action is easier to do if you are a beginner. Follow this lead.

Former Member
0 Kudos

Dear all,

I think this is a good solution at this time, because I am a beginner I will try with dynamic action first.

Thank you for your attention.

Regards,

Ferry

Former Member
0 Kudos

Hi,

Maternity Leave comes under the setting Special Absence Data.

SPRO -> IMG -> Time Management -> Time Data Recording and Administration -> Absences -> Special Absence Data -> Maternity Protection

This section allows you to define special processing types to calculate absences absences for maternity protection and parental leave.

Here we can use the feature MASEX (Determine infotype admissibility for employees) for determining admissability for the 'Create Maternity Protection' Infotype (0080).

The return value for this feature can be one of the following:

o 0 - allowed for female and male employees

o 1 - allowed for female employees only

o 2 - allowed for male employees only

Kindly try this configuration for Maternity Leave.

Thanks and Regards

Kiran

Former Member
0 Kudos

Thanks Kiran for the answer,

if we do not use infotype 0080 but infotype 2001 (absence) and select the specific subtype, how do we set in SPRO for validation?

Regards,

Ferry

Former Member
0 Kudos

You might want to copy the MASEX feature or create your own one and use it for 2001.

Or you might want to use a user exit/badi

Former Member
0 Kudos

Dear Adriana,

Thanks for the answer.

we actually do not use infotype 0080 but infotype 2001 for input maternity leave.

Our Consultant have defined absence type in SPRO, one of them 'maternity leave' ( so we can choose in it2001 subtype).

when selecting a subtype maternity leave it should be 'female' that valid for the choice. How to set on SPRO in order to use in 2001 ?

Regards,

Ferry

PS: It's a pity on me, I was just learning SAP and never implement SPRO before, and now I was assigned to solve this problem

Former Member
0 Kudos

Hi Ferry,

This is frequently asked question. Best way is to make entry of maternity leave permissible only if employee has quota for it. You can then restrict that quota is generated for female employees only.

Please check this thread: [|]

's

Former Member
0 Kudos

Thanks a lot SaQ, I will follow the thread

Regards,

Ferry

Former Member
0 Kudos

Hi,

Please implement user exit ZXPADU01 under PBAS0001 package.

Check the following sample/pseudo code:

DATA: wa_2001 like P2001.

CALL METHOD CL_HR_PNNNN_TYPE_CAST->PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = wa_2001.

SELECT GENDER FROM PA0002 WHERE PERNR EQ wa_2001-PERNR.

IF GENDER IS 2.

MESSAGE ERROR.

EXIT SCREEN.

ENDIF.

CALL METHOD CL_HR_PNNNN_TYPE_CAST->PNNNN_TO_PRELP

EXPORTING

PNNNN = wa_2001

IMPORTING

PRELP = INNNN.

To correct the code, please take the help of an ABAPer.

Regards,

Dilek

Former Member
0 Kudos

Thank you Dilek for your information, I will try what you suggest.

Regards,

Ferry

nesreen_saber
Explorer
0 Kudos

Dear Dilek,

Could you please send me you e-mail

to ask you about something

thanks