cancel
Showing results for 
Search instead for 
Did you mean: 

How to add data to a System Form Matrix

Former Member
0 Kudos

Hi all,

is it possible someone to give me an example of code that adds data to the rows (e.g.itemcode) of a system form (e.g Sales Order).

Thanks in advance,

Vangelis

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Janos,

I tried the code and I have monitored the following problem in debuger:

when code is in step:

oMatrix.Columns.Item("1").Cells.Item(iCount).Specific.String = oRs.Fields.Item("ItemCode").Value

it step out from loop and starts again (from iCount = 1) (this "loop" never ends)

If I stop running and return to SAP then in Sales Order Form I see the itemcode as it should be (and actually there is also the itemname, as it should be).

In other words it never steps to

oMatrix.Columns.Item("11").Cells.Item(iCount).Specific.String = oRs.Fields.Item("QTY").Value

Any idea?

Thanks in Advance

Former Member
0 Kudos

Hi Janos,

I 'll try it

Thanks

Vangelis

Former Member
0 Kudos

Hi Janos,

2 silly questions:

- Dim oRs As SAPbouiCOM.Column (is it correct?)

- Call Resources.StepProgress() (? what isabout)

Thanks in Advance,

Vangelis

Former Member
0 Kudos

HI,

I have corrected the code,

os is a recordset, in my example i have filled the matrix values based on a recordset

Steprogress is not important, you can delete it.

Regards,

J.

Ps: there is no silly questions....

Former Member
0 Kudos

HI,

What you can do, it enter the value into the column "1" (itemcode on sales order) using the UI API.

Take care, every validation process is running by SAP B1 Client as standard.

Let's say the sales order is open, and you want to fill it from a recordset


  Dim oRs as sapbobscom.Recordset = ocompany.GetBusinessObject(BoObjectTypes.BoRecordset)
  oMatrix = otmpform.Items.Item("38").Specific
  For iCount = 1 To oRs.RecordCount
                    oMatrix.Columns.Item("1").Cells.Item(iCount).Specific.String = oRs.Fields.Item("ItemCode").Value

                    oMatrix.Columns.Item("11").Cells.Item(iCount).Specific.String = oRs.Fields.Item("QTY").Value
                    oMatrix.Columns.Item("24").Cells.Item(iCount).Specific.String = "2"
                    oRs.MoveNext()
                Next iCount

regards,

J.