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

Internal table

Former Member
0 Likes
430

Dear friends,

I have data in internal table ITAB.

i want to update some record in the internal table.

I have data in Header line.

EX: itab-num = 100.

itab-name = 'Arnold'.

itab-sal = 60000.

now i want to append that header line to internal table.

IF the record already exists in the internal table, it should update the existing record by updating some fields.

If that does not exists in the ITAB, it should append that record.

Please let me know the solution for this.

Thanks in advance.

Regards,

Ajay

4 REPLIES 4
Read only

Former Member
0 Likes
416

Hi,

Use MODIFY syntax with your internal table.

Read only

Former Member
0 Likes
416

Hi,

sort table by some key (e.g. num in your case) .

read table itab into ls_itab with key num = 100.

if sy-sybrc <> 0.

insert wa into itab.

endif.

<REMOVED BY MODERATOR>

Regards.

Ashish.

Edited by: Alvaro Tejada Galindo on Apr 7, 2008 11:48 AM

Read only

Former Member
0 Likes
416

Hi,

read table itab into wa with key itab-num = 100.

wa-name = 'Arnold'.

wa-sal = 60000.

MODIFY TABLE itab FROM wa TRANSPORTING name,sal.

Read only

Former Member
0 Likes
416

loop at itab into wa-itab.

modify <database table> from wa-itab.

endloop.