on 07-30-2013 2:52 PM
is possible to hide or disable a field if a user has not a specified authorization?
I know how to do it with SDK I'd like to know if there an other way to manage it
thanks
hi.
as per yours if a user has not a specified authorization?
As per my knowledge ..
if your work is on customization forms..
you create a form put one matrix..
usercode(cfl) autorizarion(Combobox)
user1 yes
user2 no
user3 no
suppose the you want to restrict on the bp master.. for particular user..
use form load...
If (pVal.BeforeAction = True) Then
Select Case pVal.EventType
Case Is <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD
If (pVal.FormType = "141") Then
'// get the event sending form
oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD)) Then
-after this code...
you can use ocompany.UserName
it will list all the users in your company ok
if (ocompany.username)=user1
here you just check in your customization form (through the Recrodset)
if user1 having the permission.... ok dont do any thing
else
oitem.left=120
which means item is moving to left....
but i dont know this is good method or bad...
but i am doing this way..
if user2 having the permision..
again oitem.left=-(minus)120
bcz you moved the item previously..
you just try , you can get an idea..............
one more important point..
have a look on above screen.. address is one tab is there..ok
if your field(you want to hide one particular field) is under this tab..
if you want to restrict particular user wise....
same method customization form authorization...
if you want to restrict for particular user have a look on below code.
after clicking on the address , folder you immediately click other folder using
oitem = oForm.Items.Item("112")
oitem.Click(SAPbouiCOM.BoCellClickType.ct_Regular)
Try
If (pVal.FormType = "142" And pVal.ItemUID = "ProduAppro" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.BeforeAction = False) Then
oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
oForm.PaneLevel = 88
Dim ousrname As String
ousrname = ocompany.UserName
If (ousrname <> "HR") Then
Dim oitem As SAPbouiCOM.Item
oitem = oForm.Items.Item("112")
oitem.Click(SAPbouiCOM.BoCellClickType.ct_Regular)
SBO_Application.SetStatusBarMessage("You Dont have the permission To See the Contatent", SAPbouiCOM.BoMessageTime.bmt_Short, False)
End If
End If
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
12 | |
10 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.