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

Deleting internal table

Former Member
0 Likes
575

Hi all,

In an internal table i have 5 fields.

My requirement is for the last record i have to delete entries only for 3 fields .

Ex: In itab

f1 f2 f3 f4 f5

12 18 19 20 24

09 24 32 25 26

25 26 28 29 30.

So for the last record i want to delete entries for f1 f2 f3(25 26 28) only i need f4 and f5(29 30) for display.

Please kindly help me.

regards

chandu.

1 ACCEPTED SOLUTION
Read only

abdul_hakim
Active Contributor
0 Likes
550

HI

Use CLEAR:itab-f1,itab-f2,itab-f3.

Regards,

Abdul

HI

Use CLEAR:itab-f1,itab-f2,itab-f3.

Regards,

Abdul

4 REPLIES 4
Read only

abdul_hakim
Active Contributor
0 Likes
551

HI

Use CLEAR:itab-f1,itab-f2,itab-f3.

Regards,

Abdul

Read only

Former Member
0 Likes
550

Sai,

read itab into waTab index 3.

Clear: waTab-f1, waTab-f2,waTab-f3.

modify iTab from waTab index 3.

Thanks

Kam

Read only

Former Member
0 Likes
550

Hi sai,

try this way.....


data last_record type i.
last_record = sy-dbcnt - 1.

  loop at itab into wa.
 
    if sy-tabix = last_record.

     *use clear

    endif.
  endloop.

hope this also helps you.

regards,

venu.

Read only

mathias_lange3
Explorer
0 Likes
550

Hi,

to get the number of entries in the internal tab use:

DATA: rows_in_itab TYPE i.

DESCRIBE TABLE itab LINES rows_in_itab.

Then you can read the last row in the itab and modify the fields:

READ itab INTO wa INDEX rows_in_itab.

CLEAR: wa-f1, wa-f2, wa-f3.

MODIFY iTab FROM wa INDEX rows_in_itab.

Kind Regards

Mathias

Message was edited by: Mathias Lange