Best way to declare and use internal table

Hi all,
As per my knoledge there are various techeniques (Methods) to declare and use the internal tables.
Please Suggest me the Best way to declaring and using internal table ( WITH EXAMPLE ).
Please Give the reason as well how the particular method is good ?
What are benefits of particular method ?
Thanks in advance.
Regards
Raj

Hello Raj Ahir,
There are so many methods to declare an internal table.
Mainly I would like to explain 2 of them mostly used.
1. Using Work Area and
2. With header line.
This with header line concept is not suggestable, because, when we shift the code to oops concept.. it doesn't work... Because OOPS doesn't support the Headerline concept...
But it all depends on the situation.
If you are sure that your program doen't make use of the OOPs concept, you can use HEADER LINE concept. If it invols OOPs use WORK AREA concept.
Now I'l explain these two methods with an example each...
1. Using Work area.
TABLES: sflight.
DATA: it_sflight TYPE TABLE OF sflight.
DATA: wa_sflight LIKE LINE OF it_sflight.
SELECT *
  FROM sflight
  INTO it_sflight
  WHERE <condition>.
  LOOP AT it_sflight INTO wa_sflight.
    WRITE / wa_sflight.
  ENDLOOP.
  In this case we have to transfer data into work area wa_sflight.
We can't access the data from the internal table direclty without work
area.
*<===============================================
2. Using Header line.
  DATA: BEGIN OF it_sflight OCCURS 0,
          carrid LIKE sflight-carrid,
          connid LIKE sflight-connid,
          fldate LIKE sflight-fldate,
        END OF it_sflight.
  SELECT *
    FROM sflight
    INTO it_sflight
    WHERE <condition>.
    LOOP AT it_sflight INTO wa_sflight.
      WRITE / wa_sflight.
    ENDLOOP.
In this case we can directly access the data from the internal table.
Here the internal table name represents the header. for each and every
interation the header line will get filled with new data. If you want to
represnent the internal table body you can use it_sflight[].
*<======================================================
TYPES: BEGIN OF st_sflight,
         carrid LIKE sflight-carrid,
         connid LIKE sflight-connid,
         fldate LIKE sflight-fldate,
       END OF st_sflight.
DATA: it_sflight TYPE TABLE OF st_sflight,
      wa_sflight LIKE LINE OF it_sflight.
This is using with work area.
DATA: it_sflight LIKE sflight OCCURS 0 WITH HEADER LINE.
This is using header line.
<b>REWARD THE POINTS IF IT IS HELPFUL.</b>
Regards
Sasidhar Reddy Matli.
Message was edited by: Sasidhar Reddy Matli
        Sasidhar Reddy Matli

Similar Messages

  • What is the best way to add and use custom fonts with Eloqua?

    We have a custom font that we'd like to use with Eloqua and were wondering how others might have successfully approached this.

    ~~Disclaimer: This answer refers to email fonts only - landing page font imports are discussed below~~
    Hi Brett,
    I took a look at these two posts: Re: Tips for getting the E10 email editor to change the email font for Outlook & other old-school email clients? and Re: E10 Fonts
    It seems that there are reasons as to why only a few of the fonts are supported. You can drill down into the source code to edit the font type, but I'm not sure that will get you anywhere.
    To drill down:
    To get the desired font & size in various clients (Gmail, Hotmail, Yahoo, Outlook) I found that specifying in the html works best.
    So whether it’s a P or TD, tag I add the style attribute & specify the font along with color & size.
    e.g.:
    <td style="LINE-HEIGHT: 18px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #000000; FONT-SIZE: 12px;">
    Of course if you use the WYSIWYG editor you will have to view the html source & add this.

  • Differences between Standard , sorted and hashed internal tables

    Can any body please tell me what are the main Differences between
    1) <b>Standard internal table</b>
    2) <b>Hashed internal table</b>
    3) <b>Sorted internal table</b>
    Please give me a clear idea about these Three.
    Thanks
    Prabhudutta<b></b>

    Hi,
    <b>Standard Internal Tables</b>
    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.
    <b>Sorted Internal Tables</b>
    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.
    <b>Hashed Internal Tables</b>
    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
    Sudheer

  • What is the best way to declare field length 500 in internal table?

    Hi all,
    what is the best way to declare field length 500(constant value allways) in internal table?
    I am trying to send data from internal table to file format, and I have a field in internal table with 500 length (constant value always). So how do I can declare and append this field value to table?
    Thanks
    Murali

    Hi.  Please see the following example program, notice how I am filling the field with the constant value.
    report zrich_0001.
    *       CLASS lcl_main DEFINITION
    class lcl_main definition.
      public section.
        types: begin of ttab,
                fld1(500) type c,
               end of ttab.
        data: itab type table of ttab.
        data: xtab type ttab.
        methods: constructor,
                 write_itab.
    endclass.
    *       CLASS lcl_main IMPLEMENTATION
    class lcl_main implementation.
      method constructor.
    <b>
        xtab-fld1 =
          'This is one part of the total string which needs to be really' &
          ' long and this is a constant and we need to move it to a work' &
             ' area and then append it to the internal table which has a' &
              ' field with a length of five hundred characters'.
        append xtab to itab.</b>
      endmethod.
      method write_itab.
        loop at itab into xtab.
          write:/ xtab-fld1.
        endloop.
      endmethod.
    endclass.
    data: o_main type ref to lcl_main.
    start-of-selection.
      create object o_main.
      call method o_main->write_itab.
    Regards,
    Rich Heilman

  • ALV display using dynamic field catalog and dynamic internal table

    hi ,
    please guide me for ALV display using dynamic field catalog and dynamic internal table.
    Thank you.

    Hi Rahul,
    maybe thread dynamic program for alv is helpful for you. More information about the [SAP List Viewer (ALV)|http://help.sap.com/saphelp_nw70/helpdata/EN/5e/88d440e14f8431e10000000a1550b0/frameset.htm]. Also have a look into the example programs SALV_DEMO_TABLE*.
    Regards Rudi

  • There are way too many photos on my internal hard drive. I have older libraries, and newer libraires in iPhoto and Aperture 2.  What is the best way to find and reduce the number of duplicate photos/libraries  before upgrading to Aperture 3?

    There are way too many photos on my internal hard drive. I have older libraries, and newer libraires in iPhoto and Aperture 2.  What is the best way to find and reduce the number of duplicate photos/libraries  before upgrading to Aperture 3?

    Sharon-
    Good idea.
    Back up first.
    I would probably wait for the merge function of the latest version before merging. Be sure to verify every merge.
    Merge Libraries, then from within Aperture move images to referenced on external hard drives.
    HTH
    -Allen

  • Using internal tables in BI 7 Start routines

    Hi All
    I tried searching for using internal tables in a start routine in BI 7 could not find the right pointers.
    This is what I am trying to do is the following:
    In a DSO ZSD_O01  I have a sales order and sales order item number and this DSO also contains the Contract number and the contract Item number.
    The DSO structure is as follows:
    /BIC/AZSD_O0100
    DOC_NUMBER
    ITEM
    CONTRACT
    CITEMNUM
    I want to read the data in this DSO into a internal table. But the key fields in this DSO is DOC_NUMBER and ITEM so I want to read this data into a internal table only for the first data package into the internal table. Thereafter I want to lookup into the internal table given the doc_number and ITEM to find the CONTRACT and CITEMNUM.
    Can any of you kindly show me how to :
    - Read data from a DSO into a internal table
    - Read the internal table for the first data package
    - How do I make the access in the internal table fast when my lookup in the internal table is not on the
      DSO key columns but on a different key column
    Appreciate your help
    Thanks
    Karen

    Hi Karen ,
    It will be helpful if you tell your requirement  as the approach you suggested is not looks convincing .May be their is some easy way and we can suggest you better approach
    -how to check for source_package = 1
    You need to hard code it .
    We decide package size at DTP level so you can declare a global variable .let say you have 50000 size of your  package then use global variable as counter and read only when record_count is <= 50000 .
    -how to declare the internal table so the values in it exists between different data packages
    Declare a global table and select data into it .A global table retain data across  the packages .
    - The key on which I need to lookup in the internal table is not the key fields as in the DSO
    Its ok .Let say you are doing lookup on A B and C field of DSO1 and the values may duplicate  in your source .then you just need to read the internal table having data from DSO2  with key field  A B C .
    Better if you set them as semantic keys at DTP level so that all  duplicate entries of A B  C will appear in same package .
    global Declarations
    In your start routine you will have this following code :
      TYPES:
          tyt_SC_1        TYPE STANDARD TABLE OF tys_SC_1
                            WITH NON-UNIQUE DEFAULT KEY.
    $$ begin of global - insert your declaration only below this line  -
    ...   insert your code here
    $$ end of global - insert your declaration only before this line   -
    One question
    Why you want to populate values for 1 source package only not for all ?This will be helpful to understand your requirement and may be we can fulfill it in some other manner .
    Regards,
    Jaya Tiwari

  • Which method to use internal table?

    Should I declare a type and then internal table of that type with a field symbol
    OR should I go for a work area ( using DATA ) and OR should I use STANDARD table with a header line.
    Also what is better using Field Symbols or Work Area.
    Amol

    Hi amol,
      you should consider a few things when deciding how to declare an internal table.
    1. statement "WITH HEADER LINE" is deprecated in object oriented context and in new SAP R/3 releases. You should avoid it
    2. accessing a table via work area is slower than Field-symbol ( but in some cases using a work area is a must ).
    Examples:
    loop at table assigning <fs>.
      <fs>-field1 = 'X'.
    endloop.
    is more fast then
    loop at table into wa.
      wa-field1 = 'X'.
      modify table from wa.
    endloop.
    It is not a good idea to use field-symbols with at statement inside a loop.
    loop at table assigning <fs>.
      at new field1.
      ... do something ...
      endat.
    endloop.
    It changes your internal table with some dirty data (***)
    3. Use sorted/hashed tables when possible
    Regards, Manuel
    Please remember to reward points for useful answers and to close the post if your problem is solved

  • Creation of Sorted and Standard and Hashed Internal Tables ..

    Hi ..
    Pls  specify me.. how to create .. sorted ,Standard and Hashed Internal Tables...
    pls give me  the full code  regarding ...this ..
    Thnks

    Standard tables
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
    Sorted tables
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
    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.
    Special Features of Standard Tables
    Unlike sorted tables, hashed tables, and key access to internal tables, which were only introduced in Release 4.0, standard tables already existed several releases previously. Defining a line type, table type, and tables without a header line have only been possible since Release 3.0. For this reason, there are certain features of standard tables that still exist for compatibility reasons.
    Standard Tables Before Release 3.0
    Before Release 3.0, internal tables all had header lines and a flat-structured line type. There were no independent table types. You could only create a table object using the OCCURS addition in the DATA statement, followed by a declaration of a flat structure:
    DATA: BEGIN OF <itab> OCCURS <n>,
    <fi> ...
    END OF <itab>.
    This statement declared an internal table <itab> with the line type defined following the OCCURS addition. Furthermore, all internal tables had header lines.
    The number <n> in the OCCURS addition had the same meaning as in the INITIAL SIZE addition from Release 4.0. Entering ‘0’ had the same effect as omitting the INITIAL SIZE addition. In this case, the initial size of the table is determined by the system.
    The above statement is still possible in Release 4.0, and has roughly the same function as the following statements:
    TYPES: BEGIN OF <itab>,
    <fi> ...,
    END OF <itab>.
    DATA <itab> TYPE STANDARD TABLE OF <itab>
    WITH NON-UNIQUE DEFAULT KEY
    INITIAL SIZE <n>
    WITH HEADER LINE.
    In the original statement, no independent data type <itab> is created. Instead, the line type only exists as an attribute of the data object <itab>.
    Standard Tables From Release 3.0
    Since Release 3.0, it has been possible to create table types using
    TYPES <t> TYPE|LIKE <linetype> OCCURS <n>.
    and table objects using
    DATA <itab> TYPE|LIKE <linetype> OCCURS <n> WITH HEADER LINE.
    The effect of the OCCURS addition is to construct a standard table with the data type <linetype>. The line type can be any data type. The number <n> in the OCCURS addition has the same meaning as before Release 3.0. Before Release 4.0, the key of an internal table was always the default key, that is, all non-numeric fields that were not themselves internal tables.
    The above statements are still possible in Release 4.0, and have the same function as the following statements:
    TYPES|DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
    WITH NON-UNIQUE DEFAULT KEY
    INITIAL SIZE <n>
    WITH HEADER LINE.
    They can also be replaced by the following statements:
    Standard Tables From Release 4.0
    When you create a standard table, you can use the following forms of the TYPES and DATA statements. The addition INITIAL SIZE is also possible in all of the statements. The addition WITH HEADER LINE is possible in the DATA statement.
    Standard Table Types
    Generic Standard Table Type:
    TYPES <itab> TYPE|LIKE STANDARD TABLE OF <linetype>.
    The table key is not defined.
    Fully-Specified Standard Table Type:
    TYPES <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
    WITH NON-UNIQUE <key>.
    The key of a fully-specified standard table is always non-unique.
    Standard Table Objects
    Short Forms of the DATA Statement :
    DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>.
    DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
    WITH DEFAULT KEY.
    Both of these DATA statements are automatically completed by the system as follows:
    DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
    WITH NON-UNIQUE DEFAULT KEY.
    The purpose of the shortened forms of the DATA statement is to keep the declaration of standard tables, which are compatible with internal tables from previous releases, as simple as possible. When you declare a standard table with reference to the above type, the system automatically adopts the default key as the table key.
    Fully-Specified Standard Tables:
    DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
    WITH NON-UNIQUE <key>.
    The key of a standard table is always non-unique.
    Internal table objects
    Internal tables are dynamic variable data objects. Like all variables, you declare them using the DATA statement. You can also declare static internal tables in procedures using the STATICS statement, and static internal tables in classes using the CLASS-DATA statement. This description is restricted to the DATA statement. However, it applies equally to the STATICS and CLASS-DATA statements.
    Reference to Declared Internal Table Types
    Like all other data objects, you can declare internal table objects using the LIKE or TYPE addition of the DATA statement.
    DATA <itab> TYPE <type>|LIKE <obj> WITH HEADER LINE.
    Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the program declared using the TYPES statement, or a table type in the ABAP Dictionary.
    You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).
    The optional addition WITH HEADER line declares an extra data object with the same name and line type as the internal table. This data object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate this by placing brackets after the table name (<itab>[]). Otherwise, ABAP interprets the name as the name of the header line and not of the body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.
    TYPES VECTOR TYPE SORTED TABLE OF I WITH UNIQUE KEY TABLE LINE.
    DATA: ITAB TYPE VECTOR,
    JTAB LIKE ITAB WITH HEADER LINE.
    MOVE ITAB TO JTAB. <- Syntax error!
    MOVE ITAB TO JTAB[].
    The table object ITAB is created with reference to the table type VECTOR. The table object JTAB has the same data type as ITAB. JTAB also has a header line. In the first MOVE statement, JTAB addresses the header line. Since this has the data type I, and the table type of ITAB cannot be converted into an elementary type, the MOVE statement causes a syntax error. The second MOVE statement is correct, since both operands are table objects.
    plz reward if useful

  • Whats the best way to manipulate  data using a Form ??

    I have a few forms and basic navigation and data manipulation I find are rubbish - cos I am rubbish at making it any better.
    I have a customer form (layout style of form) and table, I set up 2 buttons (enter_query & execute_query) to retrieve specific details based on customer ID input by the user. If the specified ID is for the wrong customer I want a button or buttons that will navigate through the IDs one by one until the right customer is found. If it was a tabular form I could do it but can I manage this if the form is not ?
    Once the data is retrieved what is the best way to manipulate and save it ? Can I create a button that has PL/SQL code to UPDATE that particular record or do you guys and girls use the SAVE icon ?
    Finally, I can't work out how to get the right side of the form displayed it seems to miss off an inch or 2. The canvas editor shows the form properly, the window size is just a smidge bigger than the canvas. When the form is run, how can I make the display area for the R/H/S bigger ?
    Thanks in advance.

    Sorry - I had to read up on what a base table block was.
    I think I am. In this particular form I have one block - a customer block which has its items pulled in from the customer table, no problems there, it works fine.
    My problem is I need to make it as user friendly as possible, if the user inputs the wrong customer ID (or does not know their name) I want them to be able to scroll through the customer list using an up or down button.
    When do you have the commit_form statement run, (the OK button) after every change or after a block of changes ? Commit writes the changes to the database giving other users access to that data right ?! How often should it be used ?

  • Best way to compare data of 2 tables present on 2 different servers

    Hi,
    We are doing data migration and I wil like to compare data between 2 tables which are present on 2 different server. I know to find the difference i can go for minus or full outer join and by creating the database link.
    But my problem is the volume of the data. The tables under consideration has approximately 40-60 columns and number of rows in each tables are around 60-70 million. Also both the tables are on 2 diffferent servers.
    I would like to know
    1] What will be the best way to compare the data and print the difference from performance perepective? I know that if I am going for DB links then its will definitely impact the performance as the tables are across 2 different servers.
    2] Is it advisable to go for using SQL - PL/SQL for this kind of senario or dump the data in flat files and use C or C++ code to find the difference.
    Regards,
    Amol

    Check this at asktom.oracle.com. Search for "Marco Stefanetti" and follow the few posts between Marco and Tom. As far as your tables being on separate servers, you could consider dumping the data to file and using external table or using CTAS ( create table as select ) to get both tables locally.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2151582681236

  • Best way of partitioning the huge size table in oracle 11gr2

    hi,
    OS: linux
    DB: oracle 11gR2
    table size is about 2T and single table space with multiple dbf files in ASM,
    table partition with dbms.redefinition is running past 2 days (range partition).. its running but not that fast..
    note: exchange partition is too slow.. hence not used..
    what is the best way of doing the huge size table partition. please suggest, thanks.

    >
    what is the best way of doing the huge size table partition
    >
    A few questions
    1. Is that an OLTP or OLAP table?
    2. Is all of the data still needed online or is some of it archivable?
    3. What type of partitiioning are you doing? RANGE? LIST? COMPOSITE?
    4. Why do you you say 'exchange partition is too slow' - did you do a test?
    For example if data will be partitioned by create date then one stragety is to initially put all existing data into the root partition of a range partitioned table. Then you can start using new partitions for new incoming data and take your time to partition the current data.

  • Abap Logic for performance tuning not working when using Internal tables

    Hi,
    I wrote this piece of code that is working correctly that is select SUM of cost from DSO where Plant is the same for Sales Items.
    LOOP AT RESULT_PACKAGE INTO rp.
    SELECT SUM( /N/S_STRDCOST ) FROM /N/ADSP_DPIT00 INTO
    rp-/N/S_STRDCOST
    WHERE /N42/S_SALESITEM = rp-/N42/S_ITEMID AND /N42/S_PLPLANT EQ
    rp-/N42/S_SOURCE.
    MODIFY RESULT_PACKAGE FROM rp.
    Clear rp.
    ENDLOOP.
    Now I try to rewrite it for performance tunning using internal table  but I am getting 0 values. can't figure out whats the problem and been struggling fixing it.
    TYPES : begin of ty_DSO_TABLE,
             /N42/S_STRDCOST TYPE /N/ADSP_DSPC00-/N/S_STRDCOST,
             /N42/S_ITEMID TYPE /N/ADSP_DSPC00-/N/S_ITEMID,
           end of ty_DSO_TABLE.
    DATA: it_DSO_TABLE type hashed table of ty_DSO_TABLE with unique key
    /N/S_ITEMID,
         wa_DSO_TABLE type ty_DSO_TABLE.
    Field-symbols:  <rp> TYPE tys_TG_1.
    LOOP AT RESULT_PACKAGE assigning <rp>.
      clear wa_DSO_TABLE.
    Read table IT_DSO_TABLE into wa_DSO_TABLE with table key /N/S_ITEMID
      = <rp>-/N/S_ITEMID.
      if sy-subrc ne 0.
          select SUM( /N/S_STRDCOST )  into CORRESPONDING
          FIELDS OF wa_DSO_TABLE from
          /N/ADSP_DPIT00 WHERE /N/S_SALESITEM =  <rp>-/N/S_ITEMID AND
          /N/S_PLPLANT EQ <rp>-/N/S_SOURCE.
         if sy-subrc eq 0.
              <rp>-/N/S_STRDCOST = wa_DSO_TABLE-/N/S_STRDCOST.
         endif.
    endif.
    ENDLOOP.
    Any idea whats wrong with the code
    thanks

    Hi Vaidya,
    According to the code which you have written, there is no value in table IT_DSO_TABLE when you are trying to read the values.And after the read statement you have given a condition for sy-subrc. Hence the select statement is actually not even getting executed. *Also you have not assigned the final value back to the ResultPackage.*_
    So Kindly correct your code as follows:
    Data: wa_dso type ty_DSO_TABLE.
    LOOP AT RESULT_PACKAGE assigning <rp>.
    clear wa_DSO_TABLE.
    select SUM( /N/S_STRDCOST ) into CORRESPONDING
    FIELDS OF wa_DSO_TABLE from
    /N/ADSP_DPIT00 WHERE /N/S_SALESITEM = <rp>-/N/S_ITEMID AND
    /N/S_PLPLANT EQ <rp>-/N/S_SOURCE.
    if sy-subrc eq 0.
    <rp>-/N/S_STRDCOST = wa_DSO_TABLE-/N/S_STRDCOST.
    MODIFY RESULT_PACKAGE FROM <rp>.
    endif.
    ENDLOOP.
    Hope this helps you.
    Regards,
    Satyam

  • What is the best way to store and search 2D data

    Hi,
    There is a set of data (~10k records ) in 2D dimension.
    like this :
    Col 1, Col 2, Col3....
    What is the best way to store and search those records ?
    Thanks in advance
    Wilson

    Hi,
    Either userObjet[][] if you know how much data you have, and the data size is fixed, or use a list of lists. E.g. A Vector of Vectors (some will probably say that you should use an ArrayList instead, and that could be the case, but it sounds like you would want to display the data later on, and a DefaultTableModel (for JTables) uses a Vector as data holder).
    Kaj

  • What is the best way to scan and sort old photos in iPhoto

    What is the best way to scan and sort old photos in iPhoto?  They do not have digital dates.

    Hey Chicago Sue,
    Once you scan them and have them on your desktop. You should use Automator and assign the common IPTC tags to the images, so that when you do import them into iPhoto, they get recorded.
    Here is an example of an action in Automator:

Maybe you are looking for

  • Want check box checked as default for a newly added subscreen in ME21N

    Hi Guys,              I have added a subscreen in ME21N with one field with check box. When I enter ME21N I should get that checkbox CHECKED automatically. How to do this. And one more thing is when manually putting checkmark,when I press enter that

  • How to compare varchar with number

    i am doing one report for that am passing receipt number(from , to) as parameters if i compare for that table i am getting output. select receipt_num from rcv_shipment_headers rsh where to_number(rsh.receipt_num) between nvl(:P_RECEIPT_FROM,rsh.recei

  • Down Arrow Key Problem

    Ok, so i was just messing around on my computer like always.  I held down the up arrow key to scroll up to a page, and when doing so the bottom arrow key came off.  This is where the fun begins .... I have tried numerous attempts to put the arrow key

  • 2 Problems after migration Project Server 2007 to 2010

    Hi Everyone!! I have 2 issues after migrate MS Project Server 2007 to Project Server 2010, in fact i had a lot issues, but i can solve almost all, so after solve all issues, just is pendings 2 issues very rare: Backgrounds: Migrated from: Windows Ser

  • Problem in filter data in alv

    Hi I Generate a ALV report . Now I am Selecting one column of the report  and setting filter condition , the report is getting filtered . but the problem is when i select another column along with previous selected  column , Filter Condition is getti