cancel
Showing results for 
Search instead for 
Did you mean: 

Enable / Disable UDF in the Title Area

former_member280812
Active Participant
0 Kudos

Hi,

I want to control my udf in the title area based on the changing of the form mode. If the user click on the find/update mode I want my udf to disabled but if the user click the add mode I want my udf to enable.

Currently I am working in the below script. But nothing happened

If pVal.MenuID = "1282" And pVal.BeforeAction = True Then
Dim ActiveForm As SAPbouiCOM.Form = SBO_Application.Forms.ActiveForm
ActiveForm.Items.Item("U_Test").Enabled = True
Else 
ActiveForm.Items.Item("U_Test").Enabled = False
End If

Accepted Solutions (1)

Accepted Solutions (1)

former_member280812
Active Participant
0 Kudos

I already solved this problem

If pVal.MenuID ="1282" And pVal.BeforeAction = True Then
Dim ActiveForm As SAPbouiCOM.Form= SBO_Application.Forms.GetForm("-AnyNumber",0)
ActiveForm.Items.Item("U_Test").Enabled = False
EndIf

Answers (2)

Answers (2)

former_member211473
Contributor
0 Kudos

Hi

If your udf is on right or left side of the form, the code wont work and it is due to you can't see your udf when you add sap system form to addon development, the right or left side udf are missing.

actually we need to write the correct pane. for ex. each tabs have a unique pane, when working with item master general tab has pane = 6. so after manually writing pane = 6. you can see all the fields of general tab.

and i don't know how to bring right side udf form into addon development.

you can first edit the ui of form, bring your udf into the header level.

I did this way, you can surely find a better way.

also for me enabled was not working so i worked with visible = true or false.

Thanks

agustin_marcoscividanes
Active Contributor
0 Kudos

Hola

prueba a hacerlo con la función UserFields.Item("tuCampo").enabled.

Un saludo

Agustín