How to select one row with such sql
hi , everyone
I got a headache about this sql:
select * from E_VPN_pbxlink where ((SPILOTNUM ='1234' ) or (SPILOTNUM ='123')) order by SPILOTNUM desc ;
it retruns 2 records.
I need to get the record with SPILOTNUM ='1234' , how can I reform this sql
tks
Hi,
I think I see:
You want the longest spilotnum that starts with the same charachters as the parameter.
You can do a Top-N Query like this:
WITH got_rnum AS
select e.*
, RANK () OVER (ORDER BY LENGTH (spilotnum DESC) AS rnum
from E_VPN_pbxlink
where '123456' LIKE SPILOTNUM || '%'
SELECT * -- or list all columns except rnum
FROM got_rnum
WHERE rnum = 1
;There is a slightly simplerr way, using the ROWNUM pseudo-column, but its only slightly easier, and it won't help if, say, you want to pass two or more targets such as '123456' in the same query.
Similar Messages
-
How to return one ROW with Multiple value seperated by Colon in a SQL Query
Hi,
I have a SQL query as mentioned.
select deptno
from deptI want to mofidfy this query, so that this should return me department list with colon delimeted in one ROW.
10:20:30:40.......Thanks,
DeepakIn 10g:
select rtrim(xmlagg(xmlparse(content deptno || ':')).getstringval(), ':') data
from dept;
DATA
10:20:30:40with apologies for the abuse of XML... -
How to select one row in a table with radio button
Hi all.
I have a VO where there is an attribute (isDefault [String]) that identifies the default record in the view. The possible values are 'Y' for yes and 'N' for no. Obviously only one record can have the 'Y' value.
In my page I have created an ADF Table (with the usual data control drag & drop). I would to transform the default inputText of "isDefault" field with a selectOneRadio component in order to permit the user to select (and save contextually in the DB) the default row of this table.
Can you explain me how? I'm using JDeveloper 11.1.1.4.
Thanks in advance.
BaduelBaduel wrote:
Cvele,
thanks for your responses. Yes, it's easier to use af:selectBooleanCheckbox but I need that the selection is mutually exclusive (only one row can be selected). >If this is possible also with the boolean checkbox please tell me how.- Let's try with CheckBox :
1. At the ViewObjectImpl level (for example, YourViewObjectImpl), add the following code:
private oracle.jbo.Key currSelectedRowKey = null;
public void doRowSelection(Key newKey) {
// de-select old one
if (currSelectedRowKey != null) {
Row[] rows = findByKey(currSelectedRowKey, 1);
if (rows != null && rows.length > 0)
rows[0].setStatusAsBoolean(Boolean.FALSE); // cast to the appropriate row Impl class if need !
// remember a new selected row key:
currSelectedRowKey = newKey;
}In the ViewRowImpl, in the transient attr settter, do as follows:
public void setStatusAsBoolean(Boolean value) {
setStatus(value.booleanValue() ? ONE : ZERO);
if (value.booleanValue()) {
YourViewObjectImpl vo = (YourViewObjectImpl)getViewObject();
vo.doRowSelection(getKey());
} P.S. The above was not tested at all, but should give you an idea -
How to select one row from the datatable
hi,
I have a data table which displays the employee list .the table contains 4 columns which represents the employee code,address,status like that.
when we click on particular row,the row must be selected and the total details of the employee will be displayed on the same page below the datatable.
how to write the code for this.Hi
Jsp Page
<h:dataTable value="#{bean.list}" var="role" binding="#{bean.table}">
binding- attribute need to include in dataTable tag
Bean
1> private UIData _table; as variable
2>Getter and setter Methods
public void setTable(UIData table) {
_table = table;
public UIData getTable() {
return _table;
3> Object objectName=(Object)_table.getRowData();; -- include the code in the method u wanna fetch the row data.
It'll work -
Newbie question: Select one row from table in PL/SQL
Hi,
I want to select one row from the table Employee where Emplyoyee Number is say 200. This is a simple SQL query, but I don't know the equivalent PL/SQL format. I will have 3 out params here - Id itself, Name, Salary. I will then have to populate a java resultset object from these out params.
Later, I'll have to use cursors to retrieve more than one row.
Thanks for any help.Perhaps something like
CREATE OR REPLACE PROCEDURE get_employee( l_id IN OUT employee.id%TYPE,
l_name OUT employee.name%TYPE,
l_salary OUT employee.salary%TYPE )
AS
BEGIN
SELECT name, salary
INTO l_name, l_salary
FROM employee
WHERE id = l_id;
END;Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
How to use open Row set in sql server 2014
Hello All,
How to open the row set using sql server 2014 using link server connection.Hi denyy,
Are you referring to the OPENROWSET function in SQL Server 2014?
The OPENROWSET method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. The examples below demonstrate how to use the OPENROWSET function:
A. Using OPENROWSET with SELECT and the SQL Server Native Client OLE DB Provider
SELECT a.*
FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
'SELECT GroupName, Name, DepartmentID
FROM AdventureWorks2012.HumanResources.Department
ORDER BY GroupName, Name') AS a;
B. Using the Microsoft OLE DB Provider for Jet
SELECT CustomerID, CompanyName
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb';
'admin';'',Customers);
GO
C. Using OPENROWSET to bulk insert file data into a varbinary(max) column
USE AdventureWorks2012;
GO
CREATE TABLE myTable(FileName nvarchar(60),
FileType nvarchar(60), Document varbinary(max));
GO
INSERT INTO myTable(FileName, FileType, Document)
SELECT 'Text1.txt' AS FileName,
'.txt' AS FileType,
* FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document;
GO
D. Using the OPENROWSET BULK provider with a format file to retrieve rows from a text file
SELECT a.* FROM OPENROWSET( BULK 'c:\test\values.txt',
FORMATFILE = 'c:\test\values.fmt') AS a;
Reference:
OPENROWSET (Transact-SQL)
Using the OPENROWSET function in SQL Server
Thanks,
Lydia Zhang
If you have any feedback on our support, please click
here. -
Calculating values from row to row with pure sql?
Hello,
I'm searching for a way to calculate values from row to row with pure sql. I need to create an amortisation table. How should it work:
Known values at start: (they can be derived with an ordinary sql-statement)
- redemption amount RA
- number of payment terms NT
- annuity P (is constant in every month)
- interest rate IR
What has to be calculated:
First row:
RA1 = RA - P
Z1 = (RA1 * (IR/100/12))
T1 = P - Z1
2nd row
RA2 = RA1 - T1
Z2 = (RA2 * (IR/100/12))
T2 = P - Z2
and so on until NT has reached.
It should look like
NT
P
Tn
Zn
RAn
1
372,17
262,9
109,27
22224,83
2
372,17
264,19
107,98
21961,93
3
372,17
265,49
106,68
21697,74
4
372,17
266,8
105,38
21432,25
5
372,17
268,11
104,06
21165,45
6
372,17
269,43
102,75
20897,34
7
372,17
270,75
101,42
20627,91
8
372,17
272,09
100,09
20357,16
9
372,17
273,42
98,75
20085,07
10
372,17
274,77
97,41
19811,65
11
372,17
276,12
96,06
19536,88
12
372,17
277,48
94,7
19260,76
13
372,17
278,84
93,33
18983,28
14
372,17
280,21
91,96
18704,44
15
372,17
281,59
90,59
18424,23
16
372,17
282,97
89,2
18142,64
17
372,17
284,36
87,81
17859,67
18
372,17
285,76
86,41
17575,31
19
372,17
287,17
85,01
17289,55
20
372,17
288,58
83,59
17002,38
21
372,17
290
82,18
16713,8
22
372,17
291,42
80,75
16423,8
23
372,17
292,86
79,32
16132,38
24
372,17
294,3
77,88
15839,52
25
372,17
295,74
76,43
15545,22
26
372,17
297,2
74,98
15249,48
27
372,17
298,66
73,52
14952,28
28
372,17
300,13
72,05
14653,62
29
372,17
301,6
70,57
14353,49
30
372,17
303,09
69,09
14051,89
31
372,17
304,58
67,6
13748,8
32
372,17
306,07
66,1
13444,22
33
372,17
307,58
64,6
13138,15
34
372,17
309,09
63,08
12830,57
35
372,17
310,61
61,56
12521,48
36
372,17
312,14
60,04
12210,87
37
372,17
313,67
58,5
11898,73
38
372,17
315,21
56,96
11585,06
39
372,17
316,76
55,41
11269,85
40
372,17
318,32
53,85
10953,09
41
372,17
319,89
52,29
10634,77
42
372,17
321,46
50,71
10314,88
43
372,17
323,04
49,13
9993,42
44
372,17
324,63
47,55
9670,38
45
372,17
326,22
45,95
9345,75
46
372,17
327,83
44,35
9019,53
47
372,17
329,44
42,73
8691,7
48
372,17
331,06
41,11
8362,26
I would appreciate every help and idea to solve the problem solely with sql.
Thanks and regards
CarstenIt's using Model Clause and / or Recursive With (sometimes maybe both)
Regards
Etbin
with
rec_proc(nt,i,ra,p,ir,z,t) as
(select nt,i,ra - p,p,ir,round((ra - p) * 0.01 * ir / 12,2),p - round((ra - p) * 0.01 * ir / 12,2)
from (select 48 nt,22597 ra,372.17 p,5.9 ir,0 z,0 t,1 i
from dual
union all
select nt,i + 1,ra - t,p,ir,round((ra - t) * 0.01 * ir / 12,2),p - round((ra - t) * 0.01 * ir / 12,2)
from rec_proc
where i < nt
select * from rec_proc
try to adjust initial values and rounding please
NT
I
RA
P
IR
Z
T
48
1
22224.83
372.17
5.9
109.27
262.9
48
2
21961.93
372.17
5.9
107.98
264.19
48
3
21697.74
372.17
5.9
106.68
265.49
48
4
21432.25
372.17
5.9
105.38
266.79
48
5
21165.46
372.17
5.9
104.06
268.11
48
6
20897.35
372.17
5.9
102.75
269.42
48
7
20627.93
372.17
5.9
101.42
270.75
48
8
20357.18
372.17
5.9
100.09
272.08
48
9
20085.1
372.17
5.9
98.75
273.42
48
10
19811.68
372.17
5.9
97.41
274.76
48
11
19536.92
372.17
5.9
96.06
276.11
48
12
19260.81
372.17
5.9
94.7
277.47
48
13
18983.34
372.17
5.9
93.33
278.84
48
14
18704.5
372.17
5.9
91.96
280.21
48
15
18424.29
372.17
5.9
90.59
281.58
48
16
18142.71
372.17
5.9
89.2
282.97
48
17
17859.74
372.17
5.9
87.81
284.36
48
18
17575.38
372.17
5.9
86.41
285.76
48
19
17289.62
372.17
5.9
85.01
287.16
48
20
17002.46
372.17
5.9
83.6
288.57
48
21
16713.89
372.17
5.9
82.18
289.99
48
22
16423.9
372.17
5.9
80.75
291.42
48
23
16132.48
372.17
5.9
79.32
292.85
48
24
15839.63
372.17
5.9
77.88
294.29
48
25
15545.34
372.17
5.9
76.43
295.74
48
26
15249.6
372.17
5.9
74.98
297.19
48
27
14952.41
372.17
5.9
73.52
298.65
48
28
14653.76
372.17
5.9
72.05
300.12
48
29
14353.64
372.17
5.9
70.57
301.6
48
30 -
How to compare two rows in PL/SQL?
Hi All,
How to compare two rows in PL/SQL? Is there any method that I can use instead of comparing them column by column?
Any feedback would be highly appreciated.PhoenixBai wrote:
Hi All,
How to compare two rows in PL/SQL? Is there any method that I can use instead of comparing them column by column?What "rows" are you referring to?
If you're talking of rows within a PL/SQL associative array there are techniques as described in the documentation... e.g.
SQL> ed
Wrote file afiedt.buf
1 declare
2 type v1 is table of number;
3 r1 v1 := v1(1,2,4);
4 r2 v1 := v1(1,2,3);
5 begin
6 if r1 MULTISET EXCEPT DISTINCT r2 = v1() then
7 dbms_output.put_line('Same');
8 else
9 dbms_output.put_line('Different');
10 end if;
11* end;
SQL> /
Different
PL/SQL procedure successfully completed.
SQL> ed
Wrote file afiedt.buf
1 declare
2 type v1 is table of number;
3 r1 v1 := v1(1,2,3);
4 r2 v1 := v1(1,2,3);
5 begin
6 if r1 MULTISET EXCEPT DISTINCT r2 = v1() then
7 dbms_output.put_line('Same');
8 else
9 dbms_output.put_line('Different');
10 end if;
11* end;
SQL> /
Same
PL/SQL procedure successfully completed.
SQL>If you're talking about rows on a table then you can use the MINUS set operator to find the rows that differ between two sets of data...
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20-FEB-1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02-APR-1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 09-JUN-1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19-APR-1987 00:00:00 3000 20
7839 KING PRESIDENT 17-NOV-1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08-SEP-1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20
7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30
7902 FORD ANALYST 7566 03-DEC-1981 00:00:00 3000 20
7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10
14 rows selected.
SQL> select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7521 WARD SALESMAN 7698 22-FEB-1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02-APR-1981 00:00:00 2975 20
7782 CLARK MANAGER 7839 09-JUN-1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19-APR-1987 00:00:00 3000 20
7839 KING PRESIDENT 17-NOV-1981 00:00:00 5000 10
7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30
7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10
7 rows selected.
SQL> select * from emp
2 minus
3 select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20-FEB-1981 00:00:00 1600 300 30
7654 MARTIN SALESMAN 7698 28-SEP-1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-1981 00:00:00 2850 30
7844 TURNER SALESMAN 7698 08-SEP-1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20
7902 FORD ANALYST 7566 03-DEC-1981 00:00:00 3000 20
7 rows selected.If you actually need to know what columns data is different on "non-matching" rows (based on your primary key) then you'll have to compare column by column. -
How to select a row in Jtable at runtime
how to select a row in Jtable at runtime.
use
setRowSelectionInterval(int fromRowIndex, int toRowIndex);example if your table has 10 rows then u want to select the rows from 4 to 8 then use
setRowSelectionInterval(3, 7);if you want to select just one row for example 5 then use
setRowSelectionInterval(5, 5); -
How to select a row in Grid? no a cell
Clict the grid, I want to select a whole row, not a cell
and that the Cell of Grid is readonly
how to do? thanksHi Tony,
All you have to do to select a row in the grid is, after declaring the grid, add this line.
objGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single
The above line will help you to select one row at a time in a grid.
Satish. -
Condition that takes only one row with the maximum cost of the maximum date
I have to the following query
SELECT distinct b.segment1 ||'.'|| b.segment2 as ITEM,
so.vendor_site_id as SUPPLIER,
'VE' as ORIGIN_COUNTRY_ID,
replace(round(l.mto_costo_neto/l.can_unidades_empaque,2),',','.') as UNIT_COST,
5 as lead_time,
null as pickup_lead_time,
l.can_unidades_empaque as supp_pack_size,
1 as inner_pack_size,
'C' as round_lvl,
50 as ROUND_TO_INNER_PCT,
50 as ROUND_TO_CASE_PCT,
50 as ROUND_TO_LAYER_PCT,
50 as ROUND_TO_PALLET_PCT,
null as MIN_ORDER_QTY,
null as MAX_ORDER_QTY,
'FLAT' as PACKING_METHOD,
'N' as PRIMARY_SUPP_IND,
'Y' as PRIMARY_COUNTRY_IND,
case when b.primary_unit_of_measure like '%KG%' then 'KG'
when b.primary_unit_of_measure like '%Kg%' then 'KG'
when b.primary_unit_of_measure like '%UND%' then 'EA'
when b.primary_unit_of_measure = 'Kilogramo' then 'KG'
when b.primary_unit_of_measure = 'Litro' then 'L'
when b.primary_unit_of_measure = 'Unidad' then 'EA'
else null
end as DEFAULT_UOP,
1 as TI,
1 as HI,
null as SUPP_HIER_TYPE_1,
null as SUPP_HIER_LVL_1,
null as SUPP_HIER_TYPE_2,
null as SUPP_HIER_LVL_2,
null as SUPP_HIER_TYPE_3,
null as SUPP_HIER_LVL_3,
null as CREATE_DATETIME,
null as LAST_UPDATE_DATETIME,
null as LAST_UPDATE_ID,
case when b.primary_unit_of_measure like '%KG%' then 'KG'
when b.primary_unit_of_measure like '%Kg%' then 'KG'
when b.primary_unit_of_measure like '%UND%' then 'EA'
when b.primary_unit_of_measure = 'Kilogramo' then 'KG'
when b.primary_unit_of_measure = 'Litro' then 'L'
when b.primary_unit_of_measure = 'Unidad' then 'EA'
else null
end as COST_UOM,
null as TOLERANCE_TYPE,
null as MAX_TOLERANCE,
null as MIN_TOLERANCE
FROM mrp.mrp_sr_assignments sr , MRP.MRP_SR_RECEIPT_ORG ro , MRP.MRP_SR_SOURCE_ORG so,
inv.mtl_system_items_b b, lcm.cmp_lineas_cotizacion l
WHERE sr.SOURCING_RULE_ID = ro.SOURCING_RULE_ID
and ro.SR_RECEIPT_ID = so.SR_RECEIPT_ID
and sr.inventory_item_id in ((select inventory_item_id from TMP.VIVERES_VEGETALES)
UNION ALL
(select inventory_item_id from TMP.GENERICOS)
UNION ALL
(select inventory_item_id from TMP.HIJOS_GENERICOS))
and sr.inventory_item_id = b.inventory_item_id
and b.organization_id = 136
and sr.inventory_item_id = l.cod_producto_idI need to agregate the following condition
For example, The following query
SELECT l2.fec_ini_vigencia_costo, l2.mto_costo_neto, l2.can_unidades_empaque, l2.cod_producto,
REPLACE(ROUND(l2.mto_costo_neto/l2.can_unidades_empaque,2),',','.') costo_unidad
from cmp_lineas_cotizacion l2
order by cod_producto, fec_ini_vigencia_costo desc, mto_costo_neto descgenerate
FEC_INI_VIGENCIA_COSTO MTO_COSTO_NETO CAN_UNIDADES_EMPAQUE COD_PRODUCTO COSTO_UNIDAD
17/06/2010 382.56 12 1.1000008 31.88 -- THIS ONE
17/06/2010 382.56 12 1.1000008 31.88
17/06/2010 371.0832 12 1.1000008 30.92
17/06/2010 371.0832 12 1.1000008 30.92
18/05/2009 382.56 12 1.1000008 31.88
04/05/2009 245.82 12 1.1000008 20.49
13/04/2009 382.56 12 1.1000008 31.88
23/03/2009 373.2072 12 1.1000008 31.1
23/03/2009 373.2072 12 1.1000008 31.1I need to take only one row with the maximum FEC_INI_VIGENCIA with the maximum COSTO_UNIDAD of the table lcm.cmp_lineas_cotizacion l, which is calculated with the formula ROUND(l2.mto_costo_neto/l2.can_unidades_empaque,2)A better example
I need only one row the maximum COSTO_UNIDAD for the maximum FEC_INI_VIGENCIA for every cod_producto_id in the table lcm.cmp_lineas_cotizacion
I need to take these values
FEC_INI_VIGENCIA_COSTO MTO_COSTO_NETO CAN_UNIDADES_EMPAQUE COD_PRODUCTO_ID COSTO_UNIDAD
17/06/2010 382.56 12 1.1000008 31.88 -- THIS!
17/06/2010 382.56 12 1.1000008 31.88
17/06/2010 371.0832 12 1.1000008 30.92
17/06/2010 371.0832 12 1.1000008 30.92
18/05/2009 382.56 12 1.1000008 31.88
04/05/2009 245.82 12 1.1000008 20.49
13/04/2009 382.56 12 1.1000008 31.88
17/06/2010 382.56 12 1.1000008 31.88
17/06/2010 382.56 12 1.1000008 31.88
17/06/2010 371.0832 12 1.1000008 30.92
17/06/2010 371.0832 12 1.1000008 30.92
18/05/2009 382.56 12 1.1000008 31.88
04/05/2009 245.82 12 1.1000008 20.49
13/04/2009 382.56 12 1.1000008 31.88
27/10/2010 1171.549344 12 1.1000009 97.63 -- THIS!
13/10/2010 1171.549344 12 1.1000009 97.63
06/09/2010 1171.549344 12 1.1000009 97.63
02/08/2010 1048.825056 12 1.1000009 87.4
28/07/2010 754.8 12 1.1000009 62.9
27/07/2010 614.04 12 1.1000009 51.17
21/06/2010 954.84 12 1.1000009 79.57
27/05/2010 614.04 12 1.1000009 51.17
07/07/2009 1143.17 12 1.1000010 95.26
28/03/2009 1143.17 12 1.1000010 95.26
27/10/2008 1744.644672 12 1.1000010 145.39
01/07/2008 1690.12224 12 1.1000010 140.84
07/07/2009 1143.17 12 1.1000010 95.26 --THIS!
28/03/2009 1143.17 12 1.1000010 95.26
27/10/2008 1744.644672 12 1.1000010 145.39
01/07/2008 1690.12224 12 1.1000010 140.84
07/07/2009 1143.17 12 1.1000010 95.26
28/03/2009 1143.17 12 1.1000010 95.26
27/10/2008 1744.644672 12 1.1000010 145.39
01/07/2008 1690.12224 12 1.1000010 140.84 -
Urgent : how to select the rows in the ALV Grid Control
How to select the rows in the ALV Grid control,
I am facing the situation where i need to select the row/rows in the Grid control and then to lock the entries,
If anyone have the solution please help me out
<b>Its very Urgent</b>Hi Bharath,
Go through this hope u can understand.
SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
A Multiple columns, multiple rows with selection buttons.
B Simple selection, listbox, Single row/column
C Multiple rows without buttons
D Multiple rows with buttons and select all ICON
Setting and getting selected rows (Columns) and read line contents
You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similar methods for columns.
Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
Data declaration:
DATA:
Internal table for indexes of selected rows
gi_index_rows TYPE lvc_t_row,
Information about 1 row
g_selected_row LIKE lvc_s_row.
Example 1: Reading index of selected row(s) and using it to read the grid table
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines = 0.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = 'You must choose a valid line'.
EXIT.
ENDIF.
LOOP AT gi_index_rows INTO g_selected_row.
READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
ENDIF.
ENDLOOP.
Example 2: Set selected row(s).
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines > 0.
CALL METHOD go_grid->set_selected_rows
exporting
it_index_rows = gi_index_rows.
ENDIF.
Reward points if helpful.
Thanks
Naveen khan -
How to select multiple row in ALV report
Hi friends,
1. How to select multiple row in ALV report
( How to set tab in ALV report and want to select multiple line.)
Thanking you.
SubashHi Sahoo,
If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
in layout structure you will find field SEL_MODE
pass :
LS_LAYOUT-SEL_MODE = 'A'.
In PAI.
CALL METHOD GRID->GET_SELECTED_ROWS
IMPORTING
ET_INDEX_ROWS = T_ROWS
ET_ROW_NO = T_ROWID.
Hope these will solve your problem.
Regards,
Kumar M. -
How to update one row in AdvancedDataGrid
My App have a AdvancedDataGrid and it has so much rows. Some
data rows for AdvancedDataGrid has changed and i don't want to
update all rows ... But i don't know how to update one row for my
AdvancedDataGrid
Some body help me ...
Thanks so muchs !thanks ntsii.
my problem is:
[Bindable]
var dp:ArrayColection = new ArrayColection({...});
<mx:AdvancedDataGrid dataProvider="{dp}">
<mx:groupedColumns>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
//==================================
in my dp have more rows and some time one of them is changed
then i guess the AdvancedDataGrid must build all rows when
it's dataProvider (dp) have changed.
And i don't want to that...
But i am not sure the AdvancedDataGrid buld all rows from
begin to end ... i don't know.. ! -
How to select a row in datagrid by checking the check box in that row
how to select a row in datagrid by checking the check box in that row.
Im using <html:checkbox> tag, and also a VO which is in request scope. i wanna display the values in the VO in a row and corresponding to this i want a checkbox..
Thanx in advance
Message was edited by: me
Hemanth@SA
Message was edited by:
Hemanth@SAHello,
I got the solution:
final int pRow = row;
final int pCol = column;
final JTable myTable = mytable;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
myTable.requestFocusInWindow();
myTable.changeSelection(pRow, pCol, true, true);
Maybe you are looking for
-
Is there a way to create a group in contacts without individual contact cards
I need to send emails to 100 people at a time. The addresses are in an excel spreadsheet. How can I create a group without having to create a contact card for each individual? I'm using Mountain Lion.
-
Can you merge Iphone data from a new iphone with an old back up?
I am looking for some advice. I recently had my my iPhone and my MacBook Pro stolen at the same time. Fortunately I managed to get a new iPhone on my insurance which I received before I bought myself a new MacBook. I resorted my MacBook from a back u
-
Firewire drives work individually; fail when daisy chained
I have 3 FW400 drives daisy-chained. All was fine until a couple of weeks ago when I started having problems with drives randomly freezing up or unmounting, especially when writing large amounts of data (e.g., during a backup.) Despite multiple repai
-
What is BCP number or External ID for an Incident?
As I raise an incident in the tenant (C4C), an Incident Number is generated for e.g. 1000000260. Is this same as External ID or BCP number ? How to get the external ID or BCP number associated to an incident ? Any clues ? Thanks, Sachin.
-
Duplicate a text field in LC & get the Text automaticaly in the 2nd
Hi I want to duplicate a text field the problem is that i want something more when i write in the first "Text Field" i would like that the same Text appears automaticaly in the second "Text field" We can do it in Acrobat Pro but i don't know in LC T