How to insert by sdk a row in grid
Hi
I have a grid with 9 columns, the grid is empty
I want to insert the rows one by one in the updating
Thank you
Like that
col1 col2 col3 col4 col5 ... col 8
aaa
bbb bbb ccc ddd
eee eee fff ffdd
bbb ddd ddd eee eee
fff ffff
Hi
I created a grid with columns needed
I use a SQL query to retrieve my fields
I read the query and I populate the grid manually
An example of code
Dim oChaineSql As String
oform = SBO_application.Forms.Item(FormUID)
oitem = oform.Items.Add("GridLot", SAPbouiCOM.BoFormItemTypes.it_GRID)
' Set the grid dimentions and position
oitem.Left = 20
oitem.Top = 200
oitem.Height = 150
oitem.Width = 650
oGrid = oitem.Specific
Dim oDataTabe As SAPbouiCOM.DataTable
oform.DataSources.DataTables.Add("MyTable")
oDataTabe = oform.DataSources.DataTables.Item("MyTable")
oDataTabe.Clear()
oDataTabe.Columns.Add("0", BoFieldsType.ft_AlphaNumeric)
oDataTabe.Columns.Add("1", BoFieldsType.ft_AlphaNumeric)
oChaineSql = "Select Field1 , Field2 , .... from File1 "
Dim vRS As SAPbobsCOM.Recordset
Dim Kk As Integer = -1
vRS = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
vRS.DoQuery(oChaineSql)
vRS.MoveFirst()
While Not vRS.EoF
Kk += 1
oDataTabe.Rows.Add()
oDataTabe.SetValue("0", Kk, vRS.Fields.Item("code").Value)
vRS.MoveNext()
End While
oGrid.DataTable = oform.DataSources.DataTables.Item("MyTable")
oGrid.AutoResizeColumns()
oGrid.CollapseLevel = 1
oitem = oform.Items.Item("GridLot")
oitem.Visible = True
Similar Messages
-
How to insert a set of rows at a time from another table
Hello!
I have a table1 and table 2 - i want to insert a set of rows at a time from table1 to table 2. Then do a COMMIT. Then continue inserting another set of rows and so on.... say i want to insert into table 2 i million records at a time and then do a commit. then continue with the next 1 million and do a commit and so on..until there are no more records in table 1
Any ideas please!!!!!!!!!!may be this will help
declare
cursor c1
select * from table1
i_counter binary_integer := 1;
begin
for c1_rec in c1
insert into table2
values(c1_rec.,..);
if i_counter = 1000? then
commit;
i_counter = 1;
end if;
i_counter := i_counter+1;
end loop
end; -
Web Dynpro for ABAP:How to insert and delete a row in a table
I have a table.
My requirement is to insert a row into the table and i want to delete a particular row also.
How can i do it.
Plz reply me..Try the Web Dynpro for ABAP forum:
Web Dynpro ABAP
Kind Regards
Stefanie -
How to insert and delete a row after filter applied
I thought I had figured out the solution to this problem but apparently not...
How do you insert a new row into a JTable after a filter has been applied? The problem is once the data is filtered when I add a row, I'm getting an ArrayIndexOutOfBoundsException : 182 which is the number of rows for the entire dataset.
The first line in the exception is: DefaultRowSorter.setModelToViewFromViewToModel
I've tried to use, getRowSorter().convertRowIndexToView(int) but I can't get it to work. Can anyone offer any assistance?
ThanksI also got that problem recently and after debuging for a while I figured out, that it was resulting from an error in my table's model: When the model received new items to display I
1.) Fired an delete event for the old items
2.) Fired an insert event for the new items
Problem was that when firing the delete event I didn't already assigned the new items to the model. Therefore it had still the old row count.
Maybe you have also a faulty table model?... -
How to insert more than one row in an Oracle table in one go
Hi All,
I am working on a file-XI(BPM)-Oracle scenario.
I am sending an xml file to XI via a file adapter. On the receiver end i am using a jdbc adapter to insert the row in the database. There is a transformation step within the BPM which is converting the file to a format understood by the JDBC adapter.
The problem i am facing is that, even if my input xml file contains more than one recordset, only one row is created in the database with the first recordset.
How can i insert all the other recordsets in the database at the same time.
Pls guide
Thanks in advance.
Regards
NeetuHi,
As asked by Bhavesh, i set the occurence of the STATEMENT tab 1 to UB. But still only one row is getting updated in the database at a time.
As asked by Udo, i even tried the same by changing the occrence of ACCESS tab 1 to UB. But still same thing happened.
Can there be some other problem.
The transformation is being dane in the BPM.
As seen in SXMB_MONI, the input xml to the BPM has two RECORDSET tags but the output generated xml in the format understood by jdbc adapter has a single STATEMENT tag.
The two formats are given below
<b>Input:</b>
<?xml version="1.0" encoding="utf-8"?>
<ns:MT_Test_File xmlns:ns="http://namespace-EmpNumberGen">
<EmpGenRecord>
<APPLICANT_NO>20</APPLICANT_NO>
<FIRST_NAME>abc</FIRST_NAME>
<LAST_NAME>xyz</LAST_NAME>
<FUNCTION>ADMIN</FUNCTION>
<DESIGNATION>ZA</DESIGNATION>
<RESPONSIBILITY_LEVEL>dd</RESPONSIBILITY_LEVEL>
<RECRUITMENT_TYPE>dd</RECRUITMENT_TYPE>
<EMPLOYEE_TYPE>p</EMPLOYEE_TYPE>
<STATUS>A</STATUS>
<***>M</***>
</EmpGenRecord>
<EmpGenRecord>
<APPLICANT_NO>14</APPLICANT_NO>
<FIRST_NAME>abc</FIRST_NAME>
<LAST_NAME>xyz</LAST_NAME>
<FUNCTION>ADMIN</FUNCTION>
<DESIGNATION>ZA</DESIGNATION>
<RESPONSIBILITY_LEVEL>dd</RESPONSIBILITY_LEVEL>
<RECRUITMENT_TYPE>dd</RECRUITMENT_TYPE>
<EMPLOYEE_TYPE>p</EMPLOYEE_TYPE>
<STATUS>A</STATUS>
<***>M</***>
</EmpGenRecord>
</ns:MT_Test_File>
<b>Output</b>
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Emp_No_Generation xmlns:ns0="http://namespace-EmpNumberGen">
<Statement>
<SAP_EMPGEN action="INSERT">
<access>
<APPLICANT_NO>20</APPLICANT_NO>
<FIRST_NAME>abc</FIRST_NAME>
<LAST_NAME>xyz</LAST_NAME>
<FUNCTION>ADMIN</FUNCTION>
<DESIGNATION>ZA</DESIGNATION>
<RESPONSIBILITY_LEVEL>dd</RESPONSIBILITY_LEVEL>
<RECRUITMENT_TYPE>dd</RECRUITMENT_TYPE>
<EMPLOYEE_TYPE>p</EMPLOYEE_TYPE>
<STATUS>A</STATUS>
<***>M</***>
</access>
</SAP_EMPGEN>
</Statement>
</ns0:MT_Emp_No_Generation>
This is a bit urgent.
Pls help
Regards
Neetu -
How to INSERT INTO a specific row?
I have a form with a calendar at the top, below it is a list of items each with a check box.
Here is a wonderful visual of it -
Calendar
Checkbox | Col | Col | Col
Checkbox | Col | Col | Col
Checkbox | Col | Col | Col
I want it so you select the date and it gets passed into the database in the same row as the one (definitely one, multiple is better) that has been checked by the user.
I was trying an INSERT INTO with a WHERE statement but apparently you can't do that. So if I can use a WHERE with INSERT INTO, how can I identify which row to insert the info?
Currently it is passing the dates but it creates a new row.
I didn't think posting the code is neccisary for this question but if anyone wants to see it let me know and I will post it.
THANKS!Ah, ok, I will try UPDATE.
Right now my form looks like this...
<cfform name="requestform" role="form"action="resources/requestform.cfm" method="post" width="375" height="350" >
<label for="startdate">Start Date:</label>
<label for="enddate">Finish Date:</label>
<cfcalendar name="selectedDate"
selectedDate="#Form.selectdate#"
startRange="#Form.startdate#"
endRange="#Form.enddate#"
mask="mmm dd, yyyy"
dayNames="SU,MO,TU,WE,TH,FR,SA"
firstDayOfWeek="1"
monthNames="JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC"
style="rollOverColor:##FF0000"
width="200" height="150">
<cfinput type="dateField" name="startdate" label="Start Date" width="100" value="#Form.startdate#">
<cfinput type="dateField" name="enddate" label="End Date" width="100" value="#Form.enddate#">
</div>
<cfinclude
template = "resources/query.cfm">
<span class="label label-default">Equipment List</span>
<table class="table table-bordered table-striped">
<tr>
<td><b>Select</b></td>
<td><b>Name</b></td>
<td><b>Description</b></td>
<td><b>Status</b></td>
</tr>
<cfloop query = "equiplist">
<cfoutput>
<tr>
<td>
<cfinput name="status" type="checkbox" value="#serial#">Select:</cfinput>
<cfinput name="serial"type="text"style="display:none" value="#serial#">
</td>
<td>#name#</td>
<td>#descrip#</td>
<td>#status#</td>
</tr>
</cfoutput>
</cfloop>
</table>
<cfinput class="btn btn-default" type="Submit" value="Submit" name="addsubmit"></cfinput>
</cfform>
And the action page looks like this...
<cfquery
name = "requestform"
dataSource = "db_cie">
UPDATE equip
SET STATUS="Out",
WHERE serial='#status#'
</cfquery>
<cflocation
url = "../request.cfm">
But I am getting an error "invalid.user.table.column, table.column, or table specification. But the error message shows the SQL output and it looks correct...UPDATE equip SET STATUS="Out" WHERE serial="325255"... it IS getting the serial number variable passed from the form. ...No update though. Is my action form written wrong? -
How to Insert Record with multiple rows
Hello alls,
i want to ask something... how to use insert record server behavior - php myysql, to insert multiple rows from textfiled?
thanks.It would have been more helpful if you had shown me your existing code. However, this shows the basic principles.
First of all, the name of each input field in the form needs to end in an empty pair of square brackets like this:
<input type="text" name="field_name[]" . . .
This results in $_POST['field_name'] being treated as an array of the values in each input field. Change field_name to the actual name of the input field. Without the square brackets, only the last value is submitted by the form.
The Insert Record server behavior code looks like this:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO my_table (field1, field2) VALUES (%s, %s)",
GetSQLValueString($_POST['field1'], "int"),
GetSQLValueString($_POST['field2'], "text"));
mysql_select_db($database_connAdmin, $connAdmin);
$Result1 = mysql_query($insertSQL, $connAdmin) or die(mysql_error());
$insertGoTo = "another_page.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
You need to amend it like this:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
mysql_select_db($database_connAdmin, $connAdmin);
// loop through the input values
for ($i = 0, $len = count($_POST['field1']); $i < $len; $i++) {
$insertSQL = sprintf("INSERT INTO my_table (field1, field2) VALUES (%s, %s)",
GetSQLValueString($_POST['field1'][$i], "int"),
GetSQLValueString($_POST['field2'][$i], "text"));
$Result1 = mysql_query($insertSQL, $connAdmin) or die(mysql_error());
} // end loop
$insertGoTo = "another_page.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
This uses a for loop (see http://docs.php.net/manual/en/control-structures.for.php) to access each element of the $_POST['field1'] and $_POST['field2'] arrays (see http://docs.php.net/manual/en/language.types.array.php). -
HOW TO - Insert large number of rows fast
I have a tables A , B and C and I select some data from A, B and C using some complex criteria.
Table A B and C has 10mil rows.
final rows to be insert into table D is about 3mil.
Currently the rows are inserted one at a time and there are 3 mil inserts in the plsql.
What is the best way to create these rows.
psudocode
begin
for loop ..... loop
--compled selection criteria.
insert into D ..... ;
end loop ;
end ;
SSis there a way to optimize the inserts.The inserts takes very little time
Re: Insert Statement Performance Degradation
In this example the same number of inserts into the same table takes 0.03 seconds to insert 100,000 rows, and 3.06 seconds when looped. If the entire insert operation was optimized away to take zero time, the loop would still take 3.03 seconds, which represents a performance increase of a little under 1%.
As I said it is not a single query by which I build a row for insert into table D, It is
a complex operation which is not necessary to explain here.This is the slow part that needs optimizing. -
How to insert column values into database as rows
Hi,
I have 8 columns and some not null columns. Based on not null columns I want to insert into table as rows. The 8 columns may contain values or no value. If the first column contains data, then I have to insert into one row. if the second column contains data I have to insert a row and in second column. respectively...So How can I insert column values into rows. Can I write 8 insert statements. (OR) is it possible to insert data from columns using where clause.
Please help me out....
Thanks in AdvanceLines Table:
line_id, orcl_bank_account_num, product_type, service_type, lease_type,
funding_type, cpi, billing_frequency_unit_cd , annual_due_date ,
pricing_start_date, pricing_end_date, install_date, contract_end_date ,
prdct_replacement_cost_amt, cradle_replacement_amt, supranet_contract,
issuance_fee, board_inactive_date, header_id, creation_date, last_modified_date,
created_by_nam, modified_by_nam, activeinactive_flg, prdct_bill_amt_yr1,
prdct_bill_amt_yr2, prdct_bill_amt_yr3, prdct_bill_amt_yr4, prdct_bill_amt_yr5,
prdct_bill_amt_yr6, prdct_bill_amt_yr7, prdct_bill_amt_yr8, activation_fee_yr1,
activation_fee_yr2, activation_fee_yr3, activation_fee_yr4, activation_fee_yr5,
activation_fee_yr6, activation_fee_yr7, activation_fee_yr8,
In this table the columns structure is :
-- PRDCT_BILL_AMT_YR (1 to 8) NUMBER(14,4)
-- ACTIVATION_FEE_YR (1 to 8) NUMBER(8,2)
I have one more table:
PRDCT_INS_AMT NUMBER(14,4)
ACTIVATION_FEE_AMT NUMBER(14,4)
I want to insert prdct_bill_amt_yr (1 to 8) columns data into PRDCT_INS_AMT column. similarly activation_fee (1 to 8) columns data.
But the data should be inserted based product_type, service_type, lease_type columns values. (These 3 columns may contain upto 45 combinations). -
how to insert a row in oracle if we have three colums all are number datatype i want one of the column blank;
Hi,
James has replied to your question ..
you seem to be new to sql
just adding to it for you information.. that in this case col2 will have NULL value.
I suggest you may please read the startup docs... They shall help you to unserdstand the sql better.
http://www.w3schools.com/sql/default.asp
Regards -
How to insert 10 rows at a time in the oracle
how ti insert r update 10 query at a time in the oracle
You can do a small test to find it out.
SQL> set serveroutput on
SQL> drop table t
2 /
Table dropped.
SQL> drop table s
2 /
Table dropped.
SQL> create table s(no integer, name varchar2(4000))
2 /
Table created.
SQL> create table t(no integer, name varchar2(4000))
2 /
Table created.
SQL> insert into s
2 select level, rpad('*',4000,'*')
3 from dual
4 connect by level <= 10000
5 /
10000 rows created.
SQL> commit
2 /
Commit complete.
SQL> declare
2 ltime integer;
3 begin
4 ltime := dbms_utility.get_time;
5
6 for i in (select * from s)
7 loop
8 insert into t(no, name) values(i.no,i.name);
9 end loop;
10
11 ltime := dbms_utility.get_time - ltime;
12
13 dbms_output.put_line('Exec Time:'||ltime/100||' Seconds...');
14 commit;
15 end;
16 /
Exec Time:17.22 Seconds...
PL/SQL procedure successfully completed.
SQL> truncate table t
2 /
Table truncated.
SQL> declare
2 type my_type is table of s%rowtype;
3 lType my_type;
4 ltime integer;
5 begin
6 ltime := dbms_utility.get_time;
7
8 select * bulk collect into lType from s;
9
10 forall i in 1..lType.count
11 insert into t values lType(i);
12
13 ltime := dbms_utility.get_time - ltime;
14
15 dbms_output.put_line('Exec Time:'||ltime/100||' Seconds...');
16
17 commit;
18 end;
19 /
Exec Time:6.27 Seconds...
PL/SQL procedure successfully completed.
SQL> truncate table t
2 /
Table truncated.
SQL> declare
2 ltime integer;
3 begin
4 ltime := dbms_utility.get_time;
5
6 insert into t select * from s;
7
8 ltime := dbms_utility.get_time - ltime;
9
10 dbms_output.put_line('Exec Time:'||ltime/100||' Seconds...');
11
12 commit;
13 end;
14 /
Exec Time:3.26 Seconds...
PL/SQL procedure successfully completed.Thanks,
Karthick. -
How to insert multiple rows in same table at once
hi ,
How can I insert more than one row in the same database table on single submit button.
(i am using the ADF , EJB and Toplink for this example.)
EMPLOYEEand DEPARTMENT tables will hold a common coloum deptno
The method I have tried is as follows.
I have created the UI that holds EMPLOYEE(DETAIL) details and a DEPARTMENT(MASTER) table and I have created two separate bean classes which hold the getters and setters for the corresponding tables.
I have created a method in Department bean which will be called when we add the employee details
public String addEmpdetails() {
this.employeedetailslist.add(empdetails);
return null;
where employeedetailslist is a Arraylist and I want to pass the reference of employeebean in the array list.
But this method will fail as I need to create the new employee bean object every time when ever I need to pass.
How can I store values of multiple rows in bean.
In the EJB session bean how can I commit multiple EMPLOYEE rows and DEPARTMENT values at once.The use of &variable in a script is actually syntax for a "substitution variable" in the SQL*Plus tool (other tools may also do the same), not an inherent part of SQL or PL/SQL itself.
Whenever SQL*Plus is given a script it parses through it and if it encounters one of these it prompts for a value. This value is then substituted into the script before the script actually get's sent to the SQL or PL/SQL engine (process) on the database server. Once the script has gone to the database server it executes there and the results are passed back for SQL*Plus to display. However, the SQL and PL/SQL processes on the database server have no way to interface to the client machine, so they themselves cannot prompt for input from the client and you can't expect to prompt inside a loop as you are doing.
What you need is a user interface on the client that can prompt repeatedly for values and then re-send the script, or call a procedure on the database each time. This can be done using shell scripts or dos batch files (depending on your client being unix/dos based) or using a front end application tool such as Java, .NET, Powerbuilder, PHP, Application Express (APEX) etc. -
How to insert line or row in a table?
Hi OAF experts,
can anyone show me how to insert row or line in a table bean by setting the table.setAutoInsertion(false) ?
Thank you.
JonAs per Dev Guide:---
The other change you can make is to suppress the default Add Another Row button behavior of adding a
single row to the view instance associated with the table, so that you can handle the event with your own code.
The following code example illustrates how to accomplish this:
processRequest
// Enabled add row and turn off the default "Add Another Row" table event
// The add row event has to be auto-handled by developer in processFormRequest
tableBean.setInsertable(true);
tableBean.setAutoInsertion(false);
processFormRequest
if ((tableBean.getName()Equals(pageContext.getParameter(SOURCE_PARAM))) &&
(ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM))))
OAApplicationModule am = pageContext.getApplicationModule(tableBean);
am.invokeMethod("handleInsertRow", null);
// The ***AMImpl.java in which method "handlInsertRow" has been defined
public void handleInsertRow()
OAViewObject vo = findViewObject("voName");
vo.invokeMethod("handleInsertRow");
// The ***VOImpl.java which is associated with the table; and in which the
// handleInsertRow is defined
public void handleInsertRow()
Row row = createRow();
// Set any default attributes
row.setAttribute(...);
// Insert the row into the VO
insertRow(row);
Thanks
--Anil -
How to insert a new row in the middle of an set of rows
Hi
How to insert a new row in the middle of an set of rows ? and How to Reset the line id after the new row added ?
Regards,
Sudhir B.Hai,
just try this,
Instead of using omatrix.Addrow(1,-1) use like
omatrix.AddRow( RowCount , Position)
RowCount
The number of rows to add (default is 1)
Position
The position of the new rows (0-based; default is -1, meaning append row to the end)
After adding rows in matrix For, sno.
for i=1 to omatrix.visualrowcount
otext=omatrix.getcellspecific("columnid",i) '--where columnid is the unique id of the sno column
otext.value=i
next i
Hope this helps you.
Thanks & Regards,
Parvatha Solai.N -
How to insert a table with variable rows in smart form
Hi all,
How to insert a table with variable rows in smart form?
Any help would be appreciated.
Regards,
Mahesh.Hi,
Right click the mouse->create->table
If you want 5 columns, you need to declare 5 cells in one line type of the table
Click on Table -> Details, then do the following
Line Type 1 2 3 4 5
L1 2mm 3mm etc
Here specify the width of the columns as many as you want..
then in the header/main area of the table, click create Table Line, Rowtype is L1, automatically 5 cells will come,In each cell create a text element, display the variable to be printed there.
Maybe you are looking for
-
Upgrading the HD in a 700MHz iMac G4 Flat Panel
I want to upgrade my iMac to a bigger HD. I was told these older iMacs can only read up to 160GB hard drive and it needs to be an IDE drive? Is this true? What's the largest capacity I can go on an older iMac such as mine? Thanks.
-
A good program to record WAVE to dvd 1 & 2 laye
I have Audigy 4 pro , what I found is that I can't find a program that records wave to dvd & or 2 layer (it would be good if it burned cd too.) Can anyone recommend a program that will do this ( it would be nice if it did not break the bank if you kn
-
Backing up mac backs up windows files thru parallels?
Do I need to backup my Windows files & programs separetly from my Mac backups. Currently using Time Machine, but out of space on my current EHD (500 GB). Planning to purchase a larger EHD (2-3 TB?). Any suggestions? Will Time Machine automatically b
-
ADF BC - Database session setting in AM
Hi, I would like to call a database procedure whenever a user logs into the application. They can come from any page so I don't want it to be page specific. I am using container managed security and want to find current user using getUserPrincipal AM
-
This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C6AB1B.755FB0F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Yes I want to use css for this. I have an xml doc being pulled into my