cancel
Showing results for 
Search instead for 
Did you mean: 

access to condition records

Former Member
0 Kudos

Hi Experts,

There is a requirement for making a condition records non-modifiable for some users and modifiable for others using the same SAP system. In other words, we want to see that a user 'sapuser' can only modify K007 discount record and user 'sapuser1' cannot do any modifications.

How to do this?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can achieve your requirement through the user-exit USEREXIT_PRICING_PREPARE_TKOMP.

This user exit can be found in include MV45AFZZ.

You could discuss with your ABAP consultant to achieve this.

Former Member
0 Kudos

Hi

Can you send me sample code so that I could try on my own?

I have basic knowledge of ABAP but never had experience in implementing user exits.

Thanks for your time.

Peter

Former Member
0 Kudos

Try this code and check if it works for your requirement.

FORM USEREXIT_PRICING_PREPARE_TKOMP.

DATA: I_T685A TYPE STANDARD TABLE OF T685A WITH HEADER LINE.

IF SY-UNAME = 'SAPUSER '.

LOOP AT XKOMV.

IF XKOMV-KSCHL = ' K007 '.

SELECT * FROM T685A INTO TABLE I_T685A WHERE KSCHL = 'K007'.

READ TABLE I_T685A WITH KEY KSCHL = XKOMV-KSCHL.

I_T685A-KMANU = ' C '. 'Manual entry has priority.

MODIFY I_T685A INDEX SY-TABIX.

MODIFY T685A FROM TABLE I_T685A.

REFRESH I_T685A.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT XKOMV.

IF XKOMV-KSCHL = ' K007 '.

SELECT * FROM T685A INTO TABLE I_T685A WHERE KSCHL = ' K007 '.

READ TABLE I_T685A WITH KEY KSCHL = XKOMV-KSCHL.

I_T685A-KMANU = ' D '. 'Not possible to process manually.

MODIFY I_T685A INDEX SY-TABIX.

MODIFY T685A FROM TABLE I_T685A.

REFRESH I_T685A.

ENDIF.

ENDLOOP.

ENDIF.

ENDFORM.

Former Member
0 Kudos

Hi Kamesh,

We have exactly the same problem, but what I don't undertand in your code is, that you are actually modifying the std. SAP config table T685A based on the authorizations of each user with your statement

MODIFY T685A FROM TABLE I_T685A.

What this means is, that if user A has the authorization then you are changing the configuration table for this condition type to C. Then when user B creates or changes another order afterwards and does not have the authorization, then T685A-KMANU will still have the entry for C for user B.

How does this T685A-KMANU value ever get changed back to its original value, so that a user withaut the authorization still sees a 'D' value in T685A-KMANU? How can this table T685A be changed based on a user's authorizations without affecting all the other users, who might have different authorizations and might be running through your logic simultaneously?

Could you please explain?

Thanks,

Peter

Answers (1)

Answers (1)

Former Member
0 Kudos

HI peter,

u can maintain this by allowing the authorization to particular users .

1. maintain the user menu of VK11/VK12 for specific users.

thanks

Former Member
0 Kudos

Hi SK,

Could you be more specific so that I can advise my security consultant to look into this aspect once again?

In particular, what authorization object should be used?

Thanks