Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to update UserField?


I am working on a grid, and am using VB.NET.

The picture below shows what I want to achieve.

I found an answer here:

Update OITM

And here is my code, which is an adaptation of the above thread:

'// If TYPE = GRPO

                    If oOPDN.GetByKey(oDocEntry) Then

                        oOPDN.UserFields.Fields.Item("U_HandOver").Value = "Y"

                        oOPDN.UserFields.Fields.Item("Seq").Value = oValue    <---  How to dim oValue?

                        retVal = oOPDN.Update



My Question:

The Update works for "U_HandOver", but not for "Seq" because I have not dim "oValue"

How to declare oValue?


Leon Lai


Hi Leon,

Try it as follows:

For i As Integer = 0 To oGrid.Rows.Count - 1

Dim oValue As String = Convert.ToString(oGrid.DataTable.GetValue("Seq", i))

-- Dim ItemCode As String = Convert.ToString(oGrid.DataTable.GetValue("Item Code", i))

Hope it helps now.

Thanks & Regards

Ankit Chauhan

0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question