Difference between work area and internal tables.

Hi  I wanna know the difference between work area and internal tables.
what happend if i give with out header line in internal table.
also how to assosiate work area to internal table in that scenario.

Hi Balaji..
The internal table is an ABAP runtime object which has two parts the Body and the header.
Whereas a work area cannot have a body.. It is mere a field or group of fields which can hold values at runtime..
In the SAP higher versions mySAP ERP, the use of tables with header line is made obsolete.. But there is absolutely no problem with the same..
Just think that when you define an internal table with occurs or with header line statement, the system automatically creates a workarea with this table, using which you can access the contents in the bosy of tyhe table.. You can read a record from the table body to this header or add a record in the header to the internal table body..
When you work with a table ITAB without a header line, you can not use statements like READ TABLE, APPEND, INSERT etc without giving an explicit work area..
Suppose i have an internal table like:
DATA : itab TYPE STANDARD TABLE OF t001.
This table will not have a header with it.
If you will use APPEND itab. The compilor will give error.
Here i will create a work area with same structure of the table.
DATA : e_wa TYPE t001.
Now i will write:
APPEND e_wa TO itab.
READ TABLE itab INTO e_wa WITH KEY xxxxxx
LOOP AT itab INTO e_wa...           etc..
In a better approach we use Field symbols with such tables, instead of structures
FIELD-SYMBOLS: <fs_itab> TYPE t001.
So,
LOOP AT itab ASSIGNING <fs_itab>
READ TABLE itab ASSIGNING <fs_itab> etc.. However we can not use field symbols in few cases..
I hope this will help you..
Thanks and Best Regards,
Vikas Bittera.
**Points for usefull answers**

Similar Messages

  • Difference between line type and internal table?

    Hi..
    I wanted to know, what is the difference between Line type and Internal Table?

    Hi,
        Before the 4.7 release in SAP if we want to define an internal table we have to write the defination using the occurs statement and we need to define all the fields using INCLUDE STRUCTURE or indidually all the fields ine by one.
    From 4.7 release of R/3 SAP introduced the Line type concept and it's part of the ABAP OOPS concept. for internal table defination we don't need to use the occur statements. Instead INCLUDE structure  we need to create a Line type for that structure in Se11 and then we can define the internal table like :
    DATA : ITAB TYPE TABLE OF <LINE_TYPE>.
    Only thing is this table will be  a table without header. So for internal table processing we need to define a work area structure of type line of line type  . EX:
    DATA: WA_ITAB TYPE LINE OF <LINE_TYPE>.
    Hope this helps.
    Thanks,
    Greetson

  • Work area and internal table

    hi friends,
    Please let me know when do we use work area and when do we use internal table.
    Thanks in advance
    Tina Wilson

    Work areas are used with internal tables.  For example if you have an internal table defined like this.
    data: itab type table of mara.
    This internal table can hold many rows of data, right?  SO say you need to read this data.  Well you will need to LOOP or READ the internal table, since this internal table has no header line(please to put the read data), you need to have a work area to put the data into.
    <b>data: wa like line of itab.</b>
    Loop at itab <b>into wa</b>.
    endloop.
    Now if you defined the internal table with a header line, there is no reason to have the work area and you can just do the same like this.
    data: itab type table of mara <b>with header line</b>.
    Loop at itab.
    endloop.
    It is now best practice to use work areas instead of header lines because in ABAP OO, header lines are not allowed.
    Regards,
    Rich Heilman

  • The type of the database table and work area (or internal table)...

    Hello
    I am trying to use a database and select all records from it and store them into an internal table.
    My code:
    Select * from xixi_dbcurrency into table gt_currency.
    The error:
    "The type of the database table and work area (or internal table) "GT_CURRENCY" are not Unicode-convertible . . . . . . . . . .     "
    Any suggestions?
    Thank you

    Hi Thomas,
    Thank you for your inputs above.
    But as you suggested is we use INTO CORRESPONDING FIELDS OF TABLE then it resolve the error.
    But I have below piece of code:
    DATA:    it_new_source TYPE STANDARD TABLE OF _ty_s_sc_1,
                  wa_source TYPE _ty_s_sc_1,
                  wa_new_source TYPE _ty_s_sc_1,
                  ls_target_key TYPE t_target_key.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_new_source
           FROM /bic/afao06pa100
           FOR ALL ENTRIES IN SOURCE_PACKAGE
           where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
           and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    But since this is reading into corresponding fields of table the data load from one DSO to other DOS is running for long more that 15 hours and still not getting completed and giving dump.
    So if I switch the search to below:
    SELECT * FROM /bic/afao06pa100
       INTO TABLE it_new_source
           FOR ALL ENTRIES IN SOURCE_PACKAGE
           where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
           and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    Then I am getting below error:E:The type of the database table and work area (or internal table) "IT_NEW_SOURCE" are not Unicode convertible.
    Can you please advice on this, as performance need to improve in start routine code.
    Thank You.

  • What is the difference between standard,sorted and hash table

    <b>can anyone say what is the difference between standard,sorted and hash tabl</b>

    Hi,
    Standard Tables:
    Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.
    This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command). The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to
    the number of table entries.
    Sorted Tables:
    Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables.
    This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of
    table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.
    Hashed Tables:
    Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
    This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and
    using internal tables that are similar to database tables.
    Regards,
    Ferry Lianto

  • Difference between  business area and profit center

    hi all
    could you please tell me about difference between business area and
    profitcenter.
    thanks,
    regards,
    chennuri.

    HI
    Read below
    Profit Center - The profit center view shows the various
    internal areas of responsibilities. Objects such as cost
    centers, materials, etc can be used for profit center
    analysis. Profit center can be used to determine the
    revenues, costs, and profitability for specfic areas of
    responsibility.
    Business Area - Business area forms an important part of
    external reporting. Analysis of various segments, product
    divisions, regions etc is possible using business areas.
    Business Area: This is optional
    This can be used cross compane codes
    This is for Internal Purpose
    It is not Legal Entity like Co Code
    The transation entered in Business are, Debit total will
    not tally with credit total
    Since it is used for segment wise or area wise or line wise
    this is used for internal report purpose only .
    Balance Shhet and P & L stataments can be drawn on segment
    wise
    Profit Centre: Generally in terms of SAP or Finance the
    meaning of Profit centre is to know the profitabilty.
    In same manner , The managers  wants to know the ROI from
    their investments, obviously we nned to use the tool.
    This ROI may be geographically or area wise or division
    wise. P.C provided us profitablity of the particular area
    for internal purpose ( Only for Internal )
    Business Area is an optional entry.Whenever company wants
    financial statements businessarea wise we can maintain
    BAs.And also we can maintain BA as Segment Wise,Product
    Wise,Geographical Location wise.
    Profit center is used to know the profits of companies.PC
    is also used for to know the profits as aProduct
    wise,Segment wise,geographical location wise.If anything
    wrong inthis answer plz correct me..
    Hope this helps
    Good Luck
    Hari

  • The work area (or internal table) "IT_ZLE_LAGERPLANUNG" is not flat,

    ***Data declaration
    TYPES : BEGIN OF t_zle_lagerplanung,
               SEl,                               "stores which row user has selected
               kdauf TYPE zle_lagerplanung-kdauf,
               kdpos TYPE zle_lagerplanung-kdpos,
               etenr TYPE zle_lagerplanung-etenr,
               papiermaschine TYPE zle_lagerplanung-papiermaschine,
               runnr TYPE zle_lagerplanung-runnr,
               prio  TYPE zle_lagerplanung-prio,
               werk TYPE zle_lagerplanung-werk,
               durchmesser TYPE zle_lagerplanung-durchmesser,
               breite TYPE zle_lagerplanung-breite,
               anzle TYPE zle_lagerplanung-anzle,
             occupied TYPE zle_lagerplanung-text30,
             free TYPE zle_lagerplanung-text30,
               lgpla TYPE zle_lagerplanung-lgpla,
               lgtyp  TYPE zle_lagerplanung-lgtyp,
               art TYPE zle_lagerplanung-art,
               anzhoehe TYPE zle_lagerplanung-anzle,
             zindicator TYPE zle_lagerplanung-text30,
               fa TYPE zle_lagerplanung-fa,
               field_style  TYPE lvc_t_styl, "FOR DISABLE
    END OF t_zle_lagerplanung.
    I am getting the data in internal table by using thiis select statement.
      SELECT kdauf kdpos etenr papiermaschine runnr prio werk durchmesser breite
             anzle lgpla lgtyp art anzhoehe fa
        FROM zle_lagerplanung INTO CORRESPONDING FIELDS OF TABLE it_zle_lagerplanung
       WHERE kdauf IN s_kdauf
    "     AND kdpos = p_kdpos
          AND KDPOS IN s_kdpos
         AND werk = p_werks.
    But while updating the particular field in ztable using this statement
          UPDATE zle_lagerplanung from table it_zle_lagerplanung.
    it is giving syntax error
    "The work area (or internal table) "IT_ZLE_LAGERPLANUNG" is not flat, or
    contains reference or internal tables as components. components.
    components. components. components."
    Could any one help me out how to resolve this problem....
    Thanks in advance

    Hi Shyamal,
    lvc_s_styl is a structure so you will get the same error.
    for your select and update statement you dont need field "field_style".
    regards
    rea

  • What is the differences between Transparent,Pooled and Cluster tables?

    Hello all,
    What is Pool table?What is the differences between Transparent,Pooled and Cluster tables?
    Regards!
    Purna

    Transparent table:
    Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined together with their (database-independent) data types and lengths.
    A table definition in the ABAP Dictionary has the following components:
    Table fields: The field names and the data types of the fields contained in the table are defined here.
    Foreign keys: The foreign keys define the relationships between this table and other tables.
    Technical settings: The technical settings define how the table is created on the database.
    Indexes: Indexes can be defined for the table to speed up data selection from the table.
    There are three categories of database tables in the ABAP Dictionary.
    A physical table definition is created in the database for the table definition stored in the ABAP Dictionary for transparent tables when the table is activated. The table definition is translated from the ABAP Dictionary to a definition of the particular database.
    On the other hand, pooled tables and cluster tables are not created in the database. The data of these tables is stored in the corresponding table pool or table cluster. It is not necessary to create indexes and technical settings for pooled and cluster tables.
    Pooled table
    Pooled tables can be used to store control data (e.g. screen sequences, program parameters or temporary data). Several pooled tables can be combined to form a table pool. The table pool corresponds to a physical table on the database in which all the records of the allocated pooled tables are stored.
    Cluster table
    Cluster tables contain continuous text, for example, documentation. Several cluster tables can be combined to form a table cluster. Several logical lines of different tables are combined to form a physical record in this table type. This permits object-by-object storage or object-by-object access. In order to combine tables in clusters, at least parts of the keys must agree. Several cluster tables are stored in one corresponding table on the database.
    Regds,
    Manohar

  • What is difference between bus.Area and plant

    dear experts, 
                what is difference between bus.Area and plant?
    thanks
    Rajakarthik.

    Hi
    Plant and Business Area are not the same.
    Business Areas are configured in FI module as per the Product lines or geographical operations basis.
    Where as The plants created in the logistics (General) module are assigned to the company code. That means all transactions taking place in the plants are posted to the attached company code in SAP FI.
    You can post a business area to several company codes and use it for cross-company-code reporting.
    The R/3 System uses a combination of plant and division to assign the relevant business area. When you use the R/3 System to automatically draw up accounts for business areas, you can assign only one business area to a combination of plant and division. Plants and divisions can be assigned and combined in several different ways.
    http://help.sap.com/saphelp_46c/helpdata/en/5d/a77d80ec1111d2bc1000105a5e5b3c/content.htm
    Re: Business Area and Plant
    Regards

  • Difference between Business area and profit center accounting

    Hi Frnds,
    Can any body explain about difference between business area and profit center accounting .

    Hi
    Business area will have many profit centers. For example Vehicle is a business area in a company. Vehicle can be cars and Bikes etc. Here Vehicle is business area and Cars and Bike are profit centers. In broad Vehicle is a profit center. But as it has sub areas those are profit centers. So profit centers cannot be replaced with business area and vice versa. We can replace business area by Profit centre, only condition is that it should be in same controlling area. The business area is more like a business unit of a company. You can have multiple profit centers within a business area.
    Main distinguish factor is that distribution and assessment in possible in profit center but not in business area.
    One more distinction is that Business area need not be attached to any organisation structure. But profit centres can be created only under the controlling area. Business area can be across controlling area.
    Business area concept is used for making stragic decisions by the management whereas the primary purpose of profit centre accounting is responsibility accounting.
    http://help.sap.com/saphelp_erp2005/helpdata/en/ff/277203deea11d3b5b4006094b9b0a5/frameset.htm

  • Difference between Data staging and Dimension Table ?

    Difference between Data staging  and Dimension Table ?

    Data Staging:
    Data extraction and transformation is done here.
    Meaning that, if we have source data in flat file, we extract it and load into staging tables, we take care of nulls, we change datetime format etc.. and after such cleansing/transformation at then end, load it to Dim/Fact tables
    Pros: Makes process simpler and easy and also we can keep track of data as we have data in staging
    Cons: Staging tables need space hence need memory space
    Dimension Table:
    tables which describes/stores the attribute about specific objects
    Below is star schema which has dimension storing information related to Product, Customer etc..
    -Vaibhav Chaudhari

  • Difference between business area and costcenter

    Hi All,
    Could u pls let me know the differences between Business Area and Cost Center.
    Awaiting ur valuable responses.
    Thanks & Regards
    Chennuri

    Hi,
    i am giving a realtime information on business areas and cost centers.
    For our company we have 25 branches. in sap we treat all of our branches as a seperate business area. the reason why we maintain business area. at the month end or year end financial statemensts are generated on company code basis and business area base. so we consider branches as a business area.
    Cost center is like a cost object.
    Hope this is clear,
    Regards,
    Sankar

  • Difference between business area and sales area

    Hi
    I am swetha i have one doubt
    1) what is the buisiness area and what purpose we use the business area
    2)  what is sales area and what purpose we use the sales area
    3)what is the main Difference between business area and sales area.
    Regards
    Swetha

    Hii..
    Business Areas in SAP are used to differentiate transactions originating from different points/lines/locations in business. Let me give some examples to elucidiate:-
    A company (say, ABC) is a huge company and has a variety of businesses under it. Let us say that it typically operates in 3 different domains like machinery manufacturing, trading and assembling of machine parts.
    There are 2 options here now -
    1. Either create different company codes for the 3 business operations (which would be the easiest and require no creativity)
    or
    2.) Create each of these business lines into business areas (the better option).
    The advantages of using the second option is:
    1. You can use these business areas if other company codes require the same areas
    2. The configuration is simpler as in case of company code, you would require to go through the entire configuration of creating Chart of Accounts, Fiscal Year variants, posting periods variants and so on. In the business area option, you just need to attach it to the company code and the rest of the details in Business area is attached by default from the company code you are using it in.
    3. Using the options in controlling (EC-PCA, Enterprise Controlling, Profit Centre Accounting), you can even draw up Balance Sheets and PL statements for your business areas and hence this is used for management accounting in some companies (like HP, Dell, etc) when it wants to know the operating profits for different business areas/lines.
    The above was an example when the company wanted to separate entries according to the lines it operates in... the other case could be when it wants to find out profitability during its operations in cities and differentiates these cities into Business
    Areas...
    Business Areas are not much relevant in FI but are much more relevant in CO.
    Hope this clears.
    What is mySAP SD?
    The SAP sales and distribution is part of the logistics module that support your customers, starting from quotations, sales order and all the way towards billing the customer.  It is tightly integrated with the MM and PP functional modules.  It allows companies to input their customer sales price, check for open orders and forecast etc.
    The most important basic functional features in the sd module are:
    - Pricing                                           - Availability Check
    - Credit Management                       - Material Determination
    - Output Determination                     - Text Processing
    - Tax Determination                          - Account Determination
    Regards,
    Aakash

  • Difference between dunning area and dunning procedure

    Hi,
    can anybody explain the exact differnce between dunning area and dunning procedure
    why we define both n how we use them
    what is the differnce between dunning by dunning area and dunning by dunning procedure
    i would be very much thankful if  can get the exact differnetation

    Dunning Areas are organizational units that you use to process the dunning program for example, by division, or sales organization.
    You use dunning areas if several organizational units are responsible for carrying out dunning within a company code. These organizational units are represented by dunning areas in the SAP System.
    You can have either One dunning procedure for One dunning area or several Dunning procedures per dunning area.
    Dunning procedure actually defines how business partners are dunned.
    The dunning program duns open items in customer and vendor accounts if the overdue items result in a debit balance. When you configure the dunning program, you can specify additional criteria for determining whether accounts or their open items are to be dunned.
    Hope it helps.
    Thanks,
    Nandita

  • Difference between Field symbols and work area for Internal tables

    Hi,
    In ECC versions we all know that we need to declare the internal tables without headerline, and for handling the internal tables we need to use exclusive work areas.
    Currently i have an issue that we have been asked to use field symbols instead of work areas...can any one help me how to use the field symbols and also let me know how it will improve the performance of the program..
    Thanks and Regards,
    Kathir

    Hi
    DATA: WA TYPE ITAB.
    LOOP AT ITAB INTO WA.
    IF WA-FIELD = .....
    ENDIF.
    ENDLOOP.[(code]
    FIELD-SYMBOLS <WA> TYPE ANY.
    LOOP AT ITAB ASSIGNING <WA>.
    ENDLOOP.
    Now the problem is you can't know the name of the fields of the table at runtime, so you can't write:
    IF <WA>-FIELD = .....
    ENDIF.
    Anyway you can create a field-symbols strcturated like the table:
    [code]FIELD-SYMBOLS <WA> TYPE ITAB.
    LOOP AT ITAB ASSIGNING <WA>.
      IF <WA>-FIELD = .....
      ENDIF.
    ENDLOOP.
    I don't know which are the differences for the performance between to use a field-symbol and to use a structure as work-area.
    The differnce between the field-symbols and work-area is the field-symbol is assigned directly to the record, so u don't need to do a MODIFY statament to change something:
    LOOP AT ITAB INTO WA.
      WA-FIELD =
      MODIFY ITAB FROM WA.
    ENDLOOP.
    LOOP AT ITAB ASSIGNING <WA>.
      <WA>-FIELD =
    ENDLOOP.
    These two pieces of abap code do the same action, so probably the field-symbol improve the performance because it do an access directly to the record without to use an external structure as workarea.
    Max

Maybe you are looking for

  • Trouble with panning modes, volume levels the same on mixdown...

    First of all, I don't think the explanation in the manual is comprehensive, I get what they're saying but it seems there's some quirks.  Maybe someone can help me sort this out. Left/Right Cut  (logarithmic)  Vs. -3dB Center Stereo Panning Mode Selec

  • Over current

    I have a 2nd-gen ipod shuffle, connecting it to a MacBook, i get the Over Current warning and it will not charge. it used to work fine then it suddenly stopped working yesterday, no changes made that i can remember.

  • Help in performence

    hi, i wont to increase performance for this loop what is the best way to do that? LOOP AT q_tab ASSIGNING <q_tab>.     SELECT SINGLE txtmd       FROM /bi0/tqualifictn       INTO <q_tab>-txtmd       WHERE qualifictn = <q_tab>-nodename       AND langu

  • Dear, what is BAPI_INTERNALORDRGRP_GETDETAIL  used for?  do me a favor

    Hello experts:     Thank you in advance for all your replies.     what is  BAPI_INTERNALORDRGRP_GETDETAIL  for and when to use it?    couldn't thank you more.    Best regards.    Frank

  • Macbook Pro is SLOW as ****!!!

    I'm getting really annoyed with my Macbook! First of all, it's really really slow! Something always seems to be accesing the hard drive causing it to spin constantly. I'm always seeing the bloody beach ball and i'm always waiting for the computer to