Is it possible to populate a Choose From List manually?
Hi
I've got a requirement in a SDK screen that needs to be written to have a Choose From List contained on a Matrix column that should allow the selection of Item Masters as well as the selection of specific data contained within a User Defined Table. Whenever using ChooseFromLists I've always only ever used them to link to a object such as Items, Sales Order etc. and not a combination, or even to a User Defined Table. Is this even possible.
If not I guess the only way around it would be to create a form mimicking the ChooseFromList which I could populate with what ever I like?
Thanks
Steve
Hi Steven,
Yes, Its possible which behaves as system CFL.
Design the form like cfl having grid, choose button, cancel button and edittext of find. When you tab on edittext on form open the CFL form and after load form fill the grid by Datatable using sql query. Write code for select grid line on click of grid. Write the code on choose button which retrive value from grid.
Thanks,
Mahesh
Similar Messages
-
Choose from list + manual
Hi experts
I've got a matrix with CFL column. I can choose items via CFL but I would also like to write an item index manually. When I do so and press TAB I cannot lost focus on particular cell in the column, beacuse the program does not recognize the index. I bind the column with DBDataSource.
Shall I change sth in CFL creation parameters or do what?
Thanks in advanceAnybody?
-
Create choose from list in Report selection criteria
Hi all,
Is it possible to create a choose from list in UDF in a Report selection criteria ?
My issue is i just want to create a report using crystal report. In this report contain some parameter which the parameter choose from list value is come from a UDT. If the value come from OCRD or OITM , it's so easy to make. I just make Customer @From OCRD in parameter CR, then i just preview, it will make choose from list from business partner. But how about from UDT.
I have try to make it using Formatted search. So in SAP B1, i binded with formatted search in some parameter that i make it in CR. But there is some thing odd. if I make 2 different report with different parameter. The formatted search with binded in the first report, will also binded in the second report. And i don't want this happen.
How can i make it , the formatted search didn't binded in second report parameter, because the second report is totally different. ?
thanks in advance
regards
Jia shunHi Jia
Try this
@UDT
Code Alpha(8)
Name Alphe(30)
Fields etc
Define the parameter token as follows.
Season@SELECT DISTINCT T1.Code, T1.Name FROM OADM T0 CROSS JOIN "@UDT" T1
OADM only has one record so the join will return the right number of records.
Hope this helps
Rob -
Change data in existing "Choose from list" matrix
Hi,
in UI GUI->order form . When add a new order, hit "TAB" to select BP from existing list. I want to use my own sql to populate the BP list (currently the GUI defaults to return all customers).
Is there a way? I mean if I just want to change data in the matrix and let B1 continue to make the "Choose from list" form (form "10001") with my own new customer list. Set BubbleEvent = true will just re-read all cards after I query my result.
any help is appriciated!Hello,
I came across the same issue with the Items Choose from List on the Sales Order screen. It is possible to load your own Choose from List form and populate the matrix using recordset objects and userdatasources. The same logic could be applied to the BP Choose from List form. The following code displays the user form and matrix items - separate code is needed to handle the selection process on this form. There maybe a faster way of acheiving this using UDTs etc but it seems to work ok.
'When user presses Tab key in Item No. column.
If pVal.EventType = et_KEY_DOWN Then
If pVal.ItemUID = "38" And pVal.ColUID = "1" And _
pVal.Before_Action = True And pVal.CharPressed = vbKeyTab Then
'Load new Choose from List form.
'This is actually an exported and edited version of the SBO form.
LoadFromXML sIIS_ITEMLIST_XML
'Populate matrix with items returned from SQL query.
'Use recordset, arrays, userdatasources.
Set oRecordSet = oCmp.GetBusinessObject(BoRecordset)
sSql = "Select OITM.ItemCode, OITM.ItemName, OITM.OnHand FROM OITM " & _
"Where Upper(Left(OITM.ItemCode,2)) = 'B1'"
oRecordSet.DoQuery sSql
nRows = oRecordSet.RecordCount
If nRows <> 0 Then
'Array declarations.
Dim ItemCode(), ItemName(), OnHand()
ReDim ItemCode(nRows - 1)
ReDim ItemName(nRows - 1)
ReDim OnHand(nRows - 1)
'Add userdatasources to form.
oForm.DataSources.UserDataSources.Add "ItemCode", dt_LONG_TEXT, 20
oForm.DataSources.UserDataSources.Add "ItemName", dt_LONG_TEXT, 100
oForm.DataSources.UserDataSources.Add "OnHand", dt_LONG_NUMBER
i = 0
'Populate arrays from recordset.
Do While oRecordSet.EOF <> True
ItemCode(i) = oRecordSet.Fields.Item(0).Value
ItemName(i) = oRecordSet.Fields.Item(1).Value
OnHand(i) = oRecordSet.Fields.Item(2).Value
oRecordSet.MoveNext
i = i + 1
Loop
'Bind data fields to form items.
Set oMatrix = oForm.Items.Item("7").Specific
Set oColumn = oMatrix.Columns.Item("ItemCode")
oColumn.DataBind.SetBound True, "", "ItemCode"
Set oMatrix = oForm.Items.Item("7").Specific
Set oColumn = oMatrix.Columns.Item("ItemName")
oColumn.DataBind.SetBound True, "", "ItemName"
Set oMatrix = oForm.Items.Item("7").Specific
Set oColumn = oMatrix.Columns.Item("OnHand")
oColumn.DataBind.SetBound True, "", "OnHand"
'Get data from datasources.
Dim oUItemCode As SAPbouiCOM.UserDataSource
Dim oUItemName As SAPbouiCOM.UserDataSource
Dim oUOnHand As SAPbouiCOM.UserDataSource
Set oUItemCode = oForm.DataSources.UserDataSources.Item("ItemCode")
Set oUItemName = oForm.DataSources.UserDataSources.Item("ItemName")
Set oUOnHand = oForm.DataSources.UserDataSources.Item("OnHand")
oMatrix.Clear
'For each returned record in recordset then
'add row to matrix and populate it from
'userdatasource.
For i = 1 To nRows
oMatrix.AddRow
oUItemCode.Value = ItemCode(i - 1)
oUItemName.Value = ItemName(i - 1)
oUOnHand.Value = OnHand(i - 1)
oMatrix.SetLineData
Next i
End If
'Show form. This also sets focus to edittext field.
oForm.Visible = True
'Don't display standard SBO item list form.
BubbleEvent = False
End If
End If
Regards,
Andrew. -
Get DocNum from CFL (choose from list)
Hi SAP gurus!
Wish all of you a very Happy and Prosperous New Year 2012 !
is it possible to get Document Number from List of Goods Receipt (CFL) ..?
in Landed Cost Screen, when user clicks on 'Copy From' button, i am trying to execute query based on Document Number of List Of Goods Receipt CFL (Screen No. 10019). and then assign value of GrossAmnt to textfield 'ActualCost'
but in Screen 10019, when i press 'Choose' button, value in pval.formtype is 992!
in Case statement of 10019, hence my query is not getting executed..
Does any one have any idea how can i get Document Number from CFL.?
below is my code.
'// add an event type to the container
'// this method returns an EventFilter object
Set oFilter = oFilters.Add(et_ITEM_PRESSED)
'// aggign the form type on which the event would be processed
oFilter.Add 992 'Landed Cost Screen
oFilter.Add 10019 'List of Goods Receipt Screen (CFL)
in Case statement of pval.formtype
If pVal.FormType <> 0 Then
If pVal.Before_Action = False Then
Select Case pVal.FormType
case 992:
case 10019:
select case pval.eventtype
case et_item_pressed
Set o_TmpForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
o_matrix = o_TmpForm.items.item("7").specific
set actual_cost = o_matrix.column.item("DocNum").specific.value ' actual_cost.RowCount is 0, hence runtime error.
'now passing query in below sub end sub subroutine(procedure)..
get_actual_cost
end select
end Select
end if
end if
i appreciate your help..
Thanks and Regards,
kaviprashuHello,
When you call ChooseFromList object, and select an item, you can get the datatable which contains the selected rows from the CFL object.
Now it has several columns (basically all columns in the head table), you so it is now easy to select the correct column:
val1 = oDataTable.GetValue("[COLUMN_NAME]", 0)
Sample code:
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val1 As String
Dim val2 As String
Try
val1 = oDataTable.GetValue("DocNum", 0)
val2 = oDataTable.GetValue("DocEntry", 0)
Catch ex As Exception
End Try
Now you can only focus on the landed costs screen, (992) and track event et_CHOOSE_FROM_LIST
Now the complete code:
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val1 As String
Dim val2 As String
Try
val1 = oDataTable.GetValue("DocNum", 0)
val2 = oDataTable.GetValue("DocEntry", 0)
Catch ex As Exception
End Try
End If
End If
Regards
János -
Dear All Technical Experts,
I would like to add new field in choose from list window that is run from production order --> issue for production --> click production order button.
I could not find out how to add new information or filter field there. is it possible for me using addon ? The information I need available is remarks (OWOR.remarks). If yes, will it be UI addon or UI/DI ?
I appreciate your answer. TIA
Rgds,Hi,
First create the srf which has two buttons- Choose and Cancel
code for creating the grid :- you have to pass the SQL query as a paramter in the below function .In query you choose as many as fields from the table ,at run time columns will automatically created corresponds to your query.
private bool CreateGrid(string sSQL)
try
SAPbouiCOM.Item oItem;
oItem = oform.Items.Add("Grid", SAPbouiCOM.BoFormItemTypes.it_GRID);
oItem.Left = 7;
oItem.Width = 387;
oItem.Top = 47;
oItem.Height = 188;
oform.DataSources.DataTables.Add("dtLookUpTable");
oDataTable = oform.DataSources.DataTables.Item("dtLookUpTable");
oDataTable.Clear();
oDataTable.ExecuteQuery(sSQL);
oGrid = (SAPbouiCOM.Grid)oItem.Specific;
oGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single ;
oGrid.DataTable = oDataTable;
if(oGrid.Rows.Count > 0)
oGrid.Rows.SelectedRows.Add(0);
for (int iColCounter = 0; iColCounter < oGrid.Columns.Count; iColCounter++)
oGrid.Columns.Item(iColCounter).Width = 50;
oGrid.Columns.Item(iColCounter).Editable = false;
oGrid.AutoResizeColumns();
return true;
catch(Exception ex)
oform.Freeze(false);
throw ex;
choose the value on pressing the button 'Choose'
protected override void ITEMPRESS_AFTERACTION(ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent, SAPbouiCOM.Application oSboApplication, SAPbobsCOM.Company oCompany)
BubbleEvent = true;
if (pVal.ItemUID == "choosebuttonuid")
if (oGrid.Rows.SelectedRows.Count > 0)
SAPbouiCOM.DataTable oReturnTable = null;
oform.DataSources.DataTables.Add("dtReturnTable");
oReturnTable = oform.DataSources.DataTables.Item("dtReturnTable");
oReturnTable.CopyFrom(oDataTable);
for (int iRowIndex = 0; iRowIndex < oReturnTable.Rows.Count; iRowIndex++)
oReturnTable.Rows.Remove(iRowIndex);
int iRow = oGrid.GetDataTableRowIndex(oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder));
oReturnTable.Rows.Add(1);
//for (int iColIndex = 0; iColIndex < oReturnTable.Columns.Count; iColIndex++)
// oReturnTable.SetValue(iColIndex, 0, oDataTable.GetValue(iColIndex, iRow));
oReturnTable.SetValue(0, 0, oDataTable.GetValue(0, iRow ));
oReturnTable.SetValue(1, 0, oDataTable.GetValue(1, iRow));
SBOAppAddOn.mLookupForms.Remove(oform.UniqueID.ToString());
then u have to send the oReturnTable with parentuid( issue for production) to the baseform.
example-> SendData(oReturnTable, strParentFormUID, oSboApplication, oCompany);
oform.Close();
More:-
You have to include the Doubleclick faclity on the grid
You have to include the find functionality also. -
[SBO 2005] Choose from list on User Table
Hi all,
I need an information from the developper that already tried the SDK of BO 2005.
Is it possible to create Choose from List on user tables ?
I looked at the WebEx, there is no restriction about it, but when I tried in the demo, I can't figure out how to do it.
Thanks for your help
SébastienThank for your input Edward:
I do have the sample, but it uses a system table (OCRD, Object Type=2)
It seems that it works for system object or UDO, but not for simple user table. Am I right ?
Sebastien -
Hi All
Is it possible to change the title of the Choose from list of Bill of materials i.e. List of Bill of Materials to ABC like..
ThanksHi Pari,
No, the title comes from the CFL object name.
Regards,
Vítor Vieira -
Multiple Values For one Condition in Choose From List
I have used one Business Partner Choose From List in my form but i want to give condition in that choose from list on GroupCode .But the condition will have multiple values like 100,102,104 then how i will write the code to incorporate multiple values for one single condition.
Hi,
Check this thread
How to set a Multiple condition in a single CFL
Hope that helps,
Vasu Natari. -
Choose from List-CFL button is not visible
Hi Experts,
I am using SAP B1 8.8 PL 05 in ramp up. I have observed that in some of the clients PCs in Sales Order window I am not able to see the Choose from list button / CFL button for selecting Customer Or say Item.
This happens only in some Client PCs, where as in other clients PCs it works fine.
BR
Samir GandhiHi Rashid,
I did that. Now the indicator is displayed, but still I am not able to see the customer / item list.
BR
Samir Gandhi -
Removing Duplicates from a choose from list
Hi All,
I have a choose from list of obj 73 )Catalog Numbers (Table OSCN)
I also added conditions in the CFL that it only shows the Substitute for the CardType = 'S' (Supllier) Business Partners.
But I want to remove all the duplicate Substitutes from the CFL so that only distinct Catalog Numbers shows in the CFL.
// Adding 2 CFL, one for the button and one for the edit text.
oCFLCreationParams.MultiSelection = false;
oCFLCreationParams.ObjectType = "73";
oCFLCreationParams.UniqueID = "CFL1";
oCFL = oCFLs.Add(oCFLCreationParams);
//Adding Conditions to CFL1
oCons = oCFL.GetConditions();
oCon = oCons.Add();
oCon.Alias = "Substitute";
SAPbobsCOM.Recordset oSuppliers = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
oSuppliers.DoQuery("Select Distinct t1.Substitute From OSCN t1 Join OCRD t2 on t1.CardCode = t2.CardCode Where t2.CardType = 'S' Group By t1.Substitute");
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
while (!oSuppliers.EoF)
oCon.CondVal = oSuppliers.Fields.Item(0).Value.ToString();
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;
oCon = oCons.Add();
oCon.Alias = "Substitute";
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
oSuppliers.MoveNext();
oCFL.SetConditions(oCons);
Please advise....
Kind Regards,
Brenden DraperHi Brenden,
what you are trying to archieve won't work. Simply because CFL is getting all row data from OSCN and ItemCode or CardCode can differ for a specific substitute.
For example.
ItemCode,CardCode,Substitute
ItemA,BP1,sub1
ItemA,BP2,sub1
Would be 2 resultlines both with sub1 as substitute.
SQL equivalent :
Select Distinct t0.* from oscn t0 inner join OCRD t1 on t0.CardCode = t1.CardCode where t1.CardType = 'S'
My advise would be to open a simple form with a grid and datatable bound.
Some lines of coding and you get all you need.
regards,
Maik -
Edit and text and choose from list
hello,
I am trying to create a form that resemle to the purchase order form.
In the purchase order form when we select the card code from the choose from list
the system fill all the fileds like the name docnum .. with relevant information.
i tried to do that by using the vent et_evaluate of the edit text bind with the Card code in my form.
The problem is that when i clik on the choose from list button the event is lanched and then the value of the card code is "" so i can't crate my queries to get the infomation like suplier name and ..
does any body have an answer?
This my code:
switch (pVal.ItemUID)
case "3":
_Form.Freeze(true);
try
string NumFournisseur =
((EditText) _Form.Items.Item("3").Specific).Value;
ArrayList DFournisseur =
new DB.PurchaseRequest(_SboCompany).
GetDetailsFournisseur(NumFournisseur);
EditText Textvar;
// remplir nom fournisseur et nom contact
Textvar = (EditText) _Form.Items.Item("2").Specific;
Textvar.String = DFournisseur[0].ToString();
Textvar = (EditText) _Form.Items.Item("4").Specific;
Textvar.String = DFournisseur[1].ToString();
// remplir les dates comptable , de livraiosn et du document
Textvar = (EditText) _Form.Items.Item("17").Specific;
Textvar.String = DateTime.Today.ToString();
Textvar = (EditText) _Form.Items.Item("19").Specific;
Textvar.String = DateTime.Today.ToString();
Textvar = (EditText) _Form.Items.Item("21").Specific;
Textvar.String = DateTime.Today.ToString();
// remplir devise partenaire et numéro document
((EditText) _Form.Items.Item("59").Specific).String =
new DB.PurchaseRequest(_SboCompany).GetCurrencyCode(
NumFournisseur);
_Form.Items.Item("59").Visible = true;
_Form.Items.Item("59").Enabled = false;
((ComboBox) _Form.Items.Item("10").Specific).Select(
"primary",
BoSearchKey.
psk_Index);
((EditText) _Form.Items.Item("11").Specific).String =
new DB.PurchaseRequest(_SboCompany).GetLastDocNum().
ToString();
((EditText) _Form.Items.Item("12").Specific).String = "0";
catch (Exception e)
Console.WriteLine(e.Message);
_Form.Freeze(false);
break;
break;
catch (Exception ex)
Console.Write(ex.Message);
break;Hey Achref,
You can use the event and code like this:
string vendCode = string.Empty;
SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent) pVal;
string sCFL_ID = oCFLEvento.ChooseFromListUID;
SAPbouiCOM.ChooseFromList oCFL = oVendorSourcingForm.ChooseFromLists.Item(sCFL_ID);
SAPbouiCOM.DataTable oDataTable = oCFLEvento.SelectedObjects;
if (oDataTable != null)
//get selected value from datatable
if (oDataTable.Rows.Count > 0)vendCode = oDataTable.GetValue(0, 0).ToString();
Also check out 17.ChooseFromList in the samples that you can download.
Hope that helps
Curtis -
Choose From List Cancel Button Throws Exception
Hi all,
When I click the "Cancel" Button on my CFL, I get an error....
EXCEPTION: Matrix__EBS_FRM_CRDCLM__64.OnAfterChooseFromList raised
No matching records found (ODBC -2028)
Any ideas???Hi
in your choose from list event add this condition
If Not pval.SelectedObjects Is Nothing Then
'write your code in this if condition
end if
hope it will help u.
Regards,
Mithun. -
Choose From List and Golden arrow link in System Matrix UDF column
I'm wondering if there is a way through the SDK to create a 'Choose From List' and Golden arrow linked button in a System Matrix UDF column?
For example the Item Code in a sales order matrix does both.Hi,
Try this code for adding CFL.
SAPbouiCOM.ChooseFromListCollection oCFLs = null;
SAPbouiCOM.Conditions oCons = null;
SAPbouiCOM.Condition oCon = null;
oCFLs = oForm.ChooseFromLists;
SAPbouiCOM.ChooseFromList oCFL = null;
SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams = null;
oCFLCreationParams = ( ( SAPbouiCOM.ChooseFromListCreationParams )( SBO_Application.CreateObject( SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams ) ) );
oCFLCreationParams.MultiSelection = false;
oCFLCreationParams.ObjectType = "object id ";
oCFLCreationParams.UniqueID = "CFL1";
oCFL = oCFLs.Add( oCFLCreationParams );
oColumn.ChooseFromListUID = "CFL1";
//where oColumn is the instance of that column.
Hope u will get help....
Thanks and Regards,
Lalit -
Choose from list - data display with condition
Hi,
I 've developed a form using screen painter, I ' ve attached a choose from list to fill GRPo Number. In the choose from list the GRPo no. should not display again which once I have selected and saved.
Let me have a good solution please and it would be appreciated.
Thanks & Regards,
Venkatesan G.Hi suresh,
where did you put this code?....In the choose_from_list event handler?..I've tried a similar solution, before reading your post, but it doesn't work because if i dynamically set the condition for the choose from list i got an empty table.
i've tried to put my code when beforeaction=true and i have this kind of problem. The difference is that i need to set the filter starting with the value i've entered on the field connected to the choose from list. I put code here, so it's more clear
If (pVal.Before_Action = True) And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) Then
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim sItemCode As String
oEditText = oMatrix.Columns.Item("V_ItemCode").Cells.Item(pVal.Row).Specific
sItemCode = oEditText.Value.ToString
oCFL = oForm.ChooseFromLists.Item("CFL_Item")
oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "ItemCode"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_START
oCon.CondVal = sItemCode
oCFL.SetConditions(oCons)
End If
My situation is that i type something in V_ItemCode column and after that i press the tab key to open the choose from list.
Would be ok if i get the SAP standard beahviour too, that doesn't open the choose from list, but fills the field with the first code starting with what you type.
Thanks in advance
Maybe you are looking for
-
Can not sync all photos in Aperture into Iphone 5
I can not sync all photos in Aperture into Iphone 5. It always can sync some photos into 5. Then finish and prompts: "itunes can not synchronize (other)thousands of projects, and see more information in itunes". That means most of my photos can not
-
Standard user cannot use creative cloud
The most recent creativecloud update made it so that my users can not use CC. Adding them to local administrator group fixes this. I only have 8 workstations to worry about so I never bothered with the packager and deployment tools. I thought maybe t
-
Hi all, To install Apache, MySQL & PHP, i would like use MAMP Pro (Macintosh, Apache, MySQL ans PHP). MAMP Pro allows easy installation and administration of the development environment under MAC OS X. But somebody knows if the installation process i
-
Way to change order of person type for search window under the People
Hi, we need to change ordering of person type. Normally we open search window to find any specific record either employee/contingent or applicant which show's "Employee" as default value. Is there any way to change type employee to contingent worker
-
Through SharePoint Client Object model, how to make color coded events on Sharepoint Calendar
Hi, Through SharePoint Client Object model, how to make color coded events on Sharepoint Calendar. Plese share your knowledge. Regards Tharak