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

regarding internal table

Former Member
0 Likes
597

hello experts give the solution to my question.

1. i crated an internal table it's consists only one field ,

however i deleted the data in internal table. but it gives the output to me.

ex:

loop at itab.

delete itab.

write 😕 itab-field.

endloop.

however it gives the output.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
575

loop at itab.

delete itab.

write 😕 itab-field.

endloop.

When loop is executed, the data is been read from the body of the internal table and is been stored in the header part.

Now, you are deleting the body data but not the header data, so when you are trying to print, it gets printed from the header data.

Do this way.

loop at itab.

delete itab.

clear itab.

write 😕 itab-field.

endloop.

4 REPLIES 4
Read only

former_member745780
Active Participant
0 Likes
575

Hello

this code write the header value if you do'nt want to write

you have write "clear itab." before write satement

Thanks

Read only

Former Member
0 Likes
575

In your code, delete itab deletes the body. But as the Header consists of value you are getting the output. Just debug and see. You can understand.

Read only

Former Member
0 Likes
576

loop at itab.

delete itab.

write 😕 itab-field.

endloop.

When loop is executed, the data is been read from the body of the internal table and is been stored in the header part.

Now, you are deleting the body data but not the header data, so when you are trying to print, it gets printed from the header data.

Do this way.

loop at itab.

delete itab.

clear itab.

write 😕 itab-field.

endloop.

Read only

0 Likes
575

thanku ramesh . my problem was solved.