Skip to Content
0
Former Member
Nov 24, 2009 at 04:22 AM

Append a record in dynamic internal table after loop statement

157 Views

Hi All,

I have a dynamic internal table <DYN_TAB> with work area <WA_DYTAB>.

I have populated the table with records from a standard table.

Post that I wanted to modify some columns in that so have written

LOOP AT <DYN_TAB> ASSIGNING <WA_DYTAB>.

ASSIGN COMPONENT "WHATEVER" OF STRUCTURE <WA_DYTAB> TO <FS>.

<FS> = 'WHATEVER".

ENDLOOP.

The problem is after the loop I have to append 1 more record to this dynamic internal table.

If a use a CLEAR <WA_DYTAB>. and then append my record, the last record in my table is cleared and I have 2 records with appended values.

If I use UNASSIGN <WA_DYTAB> when i append my record it gives a dump saying <WA_DYTAB> not yet assigned.

If I do not do anything (either CLEAR or UNASSIGN) again the last record is modified based on new values I assign and also another record is appended with the same values.

What do I do to retain already existing values in the table and append 1 more record to it.

Regards,

Mrunal