cancel
Showing results for 
Search instead for 
Did you mean: 

use matrix

Former Member
0 Kudos
53

hi,

i'm working with ScreenPainter

i have a matrix , in this matrix there is a few colums (@SIR_LOTL)

In this matrix , i have a colum in other file (@SIR_COMPOSANT) , it's for a description

When i use this matrix , i open a chooseList and i select a code (@SIR_COMPOSANT)

1) how to make to return a descrition of (@SIR_COMPOSANT) in my matrix

2) when i open a form with this , i want see the code of ((@SIR_LOTL) and à description of ((@SIR_COMPOSANT)

automaticly

i don't know do that

thank you

Didier

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Didier,

If you need to display a description but store the corresponding value in the database, then you should use a ComboBox.

Here's a sample of a ComboBox matrix column:


<column uid="UserSign" type="113" title="User Name" description="" visible="1" AffectsFormMode="1" width="40" disp_desc="1" editable="1" right_just="0" val_on="Y" val_off="N" backcolor="-1" forecolor="-1" text_style="0" font_size="-1">
     <databind databound="1" table="@SEI_PACKING1" alias="UserSign"></databind>
     <ValidValues>
          <action type="add"></action>
     </ValidValues>
     <ExtendedObject></ExtendedObject>
</column>

To implement this, load the ComboBox with the pair Value - Description when the user opens the form.

Here's a sample I use to load a ComboBox with the UserSign and UserName of the system users.


            oQuery = "SELECT T0.USERID, T0.U_NAME FROM [dbo].[OUSR] T0 "
            oRS.DoQuery(oQuery)
            If oRS.RecordCount > 0 Then
                Dim oMatrix As SAPbouiCOM.Matrix = oForm.Items.Item("MyMatrix").Specific
                Dim oCombo As SAPbouiCOM.Column = oMatrix.Columns.Item("UserSign")
                While Not oRS.EoF
                    oCombo.ValidValues.Add(oRS.Fields.Item(0).Value.ToString.Trim, oRS.Fields.Item(1).Value.ToString.Trim)
                    oRS.MoveNext()
                End While
            End If

Kind Regards,

Vítor Vieira

Edited by: Vitor Vieira on Jun 9, 2010 12:50 PM

Former Member
0 Kudos

Vítor ,

Thank you

Answers (0)