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

simple help

Former Member
0 Likes
986

Hi,

How can I update work area to internal table

I need the syntax for update.

8 REPLIES 8
Read only

former_member386202
Active Contributor
0 Likes
965

Hi,

Refer this code

Loop at itab1 into wa1.

wa2-f1 = wa1-f1.

append wa2 to itab2.

endloop.

Regards,

Prashant

Read only

Former Member
0 Likes
965

Hi shilpa

just use append statement to update internal tble.

int-f1 = wa-f1.

int-f2 = wa-f2.

append int.

Regards

karthik

Reward points if useful

Read only

Former Member
0 Likes
965

Hi,

You can use below code :

itab-f1 = wa-f1

itab-f2 = wa-f2.

append itab.

clear itab.

Thanks,

Sriram Ponna.

Read only

0 Likes
965

I need syntax for update

here my requirement is to update work area to internal table body.

Read only

Former Member
0 Likes
965

Hi,

if your work area and internal table structures are same then you can write,

APPEND 'workarea' to 'internal table'.

Reward if useful.

Thanks,

Sreeram.

Read only

Former Member
0 Likes
965

Hi this may be of some help to u:

WORKAREA is a structure that can hold only one record at a time. It is a collection of fields. We use workarea as we cannot directly read from a table. In order to interact with a table we need workarea. When a Select Statement is executed on a table then the first record is read and put into the header of the table and from there put into the header or the workarea(of the same structure as that of the table)of the internal table and then transferred top the body of the internal table or directly displayed from the workarea.

Each row in a table is a record and each column is a field.

While adding or retrieving records to / from internal table we have to keep the record temporarily.

The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.

Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.

e.g.

data: begin of itab occurs 10,

ab type c,

cd type i,

end of itab. " this table will have the header line.

data: wa_itab like itab. " explicit work area for itab

data: itab1 like itab occurs 10. " table is without header line.

Internal tables are used for storing records which are obtained as a result when we use select statement on database. internal tables are run time entities and doesn't occupy any memory. they are dynamic.

internal tables are of types.

1. internal tables with header line. [header and body]

2. internal tables with out header line. [only body]

Workarea is the concept which is mainly useful when working with internal tables with out header line.

at any point of time we can access only one record through header of a internal table. every thing should be done [inserting,modifying, reading ] through header only.

ex: data: itab like standard table of mara with header line.

for internal tables with out header line we will create a work area [explicit header] as type of table for storing data into internal table.

ex: data: itab like mara,

wa like mara.

with regards,

Hema Sundara.

reward if u find it needful.

Read only

Former Member
0 Likes
965

use append statement.

if work area is defined explictly,

append wa to itab.

clear wa.

if work area is along with itab,

append itab.

clear itab

reward if helpful

rgds

umakanth

Read only

Former Member
0 Likes
965

hi,

if u want to update use modify statement.