cancel
Showing results for 
Search instead for 
Did you mean: 

Problem setting value to edit item

Former Member
0 Kudos

Hello

I have a problem when setting the value to an edit item that it's tied to a UDF that I created in the Invoices table.

When I set the value that I read from a recordset the edit box remains empty.

I have tried many ways of setting it:

pappl.forms.item("").items.item("").specific.value

pappl.forms.item("").items.item("").specific.String

edit.String

edit.Value

and neither of them worked. They work sometimes, but half of the times the edit box remains empty. The rutine doens't trow an exception, it just sets "" to the box.

Does anybody know how to fix this? or work around it?

Thank you very much

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jessica,

you should try this code for set the value in edit text.

SAPbouiCOM.EditText oEditText

oEditText=(SAPbouiCOM.EditText)oForm.Items.Item("your edit text id").Specific

oEditText.Value = your value string

it will working perfect.

Former Member
0 Kudos

Thank you.

I have already tried it and it works for the first 3 or 4 invoices I do, but then it stops getting the value again.

I think it's a problem with the Databind, that stops accepting values or something. I am running verion 6.8, do you know if it's something wrong maybe with the SBO version?

Thanks

Former Member
0 Kudos

Hi Jessica,

there is no problem with SBO Version.

Former Member
0 Kudos

Hi,

did you consider that the UDFs in case of the invoice are not on form 133? Instead it's form -133.

In my case this works (if it's checked before that the invoice-form/count=1 exists):

Dim oFormInv As SAPbouiCOM.Form

Dim oEtx As SAPbouiCOM.EditText

oFormInv = SboCon.SboUI.Forms.GetForm("-133", 1)

oEtx = oFormInv.Items.Item("U_xyz").Specific

oEtx.Value = "1234"

Former Member
0 Kudos

Are they always in Form -133? how do I see this?

thanks for your answer

Former Member
0 Kudos

The UDF-Part of the SAP-forms seems to be allways on the "negative" number of the mainform.

When you activate the Top-Menu View->System Information you see it in the statusbar while going "mouseover" the items of the form.

Another problem is that it's not guaranted that the UDF-form is open. Maybe you must perform a menu-click on View->User-defined-fields with SDK to show the UDF-form before setting the edit-text value.

Another way could be to add a edit-text-field on the main form and bind it to the db-datasource.

But I'm also in experimentation for the best solution....

Former Member
0 Kudos

yes mine is an edit tex created in the main form with a databind to the field. that's the one not working.

Well thank you for your answers, I'll have to see if I need to take it from there or not.