‎2007 Jul 25 1:45 PM
Hello All,
I have a table where I am inserting rows using
DATA xx type tablename
xx-attr1= 'xx'.
INSERT into tablename values xx.
But when i display all the rows of the table, a blank line is automatically added as the first row of the table.
I need to delete that line, how should I do that??
coz the delete command needs some condition with which it can delete.
But since this is a blank row, i dont have any attributes based on whcih i can delete that row.
Could any 1 provide me a solution to this?
Thanks
Meghana
‎2007 Jul 25 1:49 PM
hi,
Delete tablename where <field1> is intitial.
Reward if useful!
‎2007 Jul 25 1:51 PM
hi
delete itab where <field> is initial
regards
ravish
reward if useful
‎2007 Jul 25 1:53 PM
Hi,
The problem seems to be tricky. We need to find out why the blank line is inserted. When the insert command has been executed, the system field SY-DBCNT contains the number of inserted lines (0 or 1). Can you pls check that and let us know ?
-Irudayaraj Peter
‎2007 Jul 25 1:56 PM
‎2007 Jul 25 1:58 PM
1)
DATA xx type tablename
xx-attr1= 'xx'.
if not xx is initial.
INSERT into tablename values xx.
endif.
2) data : itab like standard table of tablename ,
xx type tablename.
xx-attr1 = 'x'.
if not xx is initial.
append xx to itab.
endif.
after you are done with all the data inserting into internal table.
insert into tablename from itab
3)
if the table already contains a blank entry... then you want to delete it..
data itab like standard table of tablename.
select * from tablename into itab.
delete tablename from itab.
delete itab where field1 is initial
field2 is initial.
modify tablename from itab.
4)
if you manually want to delete this record..
then go to se16 give the table name and execute.. double click on the blank record... then give /h in the command box and press enter two times.. it will take you into debugging mode..
your will enter into the debug mode and your program stops at
refresh exclude_tab.
if code = 'SHOW'.
...
....
change the value of code variable to 'DELE' and say execute.
This kind of approach need appropriate autoriazations
Thanks
mahesh
Message was edited by:
I Can Solve It