cancel
Showing results for 
Search instead for 
Did you mean: 

How to create scripts for management of User Account

isaac_ariza_cruz
Participant
0 Kudos

Hello everybody,

By some requirements, we need to create some scripting control modifications on the User Account tool

We have checked and it is possible to create scripts for class "User Account" and "User Account Reference". But after several tests, we have not been able to execute these scripts.

Therefore we have some questions and we will appreciate so much your support:

  1. Is it possible to create and execute scripts for this feature?
  2. In that case, how should we create them?
  3. If it is not possible, why we can create scripts for class "User Account" or "User Account Reference"? Is it maybe because all the class are listed in this value list but really system is not prepared to execute this kind of scripts? (We have seen that it is possible to create "User Account" scrips for event: "Document Lifecycle" but indeed User Account is not a document).
  4. How could it be covered the following requirement:
    • Not all the users with role "System Administrator" should modify all the "User Account" data.For example: We have added one extension field to "User Account" and system administrator is not allowed to modify this data for his own user.

Thanks in advance for the support.

Best regards,

Isaac

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Isaac,

Thanks for your question.

  1. Yes it is
  2. The best way to implement is to create a toolbar script to test it.
  3. You should "User Account" class. From the document lifecycle perspective, you could check if the script is working, view the debug log to see if it threw an error.
  4. It is possible to write a script which validates against a particular field and it could check if the current user is not trying to change their own field. Only when that particular field gets modified, the script checks that this field is not being modified by a particular user.

Another approach would be to make that particular field "Read-only" in the UI (via page customization) and then maintain it via Data import.


Hope this helps,


Armin

PS: In case you are interested in learning more about Scripting, there is an SAP Class offered for that; please check my blog on SAP Sourcing/CLM Training

isaac_ariza_cruz
Participant
0 Kudos

Hi Armin,

Thanks for the answers.

However, I've created a script following your indications but I'm not able to excute anything. Maybe the reason is because I'm not using the correct way to create this scripting.

Like for scripting for some documents, I'm trying just to raise an error when this toolbar script is executed. However, nothing is raised. The logic used is the following one:

//Just raise an error:

doc.createApplicationException("session","ERROR TEST");

Surely, nothing is raised due to doc variable is not valid for this kind of object due to user account is not indeed a document type. Therefore, could you please let me know if there is any standard variable to be used in this script to manage the user account data  (in the same way than doc variable)?

Thanks again and best regards ,

Isaac