Skip to Content
author's profile photo Former Member
Former Member

Get ItemCode from Matrix

Hi All,

I do encounter a problem to get the ItemCode Value from matrix. Do anyone have this problem. Below is my code

            If pVal.FormTypeEx = "139" and pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS And _
                    pVal.ItemUID = "38" And _
                    pVal.ColUID = "14" Then

                    Dim oMatrix1 As SAPbouiCOM.Matrix
                    Dim oEditText0 As SAPbouiCOM.EditText
		    Dim sItemCode as string

                    oMatrix1 = SBO_Application.Forms.Item(FormUID).Items.Item("38").Specific
                    oEditText0 = oMatrix1.Columns.Item("ItemCode").Cells.Item(pVal.Row).Specific
                    sItemCode = oEditText0.value

		end if

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 21, 2007 at 08:50 PM

    Hi,

    The problem is that you are putting a wrong column id for the the ItemCode.

    The ItemCode column is 1, so you must change your line:

    oEditText0 = oMatrix1.Columns.Item("1").Cells.Item(pVal.Row).Specific

    You can see from SAP the column Unique ID by turning on the System Information (Edit Menu), and pointing the mouse arrow in the desired column, you will see if the control is a matrix: "Column=..."

    Hope it helps

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 12:17 PM

    Hi Lee,

    Dim oMatrix1 As SAPbouiCOM.Matrix

    Dim oEditText0 As SAPbouiCOM.EditText

    Dim sItemCode as string

    oMatrix1 = SBO_Application.Forms.Item(FormUID).Items.Item("38").Specific

    oEditText0 = oMatrix1.Columns.Item(14).Cells.Item(pVal.Row).Specific

    sItemCode = oEditText0.string

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.