Friday, April 15, 2011

Insert Update and Delete Row In Transparent Table


Insert Update and Delete Row In Transparent Table


Here’s a sample code to insert, update and delete row in transparent table. This syntax is relatively simple, remember that this is a transparant table and not internal table so the changes will be directly reflected on your tables.
But first you have to create a transparent table first.
Here’s the Abap code sample.
REPORT  Z_TransparentTable_SQL.

data wa  type ztable1.

START-OF-SELECTION.

"Insert new row to transparant table.

wa-custid = '0001'.
wa-custnm  = 'ABC'.
insert ztable1 from wa.

"Modify data in transparant table
"Using modify statement, the system will
"automatically search the index key
"if found similar key then it will update
"the value and not adding new row

wa-custid = '0001'.
wa-custnm = 'CDE'.
Modify ztable1 from wa.

"delete row from transparant table
wa-custid = '0001'.
delete ztable1 from wa.

No comments:

Post a Comment