on 08-14-2009 7:18 PM
Hi,
I have build a matrix and I like to have item serach and when I get the Item I like to display the orange arrow; B1 standard (See Sales Order)
Any code sample in VB or C#?
Thank you,
Rune
Hi Rune,
The orange arrow you mean is a LinkedButton object in the UI API. You can declare it for a matrix and accordingly map any document you need to, using the LinkedObject for that corresponding LinkedButton object.
Dim objLinkedButton As SAPbouiCOM.LinkedButton
objMatrix = objForm.Items.Item("Matrix").Specific
objMatrixColumn = objMatrix.Columns.Item("V_1")
objLinkedButton = objMatrixColumn.ExtendedObject
objLinkedButton.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_GLAccounts
Hope this helps.
Best Regards,
Satish. B.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rune.
How are you adding column to the matrix?.
If you are adding columns by code, then you have to specify the column type property as LinkedButton.
There are several options available for a column type as EditText, CheckBox, Combobox, PictureBox and LinkedButton.
If you are loading the form using XML then you can specify the column type in screen painter.
Once you have loaded the matrix you can specify other properties as described by satish.
Anoop
Rune
In screen painter, there is option to change the column type property to Linked button.
Just edit the XML using the screen painter. Also set the extended object property of the column. This is what you need to do. If you need to link the button to (Orange button) business partner, the extendedObject is 2.
Save the XML and load. You will get orange button.
Anoop
Please display the right code in XML for search and link in same column:
<column uid="V_0"
type="16"
title="Item"
description="Item"
visible="1"
AffectsFormMode="1"
width="250"
disp_desc="0"
editable="1"
right_just="0"
val_on="Y"
val_off="N"
backcolor="-1"
forecolor="-1"
text_style="0"
font_size="-1"
ChooseFromListUID="BPItem"
ChooseFromListAlias="ItemCode">
<databind databound="1" table="" alias="SearchItem" />
<databind databound="1" table="" alias="LinkItem" />
<ExtendedObject linkedObject="4" LinkedObjectType="4" />
<ExtendedObject linkedObject="2" LinkedObjectType="2" />
</column>
<ChooseFromListCollection>
<action type="add">
<ChooseFromList UniqueID="-1" ObjectType="-1" MultiSelection="0" IsSystem="1"/>
<ChooseFromList UniqueID="SearchItem" ObjectType="4" MultiSelection="0" IsSystem="1" />
<ChooseFromList UniqueID="LinkItem" ObjectType="2" MultiSelection="0" IsSystem="1" />
</action>
</ChooseFromListCollection>
Edited by: Rune Brattas on Aug 17, 2009 2:43 PM
Like this:
<column uid="V_0" type="116" title="Item" description="Item"
visible="1" AffectsFormMode="1" width="250" disp_desc="0"
editable="1" right_just="0" val_on="Y" val_off="N"
backcolor="-1" forecolor="-1" text_style="0" font_size="-1"
ChooseFromListUID="ItemSearch" ChooseFromListAlias="ItemSearch">
<databind databound="1" table="" alias="ItemSearch" />
<databind databound="1" table="" alias="ItemLink" />
<ExtendedObject linkedObject="2" LinkedObjectType="2" />
<ExtendedObject linkedObject="4" LinkedObjectType="4" />
</column>
<ChooseFromListCollection>
<action type="add">
<ChooseFromList UniqueID="-1" ObjectType="-1" MultiSelection="0" IsSystem="1"/>
<ChooseFromList UniqueID="ItemSearch" ObjectType="4" MultiSelection="0" IsSystem="1" />
<ChooseFromList UniqueID="ItemLink" ObjectType="2" MultiSelection="0" IsSystem="1" />
</action>
</ChooseFromListCollection>
You really do not have screen painter?
Try these changes
ChooseFromListUID="ItemSearch" ChooseFromListAlias="ItemCode">
ChooseFromListAlias must be "ItemCode"
<databind databound="1" table="" alias="ItemSearch" />
This means you are binding the column to UserDataSource. The Table is nothing.
SO you must add the ItemSearch UserDataSource in your XML
If you have a database field for this column, assign DBDatasource using Table="TableName" and alias="FieldName"
<databind databound="1" table="" alias="ItemLink" /> Remove this line since another databind "ItemSearch" is correct
<ExtendedObject linkedObject="2" LinkedObjectType="2" /> Remove this line. Since another linked object of type "4" is correct.
<ExtendedObject linkedObject="4" LinkedObjectType="4" />
So the final code is
ChooseFromListUID="ItemSearch" ChooseFromListAlias="ItemCode">
<databind databound="1" table="" alias="ItemSearch" />
<ExtendedObject linkedObject="4" LinkedObjectType="4" />
Anoop
User | Count |
---|---|
99 | |
11 | |
10 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.