cancel
Showing results for 
Search instead for 
Did you mean: 

How to block IT Creation in PA30 ??

0 Kudos

Hi Everyone!!

I would like to block the creation of an occurrence in Pa30. And authorise the creation only in a measure.

Do you have any idea how can it be achieved?

Any help would be greatly appreciated.

Have a great day

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Yes please i would like to see the code of it please

I would really appreciate it.

thanks a lot.

Quentin

Former Member
0 Kudos

Hi Quentin,

I assume that you've found the user-exit for PA30. Now the code you can place there is as follows.

*****************Begin of code by Sam********

DATA: GS_PERNR LIKE P9020-PERNR,

GS_PERNR1 LIKE P9020-PERNR,

GS_CNT TYPE I.

  • To check Transaction Code.

IF SY-TCODE = 'PA30' and INNNN-INFTY = '0000'.

MOVE INNNN TO I0000.

  • To check whether - Creation of new record.

IF IPSYST-IOPER = 'INS'.

  • To check for user-id.

IF SY-UNAME <> 'SAMUEL_D' AND SY-UNAME <> 'HRADMIN'.

MESSAGE E000(ZH) WITH

'You are not authorized to create a new record'.

ENDIF.

ENDIF.

ENDIF.

*********END OF CODE**********

Put this code in the user exit for PAI of PA30. It'll work perfectly. In this case, you can also store the user-ids in a ZTABLE and check the same from it rather than hardcoding it in the program.

Hope this helps. Kindly award points if this was helpful for u.

Cheers,

Sam.

Answers (6)

Answers (6)

0 Kudos

thx again

have a great day

Quentin

Former Member
0 Kudos

Hi Quentin,

It was my pleasure that I could solve your problem. You're always welcome!

You can also reach me at samuel_d@infosys.com

Cheers,

Sam

0 Kudos

Again thanks a lot for your answer !!

It seems to work, but I was wondering if there would be another way of doing it.

I mean, you solution works but in terms of deployment, it is gonna be heavy to deal with.

I was wondering if could tell me, if it was possible to do it in the code of my IT, by doing an ABAP function.

Thanks in advance

Have a great day

Quentin

Former Member
0 Kudos

Hi,

Actually in my company where there are about 500 SAP HR users, we control the access by creating a profile/role for a group of users and attaching them to thier user-ids as authorization objects. So each user will have Read only/Write/* rights based on his role. This is wasy to handle and enhance too.

But there is also another way of doing this. But this is going to be hectic for you in terms of maintenance. There is a user exit for PA30 for PAI. You can code there to check for the TCODE, then the infotype and then the action and then the user id. Based on that you can either allow him to save the changes or not. But this will be a big burden for you if u gonna extend this to a multiple users/user-group with various access rights.

If you still wanna explore this, pls lemm know the user-exit names (both PBO & PAI) for PA30 in ur SAP (user defined). I'll give the code.

Cheers,

Sam

0 Kudos

will try it toomorow

thx a lot

Former Member
0 Kudos

Hi,

Lemme know if it solved your need and award points for the same.

Cheers,

Sam

0 Kudos

we wants user to be able to modify the IT in PA30 but not to create a new instance in IT.

is it clear enought ???

thx a lot

Former Member
0 Kudos

hi,

Got it clear.

In this case, follow the steps below.

1) Goto TCODE PFCG.

2) Use a HR template for creating the role

3) Creat a new role with the options as follows

TCODE - PA30

INFTY - 0000,0001,0002 etc as applicable

Authorization level - W (ie only write/Change access)

or R (ie only Read Access)

4) Attach this role to the user to whom you want to give this access using TCODE SU01.

Bingo!! This will work.

Cheers,

Sam

Former Member
0 Kudos

Hi,

I didn't get your question correctly. Do u mean to block users from creating a new action/orgassignment etc in PA30??

If so, then you can do it easily. I'll surely help you on that.

Please clarify this ASAP.

Cheers,

Sam.