cancel
Showing results for 
Search instead for 
Did you mean: 

Enter Value in Activity System Form

Former Member
0 Kudos

Hi All,

I want to enter a value from UDO to Activity System Form (cardcode).

I try the following code but no success.

If (pVal.ItemUID = "activity") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False) Then

Dim f As SAPbouiCOM.Form

f = SBO_Application.Forms.Item(FormUID)

Dim oEditCardcode As SAPbouiCOM.EditText 'Card Code

'get the cardcode

Dim strCardcode As String 'Cardcode

oEditCardcode = f.Items.Item("txtcode").Specific

strCardcode = oEditCardcode.Value

SBO_Application.Menus.Item("2563").Activate()

Dim fActiv As SAPbouiCOM.Form

Dim mCrdCode As SAPbouiCOM.ComboBox

fActiv = SBO_Application.Forms.Item(FormUID)

mCrdCode = fActiv.Items.Item("9").Specific

mCrdCode.Value = strCardcode

End If

Any idea?

Best Regards,

Vangelis

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

It looks like this line is the culprit.

fActiv = SBO_Application.Forms.Item(FormUID)

So you are getting the first form using f = SBO_Application.Forms.Item(FormUID) & then you also try to do fActiv = SBO_Application.Forms.Item(FormUID) - both objects are going to point at the same form because FormUID has not changed anywhere.

Try

SBO_Application.Menus.Item("2563").Activate() 

Dim fActiv As SAPbouiCOM.Form
Dim mCrdCode As SAPbouiCOM.ComboBox
fActiv = SBO_Application.Forms.ActiveForm

Answers (1)

Answers (1)

Former Member
0 Kudos

Not