cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to SetValue on system or UDF fields

Former Member
0 Kudos

Hi all,

Using the following code on a Sales Order form, I am able to get the value from field "CardCode", but I am not able to set it's value.

Dim oDBDataSource As SAPbouiCOM.DBDataSource
oDBDataSource = oForm.DataSources.DBDataSources.Item("ORDR")
Dim strCardCodeInit As String = oDBDataSource.GetValue("CardCode", 0)
oDBDataSource.SetValue("CardCode", 0, "C.00001") 

Same thing happens for UDFs.

I get the error "Item - The item is not a user-defined item [66000-8]".

What am I missing here?

Thank you in advance,

Aris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Aris,

You can only select value from system table as the data source. As you got the exact error message: The item is not a user-defined item. Bypassing field value check is not possible in any ways. The value must copes with the field type.

Thanks,

Gordon

Former Member
0 Kudos

Gordon,

I understand that the entered value should much with each field type.

I thought that, by using data sources, I could avoid checking the field type.

After all, the data I am trying to enter on these fields, are from same type UDFs.

Aris

Former Member
0 Kudos

You may only manipulate User Form instead of system form.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Aris,

In SAP form we can use setValue Function, Try like below

Dim oEdit as SAPbouiCOM.EditText = oForm.Items.Item(u201C4u201D).Specific

Try

oEdit.Value=u201DC.00001u201D

Catch

End try

Former Member
0 Kudos

Hi Thillai,

Thank you for your response.

I tried that too, but I faced problems like different field types (eg. Amount, Date) or "Valid Value - Value does not Exist" or "Form - Bad Value".

"Form - Bad Value" usually appears on Date or Amount type fields.

"Valid Value - Value does not Exist", appears on all ComboBox fields, no matter if the selected value exists on UDF.

So I supposed that using Data Sources, I could bypass these...

Aris