What are dyanmic internal tables and what s the exact use of forall entries

what are dyanmic internal tables and what s the exact use of forall entries?

hi,
<u><b>dynamic internal table.</b></u>
http://searchsap.techtarget.com/tip/1,289483,sid21_gci912390,00.html
http://www.sap-img.com/ab030.htm
<u><b>
FOR ALL ENTRIES</b></u> is an effective way of doing away with using JOIN on two tables.
You can check the below code -
SELECT BUKRS BELNR GJAHR AUGDT
FROM BSEG
INTO TABLE I_BSEG
WHERE BUKRS = ....
SELECT BUKRS BELNR BLART BLDAT
FROM BKPF
INTO TABLE I_BKPF
FOR ALL ENTRIES IN I_BSEG
WHERE BUKRS = I_BSEG-BUKRS
AND BELNR = I_BSEG-BELNR
AND BLDAT IN SO_BLDAT.
*******************************8
look another example
what is the use of FOR ALL ENTRIES
1. INNER JOIN
DBTAB1 <----
> DBTAB2
It is used to JOIN two DATABASE tables
having some COMMON fields.
2. Whereas
For All Entries,
DBTAB1 <----
> ITAB1
is not at all related to two DATABASE tables.
It is related to INTERNAL table.
3. If we want to fetch data
from some DBTABLE1
but we want to fetch
for only some records
which are contained in some internal table,
then we use for alll entries.
1. simple example of for all entries.
2. NOTE THAT
In for all entries,
it is NOT necessary to use TWO DBTABLES.
(as against JOIN)
3. use this program (just copy paste)
it will fetch data
from T001
FOR ONLY TWO COMPANIES (as mentioned in itab)
4
REPORT abc.
DATA : BEGIN OF itab OCCURS 0,
bukrs LIKE t001-bukrs,
END OF itab.
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
itab-bukrs = '1000'.
APPEND itab.
itab-bukrs = '1100'.
APPEND itab.
SELECT * FROM t001
INTO TABLE t001
FOR ALL ENTRIES IN itab
WHERE bukrs = itab-bukrs.
LOOP AT t001.
WRITE :/ t001-bukrs.
ENDLOOP.
Hope this helps!
Regards,
Anver

Similar Messages

  • What are nested Internal tables

    Hi Guru's,
    I am new to ABAP ...just trying to learn things.Can you please explain me what are nested internal tables and what is the purpose of nested internal table?where can it be used and why a header line is not written in a Nested Internal table...
    Kindly explain it (scenario where nested internal tables are used) with an example it will be helpful.
    Cheers,
    Priyanka

    Hi,
    When storing data in internal tables, you often use one internal table for each database you read.
    Each one contains some or all columns of the relevant database table. It is up to you whether
    you create an internal table with a flat structure for each database table or if you create, for
    example, internal tables with nested structures. If you have several tables, each one with a flat
    structure, you have to work with redundant key fields to link the tables. If, on the other hand, you
    use nested internal tables, you can store the data from the database tables hierarchically.
    Saving and processing very large amounts of data in internal tables has disadvantages. If you
    divide up the data into different internal tables, processing it can be very runtime-intensive, since
    the tables have to be processed individually. Furthermore, it requires a lot of storage space,
    since internal tables are not stored in compressed form. The system may even need to store the
    dataset outside of its working memory. This means that processing it takes even longer.
    An example of nested internal table:
    Assume the following program is linked to the logical database [Page 1163] F1S.
    REPORT DEMO.
    DATA: SUM TYPE I, CNT TYPE I.
    NODES: SPFLI, SFLIGHT, SBOOK.
    DATA: BEGIN OF WA_SBOOK,
    BOOKID TYPE SBOOK-BOOKID,
    SMOKER TYPE SBOOK-SMOKER,
    CLASS TYPE SBOOK-CLASS,
    LUGGWEIGHT TYPE SBOOK-LUGGWEIGHT,
    WUNIT TYPE SBOOK-WUNIT,
    END OF WA_SBOOK.
    DATA: BEGIN OF WA_SFLIGHT,
    FLDATE TYPE SFLIGHT-FLDATE,
    SBOOK LIKE TABLE OF WA_SBOOK,
    END OF WA_SFLIGHT.
    DATA: BEGIN OF WA_SPFLI,
    CARRID TYPE SPFLI-CARRID,
    CONNID TYPE SPFLI-CONNID,
    CITYFROM TYPE SPFLI-CITYFROM,
    CITYTO TYPE SPFLI-CITYTO,
    SFLIGHT LIKE TABLE OF WA_SFLIGHT,
    END OF WA_SPFLI.
    DATA TAB_SPFLI LIKE TABLE OF WA_SPFLI.
    START-OF-SELECTION.
    GET SPFLI.
    REFRESH WA_SPFLI-SFLIGHT.
    GET SFLIGHT.
    REFRESH WA_SFLIGHT-SBOOK.
    GET SBOOK.
    MOVE-CORRESPONDING SBOOK TO WA_SBOOK.
    APPEND WA_SBOOK TO WA_SFLIGHT-SBOOK.
    GET SFLIGHT LATE.
    MOVE-CORRESPONDING SFLIGHT TO WA_SFLIGHT.
    APPEND WA_SFLIGHT TO WA_SPFLI-SFLIGHT.
    GET SPFLI LATE.
    MOVE-CORRESPONDING SPFLI TO WA_SPFLI.
    APPEND WA_SPFLI TO TAB_SPFLI.
    END-OF-SELECTION.
    SORT TAB_SPFLI BY CITYFROM CITYTO CONNID.
    LOOP AT TAB_SPFLI INTO WA_SPFLI.
    SKIP.
    WRITE: / WA_SPFLI-CARRID,
    WA_SPFLI-CONNID,
    'from', (15) WA_SPFLI-CITYFROM,
    'to', (15) WA_SPFLI-CITYTO.
    ULINE.
    SORT WA_SPFLI-SFLIGHT BY FLDATE.
    LOOP AT WA_SPFLI-SFLIGHT INTO WA_SFLIGHT.
    SKIP.
    WRITE: / 'Date:', WA_SFLIGHT-FLDATE.
    WRITE: 20 'Book-ID', 40 'Smoker', 50 'Class'.
    ULINE.
    SORT WA_SFLIGHT-SBOOK BY CLASS SMOKER BOOKID.
    SUM = 0.
    CNT = 0.
    LOOP AT WA_SFLIGHT-SBOOK INTO WA_SBOOK.
    WRITE: / WA_SBOOK-BOOKID UNDER 'Book-ID',
    WA_SBOOK-SMOKER UNDER 'Smoker',
    WA_SBOOK-CLASS UNDER 'Class'.
    SUM = SUM + WA_SBOOK-LUGGWEIGHT.
    CNT = CNT + 1.
    ENDLOOP.
    ULINE.
    WRITE: 'Number of bookings: ', (3) CNT,
    / 'Total luggage weight:',
    (3) SUM, WA_SBOOK-WUNIT.
    ENDLOOP.
    ENDLOOP.
    Thanks.

  • What are views in DDIC and plz mention the difference between them

    hi,
    What are views in DDIC and plz mention the difference between the different type of views..
    1) maintainence view
    2)database view
    3)Projection view
    4)help view
    P.S : Good answers will be rewarded with points.

    Hi,
    The followings are different types of views:
    - Database View   (SE11)
    Database views are implement an inner join, that is, only records of the primary table (selected via the join operation) for which the corresponding records of the secondary tables also exist are fetched. Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set. 
    In database views, the join conditions can be formulated using equality relationships between any base fields. In the other types of view, they must be taken from existing foreign keys. That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.
    - Help View    ( SE54)
    Help views are used to output additional information when the online help system is called. 
    When the F4 button is pressed for a screen field, a check is first made on whether a matchcode is defined for this field. If this is not the case, the help view is displayed in which the check table of the field is the primary table. Thus, for each table no more than one help view can be created, that is, a table can only be primary table in at most one help view. 
    - Projection View
    Projection views are used to suppress or mask certain fields in a table (projection), thus minimizing the number of interfaces. This means that only the data that is actually required is exchanged when the database is accessed.
    A projection view can draw upon only one table. Selection conditions cannot be specified for projection views.
    - Maintenance View   ( SE54 )
    Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system
    Thanks,
    Shankar

  • What are abstract classes/methods and what are they for?

    Hi,
    I've just heard about abstract classes and methods and I'm just wondering what exactly they're used for, and why are they there for the Graphics class for example?
    Cheers.

    raggy wrote:
    bastones_ wrote:
    Hi,
    I've just heard about abstract classes and methods and I'm just wondering what exactly they're used for, and why are they there for the Graphics class for example?
    Cheers.Hey bro, I'll try to solve your problemYou have to know two important concepts for this part. 1 is Abstract classes and the other is Interface classes. Depends on the nature of the project, you need to set certain level of standards and rules that the other developers must follow. This is where Abstract classes and Interface classes come into picture.
    Abstract classes are usually used on small time projects, where it can have code implementation like general classes and also declare Abstract methods (empty methods that require implementation from the sub-classes).Wrong, they are used equally among big and small projects alike.
    Here are the rules of an Abstract class and method:
    1. Abstract classes cannot be instantiatedRight.
    2. Abstract class can extend an abstract class and implement several interface classesRight, but the same is true for non-abstract classes, so nothing special here.
    3. Abstract class cannot extend a general class or an interfaceWrong. Abstract classes can extend non-abstract ones. Best example: Object is non-abstract. How would you write an abstract class that doesn't extend Object (directly or indirectly)?
    4. If a class contains Abstract method, the class has to be declared Abstract classRight.
    5. An Abstract class may or may not contain an Abstract methodRight, and an important point to realize. A class need not have abstract methods to be an abstract class, although usually it will.
    6. Abstract method should not have any code implementations, the sub-classes must override it (sub-class must give the code implementations). An abstract method must not have any implementation code code. It's more than a suggestion.
    7. If a sub-class of an Abstract class does not override the Abstract methods of its super-class, than the sub-class should be declared Abstract also.This follows from point 4.
    9. Abstract classes can only be declared with public and default access modifiers.That's the same for abstract and non-abstract classes.

  • To compare two internal tables and delete records

    Hi friends,
        I have to compare two internal tables and should delete the records which is not present in both the tables. Reply me as soon as possible.
    Thanks.

    Hi Nagarajan,
    1. I don't think there is any direct (one-shot statement)
        way to achieve this.
        one has to do by writing some logic.
    2. Loop at ITAB1.
         Read table ITAB2 with key Field1 = ITAB1-Field1.
         If sy-subrc <> 0.
         delete ITAB1.
         endif.
       Endloop.
      Do the same again with ITAB2.
       Loop at ITAB2.
         Read table ITAB1 with key Field1 = ITAB2-Field1.
         If sy-subrc <> 0.
         delete ITAB2.
         endif.
       Endloop.
    3. If any better way is found, i will let u know.
    Hope it helps.
    Regards,
    Amit M.

  • What is alignment in unicode and what are restrictions

    what is alignment in unicode and what are restrictions, dont give about unicode i want only about alignment in unicode
    Points will be awarded if usefull

    Hi,
    Check the following Threads,
    what is internal and external encoding in unicode
    Unicode
    UNICODE
    Regards,
    Padmam.

  • What are PSI accesed teckets and system generated ticktes?

    helllo friends,
    i am srinu.
    I have  a doubt that what are PSI accessed tickets and system generated tickets.Plz let me know.
    and also send me the doc about Bex browser and wad and navigation paths.
    and some faqs for interviews.
    My mail id is [email protected]
    wiating for u r reply.
    bye

    hello Vasu ,
    REGARDING PSI :  In organizations where SAP R/3 is the standard ERP system, PSI allows project managers to benefit from PS8's power and flexibility, while continuing to disseminate project data through the SAP R/3 system. With PSI, project managers using both PS8 and SAP R/3 can now easily and accurately share information between the two systems. Essentially, PSI translates data from one application into the appropriate context in the other application, allowing both PS8 and SAP R/3 users to manage the same information in different ways. While the relationship between corresponding fields in PS8 and the Project System module of SAP R/3 is predefined, PSI allows you to easily customize the specific selection of data to be transferred between the applications.
    REGARDING SYSTEM GENE.... iTS ALREADY BEEN DISCUSSED
    list of some functional modules FOR CURRENCY TRANSL;ATYIO ARE
    AIB5_GET_CURR_CONV_PARAMETERS
    BAPI_CURRENCY_CONV_TO_EXTERNAL Conversion of Currency Amounts into External Data Format
    BAPI_CURRENCY_CONV_TO_EXTERN_9 Conversion of Currency Amounts into External Data Format
    BAPI_CURRENCY_CONV_TO_INTERNAL Conversion of Currency Amounts into Internal Data Format
    BAPI_CURRENCY_CONV_TO_INTERN_9 Conversion of Currency Amounts into Internal Data Format
    hOPE THIS HELPS YOU .
    GOOD LUCK!

  • What is causing this problem and what are you doing to fix it? Should I just go back to Internet Explorer?

    Every single day, Firefox crashes and sometimes in the most inopertune time. This is very frustrating as some of the times I can not go back in and correct what I was not able to do due to your site crashing. What is causing this problem and what are you doing to fix it? Should I just go back to Internet Explorer?

    First, you must use a specific [[Managing profiles|profile]] for Firefox 4.0 Beta and keep your current one for Firefox 3.6 to prevent interferences between the two versions.
    For your problem:
    # [[Troubleshooting extensions and themes]] could be a cause.
    # If not 1. and if it does not happen in [[Safe Mode]], you must disable HW acceleration in Options > Advanced > General. If it solves your issue, your graphic driver is out-of-date and must be updated. Go to your computer manufacturer support site.

  • HT1688 My iphone 5 won't charge and it's in perfect condition, I dont drop it and it's not cracked. I tried multiple chargers, none of them are damaged and my outlets work with other things so the problem is my phone. What's wrong with it and what should

    My iphone 5 won't charge and it's in perfect condition, I dont drop it and it's not cracked. I tried multiple chargers, none of them are damaged and my outlets work with other things so the problem is my phone. What's wrong with it and what should I do? Please help me I need my phone for work.

    Make sure there's nothing blocking a contact in the charging port of the phone.

  • What table and fileds we have to use to develop a report for blocked

    what table and fileds we have to use to develop a report for blocked invoices?

    VBRK-RFBSK
    <b>     Error in Accounting Interface
    A     Billing document blocked for forwarding to FI
    B     Posting document not created (account determ.error)
    C     Posting document has been created
    D     Billing document is not relevant for accounting
    E     Billing Document Canceled
    F     Posting document not created (pricing error)
    G     Posting document not created (export data missing)
    H     Posted via invoice list
    I     Posted via invoice list (account determination error)
    K     Accounting document not created (no authorization)
    L     Billing doc. blocked for transfer to manager (only IS-OIL)
    M     Analyst Approval refused (only IS-OIL)
    N     No posting document due to fund management (only IS-PS)</b>
    Regards
    prabhu

  • 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.

  • Internal table and work area

    Hi,
           can anybody explain the concepts of Internal table and work area.Thanks in advance.

    hai,
    This may help 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.
    more about internal table types:
    Standard table:
    The key access to a standard table uses a sequential search. The time required for an access is linearly dependent on the number of entries in the internal table.
    You should usually access a standard table with index operations.
    Sorted table:
    The table is always stored internally sorted by its key. Key access to a sorted table can therefore use a binary search. If the key is not unique, the entry with the lowest index is accessed. The time required for an access is logarithmically dependent on the number of entries in the internal table.
    Index accesses to sorted tables are also allowed. You should usually access a sorted table using its key.
    Hash table:
    The table is internally managed with a hash procedure. All the entries must have a unique key. The time required for a key access is constant, that is it does not depend on the number of entries in the internal table.
    You cannot access a hash table with an index. Accesses must use generic key operations (SORT, LOOP, etc.).
    Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index.
    The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always
    have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for
    processing large amounts of data.
    TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.
    TYPES: BEGIN OF LINE,
    COLUMN1 TYPE I,
    COLUMN2 TYPE I,
    COLUMN3 TYPE I,
    END OF LINE.
    DATA ITAB TYPE HASHED TABLE OF SPFLI
    WITH UNIQUE KEY CARRID CONNID.
    with regards,
    B.Sowjanya,
    reward points if helpful.

  • What are non-transportable tables

    What are non-transportable tables?
    I am under the impression that any non-transportable object is a "local object".
    Am I right?
    Thanks,
    Raghu.

    Hi,
    Yes you are right. All the object created under $TMP package are non- transportable.
    We cannot transport these objects.
    There will not be any thing like Non transportable tables.
    Regards,
    Venkatesh.

  • What are user parameters? and how can i add user parameter

    Hi Experts,
    what are user parameters? and how can i add user parameter and how can i add a user parameter
    HR_DISP_INFTY_NUM with value X?

    user parameters are used give reference grps and counntry grouping use SU3 tcode as amite said

  • What are Task assignment adapter and Task Assignment Rule?

    What are Task assignment adapter and Task Assignment Rule?

    Task assignment adapter lets you return a value to the type and assignee values in the adapter. You can use these to dynamically assigned to users or groups.
    Task assignment rules let you specific the priority in which the assignment rules are done. If you go to any process task adapter and open it. Go to the assignemnt tab. Here is where you can specifiy your rules to create an order of determination. You can have multiple entries with rules determining organization and then have them assigned to appropriate groups in each assignemt rule entry. Or you can dynamically assign by using the default and a task assignment adapter to figure that out.
    -Kevin

Maybe you are looking for

  • How can I get the coordinate in the layer coordinate system while doing the iterate?

    I found that the position(x,y) the iterate function tell me is not right sometimes. Actually,it happens when the top of the layer is negative. The "y"is in the comp coordinate system(maybe?) but not the layer.In another word, the position with y=0 is

  • Can we report on BW table using BW query

    Hello All, I want to know if we can create a DSO on top of a table created in BW system (NOT ECC system). In this case can we do a DSO with table as a data source or something similar to that. There are no Key figures. Actually the scenario is if we

  • Screen Refresh

    So in the most basic (first exercise) jsp, it works fine, but; if I open another instance of IE and then return to the �localhost�page (*.jsp) clicking the submit button causes the page to refresh to default values. It also takes 10-15 seconds for th

  • ATV doesn't work with mp4 and mov files

    Apple TV doesn't play the mp4 or mov files that are in my iTunes Library. ATV plays only m4v video. How can I do? Thanks, Lud

  • - development kit applet window

    hey i downloaded j2sdk1.4.0_03 and cant seem to find a use able apllet window tester. i have a book that talks of a develment kit, do i need this? where do i find it? thanks