cancel
Showing results for 
Search instead for 
Did you mean: 

Exception Handling before Switch Flavor in Scripts for SAP Personas 2.0

former_member195167
Participant
0 Kudos

Hello everyone!

I have created customized flavors for the transactions used by my client.

For this, I've created a unique flavor of SMEN which contains buttons directing to the other flavors (of different T-Codes).

My issue occurs when a user clicks on a button of the T-Code he is not authorized to use.

He gets a message of this form along with a ITS message at the bottom stating that the user is not allowed to use the Transaction:

I have added a 'Switch Flavor' command after the user is directed to the transaction.

I need to put an exception (using IF condition?) after the user is directed to the transaction but before the Switch Flavor is executed.

To summarise, my primary goal is to change the TEXT of this error message, possibly by raising an exception before Switch Flavor.

Please suggest/help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You need to detect somehow that the transaction execution failed. There are a couple of obvious ways to do that:

  • SAP will be issuing a "you don't have authority for this transaction" message in the status bar. You could detect that and take appropriate action.
  • The user will also still be in transaction SMEN. You could look for screen elements on SMEN and of they exist you know the transaction execution failed. Or you could look for screen elements of the new transaction and if they don't exist you know the transaction execution failed. Either way, you can then take appropriate action.

The appropriate action would be to issue a message to the user and not try to do the flavour switch, I assume.

Steve.

former_member195167
Participant
0 Kudos

Hi Steve,

Thank you very much!

I've decided to use the solution you provided in the first bullet point. Solved my issue.

I check the content of the status bar, and based on that I switch flavor or throw an exception using alert box.

I was unable to solve before because I did not know that an id for the status bar existed!

Thank you for helping,

Saud.

Answers (0)