How to fill matrix with the output of recordset query?
Hi all,
I want a user matrix to load data when I hit a button and the data to be filled is the output of an sql query. binding the matrix columns with table columns and then load the matrix with DBDatasource attached to that table will not do in this case as the columns in the sql query are from several different tables or views.
writing following line to do this takes several minutes to load the data:
For j = 0 To Reordset.RecordCount - 1
Matrix.AddRow()
Matrix.Columns.Item("col1").Cells.Item(i).Specific.value = Recordset.Fields.Item("cardcode").Value
Recordset.movenext()
next
Is there any other way to fill the matrix in this case, which loads the data faster?
Regards,
Hello Binita,
I've tested the CFL for DataTable-Matrixes in my test-AddOn. But there's still one problem left. Maybe you find it out (I will need this in the future too...).
The ChooseFromList must be added behind the DataTable-Bind, which is done on every MTX-Load (it's not from the sample above, so the UIDs are new ones):
oDt = oDts.Item("dt_test")
query = "SELECT * FROM [@T_CONVTOOLS01]"
oDt.ExecuteQuery(query)
oMtx.Columns.Item("0").DataBind.Bind("dt_test", "Code")
oMtx.Columns.Item("1").DataBind.Bind("dt_test", "U_Alpha01")
oMtx.Columns.Item("2").DataBind.Bind("dt_test", "U_Price01")
oMtx.Columns.Item("3").DataBind.Bind("dt_test", "U_Quant01")
oMtx.Columns.Item("4").DataBind.Bind("dt_test", "U_Date01")
AddChooseFromLists()
oMtx.LoadFromDataSource()
...where AddChooseFromLists() is...
Private Shared Sub AddChooseFromLists()
Try
Dim oCfls As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim oCfl As SAPbouiCOM.ChooseFromList
Dim oCflCreationParams As SAPbouiCOM.ChooseFromListCreationParams
Dim oBtn As SAPbouiCOM.Button
Dim oMtx As SAPbouiCOM.Matrix
Dim oCol As SAPbouiCOM.Column
Dim oEtx As SAPbouiCOM.EditText
oMtx = oForm.Items.Item("MTX_TEST02").Specific
oCfls = oForm.ChooseFromLists
oCflCreationParams = SboCon.SboUI.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCflCreationParams.MultiSelection = False
oCflCreationParams.ObjectType = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner
oCflCreationParams.UniqueID = "CFL_C1"
oCfl = oCfls.Add(oCflCreationParams)
'### OPTION:
'# Shown ChooseFromList restricted by Conditions
oCons = oCfl.GetConditions()
oCon = oCons.Add()
oCon.Alias = "CardType"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "C"
oCfl.SetConditions(oCons)
oCol = oMtx.Columns.Item("1")
oCol.ChooseFromListUID = "CFL_C1"
oCol.ChooseFromListAlias = "CardCode"
Catch e As Exception
Microsoft.VisualBasic.MsgBox(className & ".AddChooseFromLists()" & vbCrLf & "Exception:" & vbCrLf & e.Message.ToString)
End Try
End Sub
But I'm running into problems when trying to set the MTX-Cell via DataTable at the CFL-Event (see comment):
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oMtx As SAPbouiCOM.Matrix
Dim oCFLEvent As SAPbouiCOM.IChooseFromListEvent
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oDataTable As SAPbouiCOM.DataTable
Dim cflID As String
Dim oDt As SAPbouiCOM.DataTable = oForm.DataSources.DataTables.Item("dt_test")
oCFLEvent = pVal
cflID = oCFLEvent.ChooseFromListUID
'Dim oForm As SAPbouiCOM.Form
'oForm = SboConnection.SboUI.Forms.Item(FormUID)
oCFL = oForm.ChooseFromLists.Item(cflID)
If Not oCFLEvent.BeforeAction Then
oDataTable = oCFLEvent.SelectedObjects
If oDataTable Is Nothing Then Exit Sub
'############## Matrix Test #######################################################################
If (oCFLEvent.ItemUID = "MTX_TEST02") Then
oMtx = oForm.Items.Item("MTX_TEST02").Specific
'### CFL Results to UserForm
oDt.Rows.Offset = oCFLEvent.Row - 1
MsgBox(oDt.GetValue("U_Alpha01", oCFLEvent.Row - 1))
MsgBox(oDataTable.GetValue("CardCode", 0))
' PROBLEM - can't get this working - don't know at the moment:
' on other forms SetValue works....
oDt.SetValue("U_Alpha01", oCFLEvent.Row - 1, oDataTable.GetValue("CardCode", 0))
' this also gives me problems...:
'oMtx.Columns.Item("1").Cells.Item(oCFLEvent.Row).Specific.value = oDataTable.GetValue("CardCode", 0)
oForm.Update()
End If
End If
End If
The CFL-Form opens and returns the choosen value(s) at the CFL-event. But writing to MTX still not works with this code...
Maybe you find the last piece. If so: please write here.
Cheers,
Roland
p.s.:
David Nussböck wrote
LOL - ROLAND WAS FASTER ))
...just one minute...
Similar Messages
-
How to fill text with the negative of the background image
I have a picture of grass as the background. I am trying to put text on the image, and have the fill of text be colored as the negative of the background grass image colors. To represent what I wish to do, I demonstrated the color I wish to obtain inside the fill by highlighting the text over the image. Any help is appreciated. Thanks.
Pinipples,
As I (mis)understand it, you may:
1) Copy/replace the image on top of itself;
2) Invert the colours of the copy image;
3) Place the text (which may be live Type) on top of the copy image, select both (not the original image), and Object>Clipping Mask>Make. -
How to create a matrix with constant values and multiply it with the output of adc
How to create a matrix with constant values and multiply it with the output of adc
nitinkajay wrote:
How to create a matrix with constant values and multiply it with the output of adc
Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV -
How can one counter be sources (or gated) with the output of the other?
I'm trying to use the counters to generate a square pulse train that contains a certain number of pulses (on 6036E). For that I need to gate counter0 with the output of counter1. The manual seems to indicate that I need to use
GPCTR_Change_Parameter (deviceNumber, ND_COUNTER_0, ND_GATE, ND_COUNTER_1) ,
however it makes no difference to the output; I see no gating. What am I doing wrong? Am I missing something?
I would also like to source counter1 with the output of counter0. There's a similar function call to choose the source signal, but so far I've been unable to source a counter with anything but the internal timer. I guess the reason for it might be the same as the gating problem.
PetroHi Petro-
This example shows how to output a finite gated pulse train on an E Series board. It mentions that it is a CVI example, but the main .c file does not include any CVI-specific functionality so it should work if you're using ANSI C.
Equivalent functionality is available in NI-DAQmx for your board and is considerably more intuitive. An example of pause-triggered pulse train generation is available in the "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Generate Pulse\Dig Pulse Train Cont-Pause Trig" directory of your local drive. One method to generate the "pause trigger" pulse train is shown in "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Generate Pulse\Dig Pulse Train-Cont" .
I'm not sure what you mean when you say "I would also like to source counter1 with the output of counter0." What do you need to perform this operation for? The reliance of counter 1 on counter 0 and counter 0 on counter 1 creates a type of circular reference that is almost guaranteed to be problematic.
Hopefully this helps-
Tom W
National Instruments -
How create and work with Z output to meet the client requirment?
hi gurus,
I am SD functional consultant and need ur help
Please explain me how create and work with Z output .
How we arrange and change the fields in header and footer
where and how we do changes in Layouts setting and SAP scripts to meet the user requirments.
pls forward functional or Tech spec of Z output
points will be rewarded
thanx & regards
shabnumHi shabnum ,
I hope you can do it.
Goto SE71, enter form name--> click change
1) click in page window command button, Identify the header and footer window
2) single click on Header window and click change button(pencil symbol)
3) identify the fields and change order of the fields
I hope this will help to solve your issue
Regards,
SaiRam -
Apple Tv 2 has a white blinking light with the output of just the apple logo. How do I fix this?
I do not know how this happened but it won't get out of the start up screen.The 4.4 update bricked mine too. I did the restore using the USB cable on iTunes successfully but the unit still hangs on the Apple logo screen.
-
How to create Matrix with Group report layout in xml
Hi,
i would be glad if anyone could tell me How to create Matrix with Group report layout in xml?
Here i am attaching the required design doc
below is the code
select COST_CMPNTCLS_CODE,
-- crd.RESOURCES,
NOMINAL_COST,
cmm.COST_MTHD_CODE,
-- crd.COST_TYPE_ID,
gps.period_code
-- ORGANIZATION_ID
from CM_RSRC_DTL crd,
gmf_period_statuses gps,
CM_MTHD_MST cmm,
CR_RSRC_MST crm,
CM_CMPT_MST ccm
where gps.period_id = crd.PERIOD_ID
and crd.cost_type_id = cmm.cost_type_id
and crd.RESOURCES = crm.RESOURCES
and crm.COST_CMPNTCLS_ID = ccm.COST_CMPNTCLS_ID
and gps.period_code in (:p_period1, :p_period2, :p_period3)
group by COST_CMPNTCLS_CODE, cmm.COST_MTHD_CODE, gps.period_code,NOMINAL_COST
order by 1,2,3,4.
The o/p of the report shoud be as given below
Period-1 Period-2 Period-3 Period-4
COMPONENT
LABOUR - DIRECT
Actual 1 2 3 4
Actual Rate 10 10 10 10
Standard Rate
Var%
DEPRICIATION-DIRECT
Actual
Actual Rate
Standard Rate
Var%
OVERHEAD - DIRECT
Actual
Actual Rate
Standard Rate
Var%
LABOUR - IN DIRECT
Actual
Actual Rate
Standard Rate
Var%
Thanks in advanceYour friend is obviously not a reliable source of HTML
information.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Mr.Ghost" <[email protected]> wrote in
message
news:f060vi$npp$[email protected]..
> One of my friends advised me to develop my whole site on
the layout mode
> as its
> better than the standard as he says
> but I couldnot make an ordinary table with rows and
columns in th layout
> mode
> is there any one who can tell me how to?
> thanx alot
> -
How create and work with Z output to meet user req
hi gurus,
I am SD functional consultant and need ur help
Please explain me how create and work with Z output .
How we arrange and change the fields in header and footer
where and how we do changes in Layouts setting and SAP scripts to meet the user requirments.
pls forward functional or Tech spec of Z output
points will be rewarded
thanx & regards
shabnumHi
From SPRO do the all steps.
Goto SD-> BASIC functions->Output control->Output determination->Output determination by condition technique->Maintain Output determination for sales documents
Here define all like access sequences, Output types, condition tables and assign them to Program and Forms.
From SE71 copy the script to a Zscript and to modify it to suit your requirements and the same Zscript has to be assigned to Output type, Program in NACE transaction.
Reward points if useful
Regards
Anji -
How to fill tabs with textures?
Hi all,
I wondering how to fill tabs with textures, just like in the "Personal Budget" template.
I mean this:
How could I replicate this nice effect? Please help!
I already read the user manual but I won't be able to find a solution...One way is to open the template and select the table with the fill pattern. Open the table inspector
highlight the Image fill cell (in the "Cell Background" section). Copy.
Now open the application Preview in the Applications folder. Select the menu item "File > New From Clipboard" to create a new document with the image you copied. Now save the image as a pdf using the menu item "File > Save..."
Save it with a name you can remember in a location of your choice.
Now select a table in some other Numbers document and set the table background to the image you just saved by using the Table Inspctor: -
How can I print with the black and white cartridge only?
I am trying to print using the black and white cartridge only because magenta is out of ink but I'm getting the following error message in HP Photosmart C7200 series print dialog:
The printer is out of ink.
The following ink cartridges are empty: Magenta. Replace these ink cartridges to resume printing.
How can I print with the black and white cartridge only?
Mac OSX 10.7.3
HP Photosmart C7280 (7200 series)
This question was solved.
View Solution.I am absolutely disgusted by this; clearly a scam from HP to make more money by selling extra ink cartridges!! I will make sure to never buy any products from the shoddy rip off merchants at HP ever again!!
You should be ashamed!! -
How do I deal with the"new itunes library" fiasco
how do I deal with the "new itunes library" fiasco...?
Recovering your iTunes library from your iPod or iOS device: Apple Support Communities
-
My computer was reimaged and iTunes was deleted, now when I try to sync my ipad it says it is synced with another library? How do I sync with the newly installed iTunes without losing all of my data on my ipad?
Copy all the content on your iPod back to your PC and into iTunes. Then go ahead and sync the iPod with your new library.
See this older post from another forum member Zevoneer covering the different methods and software available to assist you with the task of copying content from your iPod back to your PC and into iTunes.
https://discussions.apple.com/thread/2452022?start=0&tstart=0
B-rock -
Spooling the output of a Query with out displaying the rows
Hello All,
Is it possible to spool the output of
a query/dbms_output.put_line with out displaying
the Query output on the console.
In my case,list of rows in the output is huge, I want
to eliminate displaying the output of query
so that spooling will complete faster.
Thanks in advance.
-SriniYou can do:
SET TERMOUT OFFIn your script before doing the spool command.
You will have to write your query as a .SQL script and run it from SQL*Plus in order for it to work the way you expect.
sqlplus -s username/password @query_script.SQL -
How to use labview with the handyboard
Hi,
how to use labview with the handyboard
Thx...I'm assuming you're talking about this, since you didn't provide a link for those of us who don't know what you're talking about.
As the other poster said, you didn't say how you want to use LabVIEW with it. If you want to write LabVIEW programs than run on the microprocessor, then you're out of luck. If you want LabVIEW to interact with it, then you've got a couple of options, SPI probably being the best, but it also has DI and AI that you could use to communicate with it - the DI's could be used as a parallel interface.
Message Edited by Matthew Kelton on 12-17-2007 02:21 PM -
How does it work with the iphone
i bought a time capsule but i don't know how to use it with the iphone, ipod, or ipad. can you please tell me the uses for those devices and how to use them?
TC has no direct relevance to any of the iOS devices..
They backup to iTunes on the computer, which is then backed up by Time Machine to the Time Capsule.
You can access files if you load an app like file browser.. but TC is not a media server .. it is a dumb hard disk and other than saving files there is nothing useful to do with the TC.
Maybe you are looking for
-
How to Creating a Virtual Provider in SCM 7.0 DP
Hello SCM APO DP Friends: I'm a BI guy who has fallen into the SCM 7.0 APO DP world suddenly. I would like to get a detailed list of the steps tp create a Virtula InfoProvider on a Planning Area (InfoCube) in the SCM 7.0 APO DP environment from those
-
I attempted to install Chromecast, and now my wi-fi default appears to be the Chromecast connection, not my Airport. Can no longer connect to the internet using wi-fi.
-
would it be possible to replace the lcd with say, the display from Macbook Pro HD, and pulling the wires from LCD to the mini-VGA connector with the correct adapters? Is it possible to get 1920x1200 through it or only 1440x900 since it's mirrored?
-
Error "READ_REPORT_LINE_TOO_LONG" at a report
Hi I have an error at a report, it's the first time that i see this error, Erro tpo.exec. READ_REPORT_LINE_TOO_LONG Exceção CX_SY_READ_SRC_LINE_TOO_LONG Data e hora 12.11.2008 14:57:22 Texto breve The ABAP program li
-
SAP HR upgrade from 4.7 to ERP 6.00
Can someone share some documents like presentations, Functional Upgrade Testing, Data backup, recovery or strategy for HCM functional upgrade related to a Functional Upgrade from 4.7 to ERP 6.00.. Thanks in advance.. Offline sharing is discouraged. P