cancel
Showing results for 
Search instead for 
Did you mean: 

Disable modify for documents under certain conditions

matteo_montalto
Contributor
0 Kudos

Hello gurus,

I'm working on an SRM 7 system, extended classic scenario. My task is to disable the EDIT button to prevent unauthorized users to modify a PO or contract.

An user is defined 'unauthorized' if it doesn't belong to the same block of the doc's creator in org. structure; the logic is quite clear and it shouldn't be a problem coding it in the CHECK badi. Also I could use the same logic to disable the EDIT button for the document.

There's just a doubt for the task, I hope you can provide me info or suggestions: how to provide an error message explaining the user WHY the EDIT button is disabled?

When a user searches for a document and simply click over it, the document is loaded and shown to the user. In this sequence, CHECK badi isn't triggered yet. For what I'm going to code, the EDIT button will be then disabled but the user will have no messages explaining WHY the button is disabled.

So I'd kindly ask you:

how can I raise an error message when the document is simply loaded? CHECK badi, as described above, seems not to be a correct solution because it is not triggered in the loading phase ( the user should then press a CHECK button to retrieve the error message). Is there a specific BADI in which I can raise a message when the document is loaded? Please note that for my check I need to retrieve the document's data.

Thanks in advance for your help

Matteo

Accepted Solutions (0)

Answers (1)

Answers (1)

matteo_montalto
Contributor
0 Kudos

Solved. I checked for the condition in WDDOINIT (or WDDOMODIFYVIEW when FIRST_TIME = 'X') and raised there a persistent message for the specific case described in the post... It works.. with a single exception. I'm going to start a new thread since the argument seems quite different.