On select delete rows
Hi , I have a custom page with Add Row button. On click of button it adds new rows.
Now new requirement has come ,to add new button delete rows. For this a check box should be added against each row and on select of check box and delete the row should be deleted.
How to capture the selected row? The above said is all new requirement.How to proceed on this ? pl help me on this requirement.
Thanks,
Ragahv
Hi,
Now get all the rows in an row[] array and for each check whether that transient attribute is 'Y' or not.
If it is selected, then remove that row. Below is sample code for the same:
deleteMethod() {
XxVOImplvo = getXxVO1();
Row row[] = vo.getAllRowsInRange();
For (int i =0; i<row.length;i++) {
XxVORowImplrowi = (XxVORowImpl) row;
if ("Y".rowi.getTransAtt().toString()) {
rowi.remove();
getOADBTransaction.commit();
return;
--Sushant
Similar Messages
-
What is the keyboard shortcut for "delete row" in a table?
What is the keyboard shortcut for "delete row" in a table within a pages document?
Click on the row number to select the entire row. Right-click, and select Delete Row from the menu. There is no keyboard shortcut.
-
How can I select and delete rows based on the value in one column?
I searched through the discussion board, and found a thread on deleting blank rows, but not sure how to modify it to work with my issue.
I have put together a rather complicated spreadsheet for designing control systems, it calculates parts needed based on check boxes selected in a second spreadsheet.
Since not all systems require all parts there are many rows that have a 0 quantity value, I would like to select these rows and delete them once I have gone through the design phase (checking off required features on a separate sheet).
I like the way the other thread I found will gather all the blank rows at the bottom without changing the order of the rows with data in them.
I don't understand exactly how the formula in the other thread works well enough to modify it to look for a certain column.
I hope I made myself clear enough here, to recap, I would like to sort the rows based on a zero value in one (quantity) column, move them (the zero quantity rows) to the bottom of the sheet, and then delete the rows with a zero quantity (I can delete them manually, but would like to automate the sorting part).
Thanks for any help anyone can provide here.
DannyI apologize but, as far as I know, Numbers wasn't designed by Ian Flemming.
There is no "this column will be auto-destructing after two minutes"
You will have to use your fingers to delete it.
I wish to add a last comment :
if your boss has the bad habit to look over your shoulder, it's time to find an other one.
As I am really pig headed, it's what I did. I became my own boss so nobody looked over my shoulder.
Yvan KOENIG (VALLAURIS, France) mercredi 13 juillet 2011 20:30:25
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer ! -
Selective deletion of a row from a cube
Hi Friends,
I need to delete a row from a cube through selective deletion from manage tab. I had struck while giving selecting the criteria for that deletion.
My Quesion is;
1) What criteria i need to give to delete the row apart from business related information?
2) What is data packet SID ? what i have to mention in that column?
3) What is Request id SID? what i have to mention in that column?
Please help me on the above issue.
regards,
MaheshHallo
Of xourse you do it for example from Infoprovider, right click maanage, Content (first tab) Selective deletion.
Then you get a tab where you can schedule the job according to the selections in the tab Selective Deletion where you can set a filter for the characteristics included in the Cube.
You can select single Characteristics vlue oder range or multiple.
If you want to dlete a record than you have to know the key of this records. For example if you have
customer
company
month
if you select only month, then you delete all month but if you restrict to month and cusotmer than you delete the combination of them.
Reuest sid is the identifier of the request which you see on the tab manage of the cube. you select on that and in this case you will delete all request it means all records loaded with the request.
http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
Mike
Best Regards
Mike -
Multiple selection of rows and delete the same
hi how can we select the multiple rows in a table and delete the same.
if i have 3 rows i have to select 2 rows and if i press the delete button the selected rows should be deleted.
Can any one help me .
Thanks
Badrihi
in the layout of the screen u might have dragged and dropped the table control
double click on it u will get attributes screen in that u select MULTIPLE under Line-Selection
under attributes tab.
the internal table in table control must be like
data : begin of itab occurs 0,
empno type .......,
empname......,
empcity.....,
check(1), " for tab selection"
end of itab.
data : itab1 like itab occurs 0 with header line.
in the attributes screen of the table control
pass the value ITAB-CHECK to the field W/SELECTION
in SE51
PBO
Module_status_0800
loop with control table_control_name.
module_fill_tcontrol.
endloop.
PAI
Module_user_command_0800
loop with control table_control_name.
module_read_tcontrol.
endloop.
in se38
Module_fill_tcontrol.
endmodule.
Module_read_tcontrol.
READ TABLE itab1 INDEX control-current_line.
IF sy-subrc EQ 0.
MODIFY itab1 FROM itab INDEX control-current_line.
ELSE.
MOVE-CORRESPONDING itab TO itab1.
APPEND itab1.
CLEAR itab1.
ENDIF.
endmodule.
module_user_command.
case sy-ucomm.
WHEN 'DELE'.
DELETE itab1 WHERE check = 'X'.
endcase.
endmodule.
Regards
Murali.M -
How to add or delete rows in tablecontrol?
Hi,
I am using a tablecontrol to enter data records.
I want to use 2 buttons, one to insert a row into a tablecontrol and another to delete a selected row of a tablecontrol.
How do I insert or delete rows of a tablecontrol?
Thanks.Hi Kumar,
Please look at the below sections......
ADDING BLANK LINES
To add blank lines to table control we do not need to change any of the fields of the structure CXTAB_CONTROL simply adding blank lines to the internal table will do.
INSERT INITIAL LINE INTO itab.
DELETING SELECTED ROWS
Deletion of selected rows is simple. To delete selected rows first we will determine the rows which have been selected through selection column .
FOR SINGLE ROW SELECTION
IF mark EQ 'X' . "mark is the name of selection column field
DELETE itab FROM workarea .
ENDIF.
FOR MULTIPLE ROW SELECTION
*To deetermine the rows selected we will use the selection column field to loop
*through the internal table.
LOOP AT itab WHERE mark EQ 'X'. "mark is the name of selection column field
DELETE itab " and is part of the internal table .
ENDLOOP.
Thanks,
Ravi Kanth -
Delete Rows from T1 which are Not in T2
Hi
I've 2 Tables like below
T1
N1
N2
2
11
2
22
3
33
8
44
8
88
T2
N1
N2
2
22
8
88
If I Run Delete query, I must delete Rows from T1 which are Not in T2
For example, I must delete Rows 1,3,4 from T1
So how to write that delete query? Please adviceDelete from T1
Where not Exists (select * from T2 Where t1.N1=t2.N1 and t1.N2=t2.N2)
--or
Delete t
From t1 t
left JOIN t2 m
ON m.N1=t.N1 and m.N2=t.N2
WHERE m.N1 is null and m.N2 is null
--Or
;With mycte as
select N1,N2 from T1
Except
select N1,N2 from T2
Delete t
From t1 t
INNER JOIN mycte m
ON m.N1=t.N1 and m.N2=t.N2 -
Table compare deleting rows which does not exist in target table
Hi Gurus,
I am struggling with an issue in Data Services.
I have a job which uses Table Compare, then History Preserving and then a Key Generation transforms.
There is every possibility that data would get deleted from the source table.
Now, I want to delete them from the target table also.
I tried Detect deleted rows but it is not working.
Could some one please help me on this issue.
Thanks,
Raviteja.Doesn't history preserving really only operate on "Update" rows. Wouldn't it only process the deletes if you turned the "Preserve Delete row(s) as update row(s)" on?
I would think if you turned on Detect Delete rows in the Table compare and did not turn this on in the history preserving it would retain those rows as delete rows and effectively remove them from the target.
Preserve delete row(s) as update row(s)
Converts DELETE rows to UPDATE rows in the target warehouse and, if you previously set effective date values (Valid from and Valid to), sets the Valid To value to the execution date. Use this option to maintain slowly changing dimensions by feeding a complete data set first through the Table Comparison transform with its Detect deleted row(s) from comparison table
option selected. -
How to select perticular row in table control for BDC
Hi all
I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
Please Suggest me. it urgent.
Thanks& Regards,
RPHi all
I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
Please Suggest me. it urgent.
Thanks& Regards,
RP -
Deleting row from a table binded to a matrix
Hi all
i have a form with a matrix binded to a user table which is handled as a Master Data lines by UDO.
i want to enable deleting lines from the table by selecting a row in the matrix and clicking a delete button.
currently i'm handling the click event by usint the method DeletRow of the matrix object.
when i press the Update button (UID = "1"). the fact that a row was deleted from the matrix does not affect the bounded table.
my question is how in code can i cause the deletion of a row from the matrix to also be deleted from the database table?
appreciate the help
YoavHi Yechiel
flushToDatasource make the following:
Flushes current data from the GUI to the bounded data source using the following process:
1)Cleans the data source.
2)Copies each row from the matrix to the corresponding data source record.
In other words: This method load data from Matrix to DataSource (but not to database)
the next step is update database from userdatasource
Note: You migth read sdk help for more information -
Delete row in a table (not ALV)
i have a table on my web-dynpro-view. I defined a delete-Button and a method with some coding.
If the User marks a row and press the button, the row is deleted. Here's the code:
METHOD onactioneintrag_loeschen .
DATA: wd_node TYPE REF TO if_wd_context_node,
wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set.
wd_node = wd_context->get_child_node( name = 'LV' ).
CALL METHOD wd_node->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
wd_node->remove_element( EXPORTING element = wa_temp ).
ENDLOOP.
ENDMETHOD.
My problem: in the context-change-log i can't identify the deleted rows. It's impossible to make a difference between a change of selection and a delete.Hi David,
You can declare one attribute in the view of type ur row.
and store the deleted row in this attribute in ur delete method.
DATA: wd_node TYPE REF TO if_wd_context_node,
wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set.
wd_node = wd_context->get_child_node( name = 'LV' ).
CALL METHOD wd_node->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
<Attribute_name> = wa_temp .
wd_node->remove_element( EXPORTING element = wa_temp ).
ENDLOOP.
ENDMETHOD.
Hope this will help you.
Thanks & Regards,
Arvind -
How to Delete rows in the database table by using Table Control
Hi Experts,
I wrote one program.
In that program i used table control.
I displayed data from database table in the table control, but i want to delete selected rows.
Can anybody please tell me this by writing sample code
thank you
BasuHi ,
Pls try this coding below or check the prg demo - RSDEMO02 in se38
WHEN 'DELL'.
* remove marked lines
LOOP AT IT_SPFLI WHERE MARKED = 'X'.
DELETE IT_SPFLI.
ENDLOOP.
IF SY-SUBRC <> 0.
GET CURSOR FIELD FLD LINE LINNO OFFSET OFF.
SET CURSOR FIELD FLD LINE LINNO OFFSET OFF.
IF FLD CP 'IT_SPFLI*' AND SY-SUBRC = 0.
LINNO = LINNO + TC_SPFLI-TOP_LINE - 1.
DELETE IT_SPFLI INDEX LINNO.
TC_SPFLI-LINES = TC_SPFLI-LINES - 1.
ENDIF.
ENDIF.
or another eg :
MODULE USER_COMMAND_0100 INPUT.
SAVE_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_CODE.
WHEN 'DELE'.
CALL FUNCTION 'COPO_POPUP_TO_GOON'
EXPORTING
TEXTLINE1 = 'Selected rows will be deleted!'
TEXTLINE2 = 'Are you sure?'
TITEL = 'Delete rows'
IMPORTING
answer = confirmation.
IF CONFIRMATION = 'G'.
REFRESH ITAB_PHONELIST.
CLEAR ITAB_PHONELIST.
ENDIF.
MODULE EXTRACT_USERDATA INPUT.
CASE SAVE_CODE.
WHEN 'DELE'.
IF SELECTION IS INITIAL AND
confirmation = 'G'.
CLEAR ITAB_PHONELIST.
ITAB_PHONELIST-NAME = RECORD-NAME.
ITAB_PHONELIST-PHONE = RECORD-PHONE.
ITAB_PHONELIST-EMAIL = RECORD-EMAIL.
APPEND ITAB_PHONELIST.
<b>Reward pts if found usefull :)</b>
regards
Sathish -
Restore deleted rows in sql server 2008
Hi,
I have problem, I used import and export wizard in sql server 2008, and select wrong database in source data and wrong database in destination data (i Reflect databases) and in editing mapping i make check for delete rows in destination table.
the step final complete and i lost my data and i don't have backup
how i can restore my dataits not a straight forward activity if you don't have backups, first thing you need to do is to create proper maintenance plan for you databases. You can refer below links which could give some clue about your probles.
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/86befdbe-9806-4d96-9e9f-ead753d0fc20/recover-deleted-rows-from-sql-server-database?forum=transactsql
http://sqlserver2000.databases.aspfaq.com/how-do-i-recover-data-from-sql-server-s-log-files.html
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
Praveen Dsa | MCITP - Database Administrator 2008 |
My Blog | My Page -
Delete row in report........
i have report, i have to delete row without page loading. i have wrote the application process(on demand). but i dont know how to write the javascript for htmldb items...
my req is when i click the delete button the checked row(using check box) should delete without page load. i use ajax to call the javascript to process the plsql code.
can any one pls help me to modify the below javascript coding....
application process
begin
for i in 1..htmldb_application.g_f01.count
loop
delete from service
where service_code = htmldb_application.g_f02(htmldb_application.g_f01(i));
end loop;
end;
javascript
function get_repd(){
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=REP_D',0);
}thanks and regard.
skud.Hi Skud,
I will have to say your observation is incorrect. The whole purpose of doing the DML via Application Process using ajax technique is to avoid a page refresh, otherwise it would simply be a page level after submit process.
I have just tested and its working as expected, i.e
1. You select one or more records
2. Use the delete button to delete
3. Records get deleted from DB, you get a message
4. Only the report region get refreshed. (However this could delay for a few seconds if the dataset is larger and server is very busy)
If you are however using APEX 4.x you could use dynamic actions to get it done. My work environment is still on 3.x so my solution is using classic method.
If you are still having issue could you please let me know which browser you are using?
Cheers
Ligon -
How to delete row by row comparing to first collumn?
Hello!
I have a problem - I need to delete row by row , but the problem is, that I know that first COLUMN of any table is a PK.
To retrieve COLUMN NAME I use:
SELECT column_name, table_name FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = c1.tmp_table_name;
But this somehow doesn't work.
Below you can see my script (not worked for now):
declare
xxx varchar2(100);
begin
for c1 in (select table_name, tmp_table_name from tmp_tables) loop
EXECUTE IMMEDIATE
' SELECT column_name into '|| xxx ||' FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = ' ||''''||c1.tmp_table_name||'''';
execute immediate
'begin
for c2 in (select * from '|| c1.tmp_table_name || ') loop begin
insert into '|| c1.table_name || ' values c2; delete from '|| c1.tmp_table_name || ' where ' || xxx ||' = c2.'||xxx ||'; exception when others then null; end; end loop; end;';
end loop;
end;
P.S. Inserts work perfect. I have a problem with delete rows that are in c1.table_name, from c1.tmp_table_name (this two tables have the same structure, PK, always), because I have different column names in another tables tables that are PK. (for example: K, ID, NS and so on) please help me to write correct script.
For example for first fetched row it will be like:
begin
for c1 in (select table_name, tmp_table_name from tmp_tables) loop
execute immediate
'begin for c2 in (select * from '|| c1.tmp_table_name || ') loop begin
insert into '|| c1.table_name || ' values c2; delete from '|| c1.tmp_table_name ||' where K = c2.K; exception when others then null; end; end loop; end;';
end loop;
end;
That script works perfect. But I have many others tables with different PK - not K.Solution with error-logging table
-- create the error-logging table
CREATE TABLE tbl_MergeErrors (
Stamp TIMESTAMP(3),
TableName VARCHAR2(30),
KeyColumn VARCHAR2(30),
KeyValue VARCHAR2(4000),
ErrorCode NUMBER(5),
ErrorMsg VARCHAR2(4000),
CONSTRAINT pk_MergeErrors
PRIMARY KEY (TableName, Stamp)
USING INDEX
-- procedure to insert errors
CREATE OR REPLACE
PROCEDURE LogMergeError (pTableName IN VARCHAR2,
pKeyColumn IN VARCHAR2,
pKeyValue IN VARCHAR2)
IS PRAGMA AUTONOMOUS_TRANSACTION;
-- you couldn't insert SQLCODE or SQLERRM directly into a table (ORA-00984)
nSQLCODE NUMBER(5) := SQLCODE;
vcSQLERRM VARCHAR2(4000) := SQLERRM;
BEGIN
INSERT INTO tbl_MergeErrors
(Stamp, TableName, KeyColumn, KeyValue, ErrorCode, ErrorMsg)
VALUES (SYSTIMESTAMP, RTrim( SubStr( pTableName, 1, 30)),
RTrim( SubStr( pKeyColumn, 1, 30)), SubStr( pKeyValue, 1, 4000),
nSQLCODE, vcSQLERRM);
COMMIT WORK;
-- if an error occured here, then just roll back the autonomous transaction
EXCEPTION
WHEN OTHERS THEN ROLLBACK WORK;
END LogMergeError;
-- create the tables and insert test-data
CREATE TABLE TMP_TABLES (
TABLE_NAME VARCHAR2(200),
TMP_TABLE_NAME VARCHAR2(200),
CONSTRAINT TMP_TABLES_X PRIMARY KEY (TABLE_NAME)
CREATE TABLE TMP_KL002 (
K VARCHAR2(40),
N VARCHAR2(200)
CREATE TABLE TMP_TABLE1 (
NS VARCHAR2(40),
N VARCHAR2(200)
CREATE TABLE KL002 (
K VARCHAR2(40),
N VARCHAR2(200),
CONSTRAINT PK_KL002 PRIMARY KEY (K)
CREATE TABLE TABLE1 (
NS VARCHAR2(40),
N VARCHAR2(200),
CONSTRAINT PK_TABLE1 PRIMARY KEY (NS)
INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('kl002','tmp_kl002');
INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('table1','tmp_table1');
INSERT INTO tmp_KL002 (K, N) VALUES ('00', 'none');
INSERT INTO tmp_KL002 (K, N) VALUES ('07', 'exists');
INSERT INTO tmp_KL002 (K, N) VALUES ('08', 'not assigned');
INSERT INTO tmp_table1 (NS, N) VALUES ('2000', 'basic');
INSERT INTO tmp_table1 (NS, N) VALUES ('3000', 'advanced');
INSERT INTO tmp_table1 (NS, N) VALUES ('4000', 'custom');
COMMIT WORK;
-- to test, if it works correct when primary key values exists before
INSERT INTO KL002 VALUES ('07', 'exists before');
COMMIT WORK;
-- check the data before execution
SELECT * FROM TMP_KL002 ORDER BY K;
SELECT * FROM KL002 ORDER BY K;
SELECT * FROM TMP_TABLE1 ORDER BY NS;
SELECT * FROM TABLE1 ORDER BY NS;
-- empty the error-logging table
TRUNCATE TABLE tbl_MergeErrors DROP STORAGE;
-- a solution
DECLARE
PLSQL_BLOCK CONSTANT VARCHAR2(256) := '
BEGIN
FOR rec IN (SELECT * FROM <0>) LOOP
BEGIN
INSERT INTO <1> VALUES rec;
DELETE FROM <0> t WHERE (t.<2> = rec.<2>);
EXCEPTION
WHEN OTHERS THEN
LogMergeError( ''<1>'', ''<2>'', rec.<2>);
END;
END LOOP;
END;';
BEGIN
FOR tabcol IN (SELECT t.Tmp_Table_Name, t.Table_Name, c.Column_Name
FROM Tmp_Tables t,
User_Tab_Columns c
WHERE (c.Table_Name = Upper( t.Tmp_Table_Name))
AND (c.Column_ID = 1)
) LOOP
EXECUTE IMMEDIATE Replace( Replace( Replace( PLSQL_BLOCK,
'<0>', tabcol.Tmp_Table_Name),
'<1>', tabcol.Table_Name),
'<2>', tabcol.Column_Name);
END LOOP;
END;
-- check the data after execution ...
SELECT * FROM TMP_KL002 ORDER BY K;
SELECT * FROM KL002 ORDER BY K;
SELECT * FROM TMP_TABLE1 ORDER BY NS;
SELECT * FROM TABLE1 ORDER BY NS;
-- ... and also the error-logging table
SELECT * FROM tbl_MergeErrors ORDER BY Stamp, TableName;
-- of couse you must issue an COMMIT (the ROLLBACK is only for testing
ROLLBACK WORK;
-- drop the test-tables
DROP TABLE TABLE1 PURGE;
DROP TABLE KL002 PURGE;
DROP TABLE TMP_TABLE1 PURGE;
DROP TABLE TMP_KL002 PURGE;
DROP TABLE TMP_TABLES PURGE;
-- you shouldn't drop the error-logging table, but I use it to free up my db
DROP TABLE tbl_MergeErrors PURGE;Greetings, Niels
Maybe you are looking for
-
Itunes app crash when downloading purchases in windows 7 64 bit
Hi guys I have recently upgraded to windows 7 64 bit. My I-tunes works fine until I try to download a purchase. As soon at the download starts I get an app crash error and I tunes closes. I turned off my anti-virus and that did not help. Here is the
-
External TV Monitor use while editing HDV
I would like to use an external TV monitor to mirror my timeline while editing in HDV and I understand from reading past posts that I cannot do that without a capture card such as the Blackmagic Decklink HD Pro (dual link) PCI-X. I am willing to purc
-
Why do my iPhone photos import all scrambled?
Some but not all of my photos import with this scrambling through them. They don't appear like this until they are imported through iPhoto. Any help?
-
Authorization object A_S_GSBER for Business area
Dear group Members Warm Greetings Transaction code z_am_detail was added to the role from tcode pfcg .SAP proposed new values for certain organisation levels for example: the authorization object A_S_GSBER. The values proposed by the system for busin
-
Source file not found: C:\Program Files (x86)\Adobe\Acrobat 11.0\Setup\{AC76BA86-1033-FFFF-7760-000000000006}\Data1.cab I have have this issue ever since I uninstalled Adobe Acobat Pro XI. I have since reinstalled Adobe Acobat Pro XI and still have