Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to delete the a blank row automatically generated using INSERTstatement

Former Member
0 Likes
1,120

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

5 REPLIES 5
Read only

Former Member
0 Likes
860

hi,

Delete tablename where <field1> is intitial.

Reward if useful!

Read only

Former Member
0 Likes
860

hi

delete itab where <field> is initial

regards

ravish

reward if useful

Read only

Former Member
0 Likes
860

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

Read only

Former Member
0 Likes
860

delete itab where <field> is space.

Read only

Former Member
0 Likes
860

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