Skip to Content
0
Former Member
Oct 03, 2005 at 09:02 AM

Adding Column to a System Grid - AR Invoice

116 Views

Hi All

I used the following code to create a combo box as a column to a system grid on the AR Invoice form. I have 2 issues::

1. How do I get the column to be added to the beginning of the grid (before item code) and not at the end ?

2. It does not fill the combo box with data from the user defined table ?

The source code is as follows:

Dim oMatrix As SAPbouiCOM.Matrix

Dim oColumns As SAPbouiCOM.Columns

Dim oColumn As SAPbouiCOM.Column

Dim oItem As SAPbouiCOM.Item

'Adding the make and model Column to a system Grid

Try

SBO_Application.Forms.Item(FormUID).DataSources.DBDataSources.Add("@PG_MKMODE")

SBO_Application.Forms.Item(FormUID).DataSources.UserDataSources.Add("CmbMake", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20)

oItem = SBO_Application.Forms.Item(FormUID).Items.Item("38")

oMatrix = oItem.Specific

oMatrix.DeleteRow(1)

oColumns = oMatrix.Columns

oColumn = oColumns.Add("cmbMake", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)

oColumn.TitleObject.Caption = "Make"

oColumn.Width = 100

oColumn.DataBind.SetBound(True, "@PG_MKMODE", "U_PG_CODE")

oMatrix.AddRow()

Catch

SBO_Application.MessageBox("Error in Function AddMatrixCol() " & "'" & ErrorToString() & "'")

End Try

Please help.

Thanks John