cancel
Showing results for 
Search instead for 
Did you mean: 

user defined table/last row empty

Former Member
0 Kudos
366

Hi,

I filled an user defined table with values in two rows.

The values of this rows are linked to user defined fields in a B1 Form.

The problem is, that there is a third empty row in the table. The enduser is able to choose this empty row. But that is not OK, because the udf must filled.

I remark that all udt have an empty row finally. When a take a new entry, i do this in the empty row. After execute the query, at the end there is the empty row once again.

Has anybody an idea how I can delete this empty row? in the query analyser and in the enterprise manager it isn't possible.

Whats the reason of this empty row?

thanks for answers and regards,

Katja Koch

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

thanks a lot for the fast answers.

And sorry for the bad english and litte confusion.

Sure I am clear that the last empty row is just a placeholder. But i doesn't want to allow the user to insert a new records.

Is there another solution instaed using the UI API, where I can do this in dialog?

kind regards

barend_morkel2
Active Contributor
0 Kudos

If you want to add a row you can buld in logic to allow the user to do so:

If pVal.FormTypeEx = "Your_FormType" And _

pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN And _

pVal.ItemUID = "YourMatrixID" And _

pVal.ColUID = "LastColmnID" And _

pVal.CharPressed = 9 And _

Not (pVal.BeforeAction) Then

oForm = SBO_App.Forms.Item(FormUID)

oItem = oForm.Items.Item("YourMatrixID")

oMatrix = oItem.Specific

If oMatrix.RowCount = pVal.Row Then

oMatrix.AddRow()

End If

End If

The FormTypeEx is the form type.

The ItemUID is the ID of the matrix.

CharPressed = 9 (is TAB)

This will add a row (make the row editable) if you tab on the last column off the last row in the matrix

Former Member
0 Kudos

Hi,

The reason for this empty row is to allow the user to insert a new records.

You can delete this row using the UI API, the method is deleteRow of the matrix object.

Regards.

Former Member
0 Kudos

Hi Katja,

I suppose you are meaning the empty row that actually isn't there...? In Enterprise manager (and the other tools you've used) there is always added one empty row, just to let you add a new one. Once you fill it, en proces it, it wil be added to the database. So there are only 2 real rows, the thirth is not real, just for you there to add something...

You can check the actually rowcount, just run this code in Query Analyzer or Enterprise Manager, the returned value should be 2:


SELECT COUNT(*) FROM [@YOUR_TABLE]

Hope it helps you?

barend_morkel2
Active Contributor
0 Kudos

There isn't an empty row in the DB Table - it is only displayed that way "on screen". Thie enables the user to enter a new line of data. This functionality is common throughout SBO (think about the Invoice Screen for instance). This row would not impair your logic. Think of it as a place holder for a new record...