Skip to Content
author's profile photo Former Member
Former Member

WORK AREA..?

Hello Experts,

When do we use a work area and how is it useful...in what situations shud we use it....difference between internal tables and work area...

Thanks in advance...

Cheers:Jim

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2007 at 07:05 AM

    Hi Jimmy

    Workarea is the memory area on with you perform the required operation related to data. Every Internal table has a header that is work area of the internal table. As soon as you read a row in an internal table the particular record gets filled in the workarea and now you can make modifications to this data, then say update or append the same data to internal table.

    if you have defined an internal table with out header line, then you have to separately declare a work area and use as per requirement.

    check these links

    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb30dd358411d1829f0000e829fbfe/content.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb30dd358411d1829f0000e829fbfe/content.htm

    what-is-the-work-area

    Reward all helpfull answers

    Regards

    Pavan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2007 at 07:00 AM

    Hi Jimmy,

    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.

    Thanks,

    Reward If Helpful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2007 at 07:00 AM

    Hi

    Work area is used to hold a single record

    When you declare a TABLE with TABLES : MARA statement

    by default a work area of MARA is created and you can use a select single statement into MARA work area

    Similarly with ITAB's if you delcare itab with header line, it creates a work area during run time first the record is fetched to header(work area) and is moved to body.

    so every time the record comes to header and then moved to Itab body.

    Reward points for useful Answers

    Regards

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2007 at 07:01 AM

    Simple terminology,

    Internal table- store multiple records

    work area - It get one record at a time from internal table and we process them.

    Processing is always based on work area and selection of data is done in internal table.

    Reward points if useful.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2007 at 07:01 AM

    hi

    good

    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.

    http://www.sap-img.com/abap/difference-between-work-area-and-header-line.htm

    thanks

    mrutyun^

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2007 at 07:40 AM

    Thnx Atish...

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.