Getting internal table definition

Hi all,
Let's say that I've defined internal table based on internal type (not in dictionary). Does anybody know if there is some FM that could return to me definition of that table (how many fields, their types and so on). For dictionary based type there is a lot of these FM starting with "DD*". Is there anything like that for internal tables?
BR
Marcin

Hi,
Try this...
DATA : l_descr_ref TYPE REF TO cl_abap_structdescr.
l_descr_ref ?=  cl_abap_typedescr=>describe_by_data( itab ).
Now l_descr_ref->components holds the entire list of fields in itab.
Thanks,
Renjith.

Similar Messages

  • How to get internal table from SAP Data Provider C#

    Hello.
    ABAP:
       DATA: lt_t001 TYPE TABLE OF t001.
       DATA: url(1000) TYPE c.
      SELECT * INTO TABLE lt_t001 FROM t001.
      CALL FUNCTION 'DP_CREATE_URL'
        EXPORTING
          type                 = 'APPLICATION'
          subtype           = 'X-R3TABLE'
        TABLES
          data                 = lt_t001
        CHANGING
          url                    = url
        EXCEPTIONS
          OTHERS           = 4.
    C#:
    using SAPDataProvider;
    using SAPTableFactoryCtrl;
    public void SetDataFromUrl(string url)
                SAPDataProviderClass p = new SAPDataProviderClass();
                p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
                ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
                SAPTableFactoryClass tf = new SAPTableFactoryClass();
                Table tb = (Table)tf.NewTable();
                tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
    How to get internal table from SAP Data Provider ?

    Hi Sergey,
    I'm trying to do the same, have you found a solution to solved it?
    thanks for your help.
    Regards.
    Jonathan

  • Smartform - Internal table definition

    Hi all,
       I want to define an internal table in the global definition part of smartform,
           so in which tab of global definition i will have to define it. Remember this
           table contains fields from two different structures.
    Thanks
    Sushant Singh

    Hi Sushant,
            Declare a type definition of structure in the TYPES tab with the
            fields from different structures.
            Declare a table of that declared structure..
                 TYPES : BEGIN OF type_table,
                                   matnr TYPE mara-matnr,
                                   werks TYPE marc-werks,
                                   lgort TYPE mard-lgort,
                               END OF type_table.
                 TYPES : t_table TYPE  STANDARD TABLE OF type_table.
            In the Global data Tab, declare the table of the above declared table...
                    I_TABLE   TYPE       T_TABLE .

  • Dynamic internal table definition

    Hi,
    I need to define at runtime an internal table.
    In particular let p_type the parameter to define the type for an internal table
    DATA: itab TYPE STANDARD TABLE
               OF p_type
               WITH HEADER LINE.
    This code doesn't work.
    I have tryed to use a field-symbol but same result.
    Any suggest?

    Hi,
    Check this code.
    DATA  path LIKE ibipparms-path.
    DATA: i_excel LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    data: i_fcat type LVC_T_FCAT,
          wa_fcat type lvc_s_fcat.
    data: fname(10),
          I_PTABLE   TYPE REF TO DATA.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-001.
    PARAMETERS p_path LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b.
    FIELD-SYMBOLS: <fs_final> TYPE ANY,
                   <I_TABLE> type table.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = path.
      p_path = path.
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename    = p_path
          i_begin_col = 1
          i_begin_row = 1
          i_end_col   = 256
          i_end_row   = 65536
        TABLES
          intern      = i_excel.
      loop at i_excel where row = '1'.
        wa_fcat-ROW_POS = i_excel-row.
        wa_fcat-col_pos = i_excel-col.
       concatenate 'COL_' i_excel-col into fname.
        wa_fcat-FIELDNAME = I_EXCEL-VALUE.
        append wa_fcat to i_fcat.
      endloop.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = I_FCAT
        IMPORTING
          EP_TABLE        = I_PTABLE.
      Assign i_ptable->* to <i_table>.
      perform zf_assign.
    End-of-selection.
      LOOP AT I_FCAT INTO WA_FCAT .
        WRITE: WA_FCAT-FIELDNAME(10).
      ENDLOOP.
      LOOP AT <I_TABLE> assigning <fs_final>.
        WRITE:/ <fs_final>.
      ENDLOOP.
    *&      Form  zf_assign
          text
    -->  p1        text
    <--  p2        text
    form zf_assign .
      field-symbols: <ls_table>.
      ASSIGN LOCAL COPY OF INITIAL LINE OF <I_TABLE> TO <LS_TABLE>.
      LOOP AT i_excel WHERE ROW <> 1.
        ASSIGN COMPONENT i_excel-col OF STRUCTURE <LS_TABLE> TO <fs_final>.
        <fs_final> = i_excel-value.
        AT END OF row.
          APPEND <LS_TABLE> TO <i_table>.
        ENDAT.
      ENDLOOP.
      unassign <ls_table>.
    endform.                    " zf_assign
    Regards,
    Amit

  • Internal table definition difference

    Hello!
    I have a doubt about two ways of defining an internal table cos they look alike but i dont really know if the do the same.
    First way to define:
    DATA: BEGIN OF tvbdpr OCCURS 100.
            INCLUDE STRUCTURE vbdpr.
    DATA: END OF tvbdpr.
    Second way to define:
    data: tvbdpr type standard table of vbdpr with header line.
    Are they the same?
    Regards,
    Roberto Okumura.

    HI,
    Technically speaking both are having the same functionality but different technical despription.
    I mean.
    DATA: BEGIN OF tvbdpr OCCURS 100.
    INCLUDE STRUCTURE vbdpr.
    DATA: END OF tvbdpr.
    the system implicitely creates the header line with the help of key word BEGIN OF.
    You need to understand the EXPLICIT Work Aread and IMPLICIT Work Area.
    data: tvbdpr type standard table of vbdpr with header line.
    The system explicitely creates the header line.
    Performance wise better to go for data: tvbdpr type standard table of vbdpr with header line. becuase no need to create work area for doing some other calculations at header line level or work aread level.
    DATA: BEGIN OF tvbdpr OCCURS 100.
    INCLUDE STRUCTURE vbdpr.
    DATA: END OF tvbdpr.
    first it recoginze the table vbdpr then allocate the memory area for your internal table.
    finally, if you want to define the explicit work area better to go for with header line internal table otherwise go without header line .

  • How to get internal table with maximum value of a field in other internal

    Let say I have an table itab consisting of:
    itab-matnr = marm-matnr.
    itab-umren = marm-umren.
    itab-ean11 = marm-ean11.
    there are many "ean11" for one "matnr"
    How could I create itab2 with only "biggest" "ean11". could you give me examlple

    Hi,
    data: mat_no type MATNR.
    Loop at ITAB1.
    IF mat_no = itab1-matnr.
    here check the  ean11 with previos ean11(Store it like matnr), and move the biggest one andf modify that row or move that in ITAB2 with a Modify statment, so that there will no second row with same material No
    ENDIF.
    MAT_NO = ITAB1-Matnr     (Moving Itab1 material no to a Local field)
    ENDLOOP.
    Endloop.

  • Need information on Dynamic internal table

    Hi All,
    I need some information on dynamic internal table.
    I want what are the field names and the values in dynamic internal table.
    Is there any function module, which tells us the field names and values of corresponding fields from a dynamic internal table ?
    Thank you very much in advance.

    Hi,
    Program to display/edit database tables dynamically.
    REPORT  zdyn_table_display.
    PARAMETERS: p_table TYPE tabname OBLIGATORY,
                p_rows  TYPE I.
    * Creation of dynamic internal table
    DATA: lv_dref             TYPE REF TO data.
    FIELD-SYMBOLS: <fs_table> TYPE STANDARD TABLE.
    DATA: lv_table  TYPE  string.
    START-OF-SELECTION.
    * Dynamic internal table.
      CREATE DATA lv_dref       TYPE TABLE OF (p_table).
      ASSIGN lv_dref->* TO <fs_table>.
      IF sy-subrc  EQ 0.
    *    EXIT.
      ENDIF.
    data i type i.
    * Get the data
      SELECT  *
            FROM (p_table)
            UP TO p_rows ROWS
            INTO TABLE <fs_table>.
      CONCATENATE 'Table contents : ' p_table INTO lv_table.
    * display the table control.
      CALL FUNCTION 'STC1_FULLSCREEN_TABLE_CONTROL'
        EXPORTING
          header            = lv_table
          tabname           = p_table
          no_button         = space
        TABLES
          table             = <fs_table>
        EXCEPTIONS
          no_more_tables    = 1
          too_many_fields   = 2
          nametab_not_valid = 3
          handle_not_valid  = 4
          OTHERS            = 5.
      IF sy-subrc  EQ 0.
        EXIT.
      ENDIF.
    Getting internal table definition 
    Try this...
    DATA : l_descr_ref TYPE REF TO cl_abap_structdescr.
    l_descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).
    Now l_descr_ref->components holds the entire list of fields in itab.
    Thanks & Regards,
    ShreeMohan

  • Export Internal table by calling static method

    Hi friends,
    Can u please tell me how to get internal table in export parameter by calling static method.
    OR  can u tell me how to declare internal table in method parameter.
    Thanks in advance

    Raja's method will work for all tables irrespective of the structure and is the best possible approach.  However, if your requirement is simple and you do not have to deal with a lot many tables,
    1. Create a Type-Pool, suppose ztypl
    2. Within the type pool, declare a Structure type,
    TYPES: BEGIN OF ztypl_struct1,
             "Place your fields here
           END OF ztypl_strict1,
           "Create a table of type ztypl_struct1 here
           ztypl_table1 TYPE TABLE OF ztypl_struct1.
    Use "ZTYPL_TABLE1" as the "Associated type" in your method's Parameter definition in SE24.
    eg.
    IT_TABLE      TYPE     ZTYPL_TABLE1
    If you are writing your class in an include,
        METHODS my_method1
          IMPORTING
            it_table1   TYPE ztypl_table1.
    Do remember to include
    TYPE-POOLS: ztypl.
    in your class's Constructor / Include program.
    Please award points if helpful.
    Regards,
    Ryan
    Message was edited by:
            Ryan Cannel

  • Smartform loop into internal table problem

    hello experts,
    i am doing an example given in **************** regarding smartforms. I am getting problem which doing the smartforms . please help me.
    http://****************/Tutorials/Smartforms/SFMain.htm
    in that i am doing the program
    Working with loop.
    I have done exactly as the screen shots in the program.
    Now in the main window i created a loop.
    in that loop i am not getting the option internal table.
    But it is showing as operand . It is in the data tab of the loop.
    I searched the all the tabs in the loop but did not find the option  internal table.
    so then i ticked the operand and i did as speified in the screen shots.
    it_tab into fs_tab
    Then i created a text and then placed &fs_tab-vbeln& etc.
    then i executed the smartform now in the output i am not getting the sales order number , item etc.
    The output is showing like
    &fs_tab-vbeln&     &fs_tab-posnr&   etc.
    please guide me how to get the internal table option in  the loop. And also tell me how to rectify this problem

    thanks for all the replies.
    I will give all  at the time of closing my thread.
    Hi Sravanthi -> in loop node i am not getting the internal table insted of that i am getting operand in the data tab.
    This is my main problem.I dont why operand is comming there.
    my version is 4.7e
    Hi Karthik and swati -> i simply hard coded the statements in the text as shown in the example.
    Now i will try with the add field.
    But please tell me why i am not getting internal table option in loop.

  • Using internal table in BAPI

    hello friends,
    I have a scenario where I have to write a BAPI that accepts an input and exports an internal table with several records.
    I am finding it difficult to define an internal table.
    When I try to define it in the EXPORT tab, it says that 'Occur n' is missing.
    If i try to define it in the SOURCE CODE tab using 'data' command, then i can't export it, since
    it says that the internal table definition is already defined.
    So I would appreciate if some one can let me know how to doit. If you have a sample BAPI that you can share I would appreciate it..
    Thanks
    Ram

    check this sample program
      REPORT z_salesorder_create NO STANDARD PAGE HEADING.
    * Order Type
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
      PARAMETERS: p_auart TYPE auart OBLIGATORY  DEFAULT 'ZOR'.
      SELECTION-SCREEN END OF LINE.
    * Sales organization
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY  DEFAULT '0081'.
      SELECTION-SCREEN END OF LINE.
    * Distribution channel
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY DEFAULT '01'.
      SELECTION-SCREEN END OF LINE.
    * Division.
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
      PARAMETERS: p_spart TYPE spart OBLIGATORY default 'RT'.
      SELECTION-SCREEN END OF LINE.
    * Sold-to
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
      SELECTION-SCREEN END OF LINE.
    * Ship-to
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
      SELECTION-SCREEN END OF LINE.
      SKIP 1.
    * PO Number
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_ebeln.
      PARAMETERS: p_ebeln TYPE vbkd-bstkd  OBLIGATORY.
      SELECTION-SCREEN END OF LINE.
    * Plant
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY DEFAULT '81RT'.
      SELECTION-SCREEN END OF LINE.
    *File selection
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 2(20) v_text10 FOR FIELD p_infile.
      PARAMETERS: p_infile LIKE rlgrap-filename DEFAULT 'C:\TEMP\SALES.XLS'
                        OBLIGATORY.
      SELECTION-SCREEN END OF LINE.
    * Initialization.
    INITIALIZATION.
       v_text  = 'Order type'.
      v_text1  = 'Sales Org'.
      v_text2  = 'Distribution channel'.
      v_text3  = 'Division'.
      v_text4  = 'Sold-to'.
      v_text5  = 'Ship-to'.
      v_text6  = 'PO Number'.
      v_text9  = 'Plant'.
      v_text10 = 'Select File'.
      TYPES: BEGIN OF t_record ,
               matnr LIKE  itb-value,  "Material Number
               menge LIKE  itb-value,  "Quantity
               i_text LIKE itb-value,  "Item text
             END OF t_record.
      DATA : line TYPE i.
      DATA: BEGIN OF it_data OCCURS 100,
             matnr TYPE rv45a-mabnr,
             menge TYPE rv45a-kwmeng,
             i_text TYPE char200,
            END OF it_data.
      DATA : BEGIN OF i_vbap OCCURS 0,
               vbeln LIKE  vbap-vbeln,
               posnr LIKE  vbap-posnr,
               text  LIKE  rstxt-txline,
             END OF i_vbap.
    * BAPI tables
      DATA: v_vbeln            LIKE vbak-vbeln,
            header             LIKE bapisdhead1,
            headerx            LIKE bapisdhead1x,
            item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE,
            itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE,
            partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE,
            return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE,
            lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                               WITH HEADER LINE,
            lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                               WITH HEADER LINE.
    START-OF-SELECTION.
      PERFORM read_excel_file.
    * Header data
    * Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    * Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    * Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    * Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    *po number
      header-purch_no_c = p_ebeln.
      headerx-purch_no_c = 'X'.
    * Partner data
    * Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    * Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    * ITEM DATA
      LOOP AT it_data.
        line = sy-tabix.
        itemx-updateflag = 'I'.
    * Material
        item-material = it_data-matnr.
        itemx-material = 'X'.
    * Plant
        item-plant    = p_plant.
        itemx-plant   = 'X'.
    * Quantity
        item-target_qty = it_data-menge.
        itemx-target_qty = 'X'.
        APPEND item.
        APPEND itemx.
    *   Fill schedule lines
        lt_schedules_in-sched_line = line.
        lt_schedules_in-req_qty    = it_data-menge.
        APPEND lt_schedules_in.
    *   Fill schedule line flags
        lt_schedules_inx-sched_line  = line.
        lt_schedules_inx-updateflag  = 'X'.
        lt_schedules_inx-req_qty     = 'X'.
        APPEND lt_schedules_inx.
      ENDLOOP.
    * Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
        EXPORTING
          sales_header_in     = header
          sales_header_inx    = headerx
        IMPORTING
          salesdocument_ex    = v_vbeln
        TABLES
          return              = return
          sales_items_in      = item
          sales_items_inx     = itemx
          sales_schedules_in  = lt_schedules_in
          sales_schedules_inx = lt_schedules_inx
          sales_partners      = partner.
    * Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        WRITE :/(72) return-message color 6.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
        EXIT.
      ELSE.
    * Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.

  • Difference betwen the internal tables

    Hai friends,
               Pls give me the types  of internal tables and their   differences .and its usage by example.
      regrds,
    Prashanth.

    Internal tables
    Definition
    Data structure that exists only at program runtime.
    An internal table is one of two structured data types in ABAP. It can contain any number of identically structured rows, with or without a header line.
    The header line is similar to a structure and serves as the work area of the internal table. The data type of individual rows can be either elementary or structured.
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects . A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.
    Internal Tables as Data Types
    Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
    Line type
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    Key
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line . The default key of an internal table whose line type is an internal table, the default key is empty.
    The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    Table type
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional 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. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.
    Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    Generic Internal Tables
    Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures. You cannot use them to declare data objects.
    Internal Tables as Dynamic Data Objects
    Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.
    Choosing a Table Type
    The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
    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  .
    The effect of the OCCURS addition is to construct a standard table with the data type
    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  TYPE|LIKE TABLE OF  TYPE|LIKE TABLE OF 
                           WITH   TYPE|LIKE TABLE OF  TYPE|LIKE TABLE OF  TYPE|LIKE TABLE OF 
                           WITH   .
    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 ([]). 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.
    Declaring New Internal Tables
    You can use the DATA statement to construct new internal tables as well as using the LIKE or TYPE addition to refer to existing types or objects. The table type that you construct does not exist in its own right; instead, it is only an attribute of the table object. You can refer to it using the LIKE addition, but not using TYPE. The syntax for constructing a table object in the DATA statement is similar to that for defining a table type in the TYPES statement.
    DATA ]
    As when you define a table type, the type constructor
    of an internal table as follows:
    UNIQUE KEY  belong to the key as long as they are not internal tables or references, and do not contain internal tables or references. Key fields can be nested structures. The substructures are expanded component by component when you access the table using the key. The system follows the sequence of the key fields.
    UNIQUE KEY TABLE LINE
    If a table has an elementary line type (C, D, F, I, N, P, T, X), you can define the entire line as the key. If you try this for a table whose line type is itself a table, a syntax error occurs. If a table has a structured line type, it is possible to specify the entire line as the key. However, you should remember that this is often not suitable.
    UNIQUE DEFAULT KEY
    This declares the fields of the default key as the key fields. If the table has a structured line type, the default key contains all non-numeric columns of the internal table that are not and do not contain references or internal tables. If the table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
    Specifying a key is optional. If you do not specify a key, the system defines a table type with an arbitrary key. You can only use this to define the types of field symbols and the interface parameters of procedures. For exceptions, refer to Special Features of Standard Tables.
    The optional additions UNIQUE or NON-UNIQUE determine whether the key is to be unique or non-unique, that is, whether the table can accept duplicate entries. If you do not specify UNIQUE or NON-UNIQUE for the key, the table type is generic in this respect. As such, it can only be used for specifying types. When you specify the table type simultaneously, you must note the following restrictions:
    ·     You cannot use the UNIQUE addition for standard tables. The system always generates the NON-UNIQUE addition automatically.
    ·     You must always specify the UNIQUE option when you create a hashed table.
    Initial Memory Requirement
    You can specify the initial amount of main memory assigned to an internal table object when you define the data type using the following addition:
    INITIAL SIZE , the system calculates a new value so that n times the line width is around 12KB.
    Examples
    TYPES: BEGIN OF LINE,
      COLUMN1 TYPE I,
      COLUMN2 TYPE I,
      COLUMN3 TYPE I,
    END OF LINE.
    1. TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.
    The program defines a table type ITAB. It is a sorted table, with line type of the structure LINE and a unique key of the component COLUMN1.
    2. 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.
    TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.
    TYPES: BEGIN OF DEEPLINE,
    FIELD TYPE C,
    TABLE1 TYPE VECTOR,
    TABLE2 TYPE ITAB,
    END OF DEEPLINE.
    TYPES DEEPTABLE TYPE STANDARD TABLE OF DEEPLINE
    WITH DEFAULT KEY.
    The program defines a table type VECTOR with type hashed table, the elementary line type I and a unique key of the entire table line. The second table type is the same as in the previous example. The structure DEEPLINE contains the internal table as a component. The table type DEEPTABLE has the line type DEEPLINE. Therefore, the elements of this internal table are themselves internal tables. The key is the default key - in this case the column FIELD. The key is non-unique, since the table is a standard table.
    Specifying the Type of Formal Parameters
    Formal parameters can have any valid ABAP data type. You can specify the type of a formal parameter, either generically or fully, using the TYPE or LIKE addition. If you specify a generic type, the type of the formal parameter is either partially specified or not specified at all. Any attributes that are not specified are inherited from the corresponding actual parameter when the subroutine is called. If you specify the type fully, all of the technical attributes of the formal parameter are defined with the subroutine definition.
    The following remarks about specifying the types of parameters also apply to the parameters of other procedures (function modules and methods).
    If you have specified the type of the formal parameters, the system checks that the corresponding actual parameters are compatible when the subroutine is called. For internal subroutines, the system checks this in the syntax check. For external subroutines, the check cannot occur until runtime.
    By specifying the type, you ensure that a subroutine always works with the correct data type. Generic formal parameters allow a large degree of freedom when you call subroutines, since you can pass data of any type. This restricts accordingly the options for processing data in the subroutine, since the operations must be valid for all data types. For example, assigning one data object to another may not even be possible for all data types. If you specify the types of subroutine parameters, you can perform a much wider range of operations, since only the data appropriate to those operations can be passed in the call. If you want to process structured data objects component by component in a subroutine, you must specify the type of the parameter.
    Specifying Generic Types
    The following types allow you more freedom when using actual parameters. The actual parameter need only have the selection of attributes possessed by the formal parameter. The formal parameter adopts its remaining unnamed attributes from the actual parameter.
         Check for actual parameters
    No type specificationTYPE ANY     The subroutine accepts actual parameters of any type. The formal parameter inherits all of the technical attributes of the actual parameter.
    TYPE C, N, P, or X     The subroutine only accepts actual parameters with the type C, N, P, or X. The formal parameter inherits the field length and DECIMALS specification (for type P) from the actual parameter.
    TYPE TABLE     The system checks whether the actual parameter is a standard internal table. This is a shortened form of TYPE STANDARD TABLE (see below).
    TYPE ANY TABLE     The system checks whether the actual parameter is an internal table. The formal parameter inherits all of the attributes (line type, table type, key) from the actual parameter.
    TYPE INDEX TABLE     The system checks whether the actual parameter is an index table (standard or sorted table). The formal parameter inherits all of the attributes (line type, table type, key) from the actual parameter.
    TYPE STANDARD TABLE     The system checks whether the actual parameter is a standard internal table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.
    TYPE SORTED TABLE     The system checks whether the actual parameter is a sorted table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.
    TYPE HASHED TABLE     The system checks whether the actual parameter is a hashed table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.
    Note that formal parameters inherit the attributes of their corresponding actual parameters dynamically at runtime, and so they cannot be identified in the program code. For example, you cannot address an inherited table key statically in a subroutine, but you probably can dynamically.
    TYPES: BEGIN OF LINE,
            COL1,
            COL2,
          END OF LINE.
    DATA: WA TYPE LINE,
          ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1,
          KEY(4) VALUE 'COL1'.
    WA-COL1 = 'X'. INSERT WA INTO TABLE ITAB.
    WA-COL1 = 'Y'. INSERT WA INTO TABLE ITAB.
    PERFORM DEMO USING ITAB.
    FORM DEMO USING P TYPE ANY TABLE.
      READ TABLE P WITH TABLE KEY (KEY) = 'X' INTO WA.
    ENDFORM.
    The table key is addressed dynamically in the subroutine. However, the static address
    READ TABLE P WITH TABLE KEY COL1 = 'X' INTO WA.
    is syntactically incorrect, since the formal parameter P does not adopt the key of table ITAB until runtime.
    Assigning Internal Tables :
    Like other data objects, you can use internal tables as operands in a MOVE statement
    MOVE , including the data in any nested internal tables. The original contents of the target table are overwritten.
    If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in an assignment, you must place two brackets () after the table name.
    DATA: BEGIN OF line,
            col1(1) TYPE c,
            col2(1) TYPE c,
          END OF line.
    DATA: etab LIKE TABLE OF line WITH HEADER LINE,
          ftab LIKE TABLE OF line.
    line-col1 = 'A'. line-col2 = 'B'.
    APPEND line TO etab.
    MOVE etab[] TO ftab.
    LOOP AT ftab INTO line.
      WRITE: / line-col1, line-col2.
    ENDLOOP.
    The output is:
    A B
    The example creates two standard tables ETAB and FTAB with the line type of the structure LINE. ETAB has a header line. After filling ETAB line by line using the APPEND statement, its entire contents are assigned to FTAB. Note the brackets in the statement.
    DATA: ftab TYPE SORTED TABLE OF f
               WITH NON-UNIQUE KEY table_line,
          itab TYPE HASHED TABLE OF i
               WITH UNIQUE KEY table_line,
          fl   TYPE f.
    DO 3 TIMES.
      INSERT sy-index INTO TABLE itab.
    ENDDO.
    ftab = itab.
    LOOP AT ftab INTO fl.
      WRITE: / fl.
    ENDLOOP.
    The output is:
    1.000000000000000E+00
    2.000000000000000E+00
    3.000000000000000E+00
    FTAB is a sorted table with line type F and a non-unique key. ITAB is a hashed table with line type I and a unique key. The line types, and therefore the entire tables, are convertible. It is therefore possible to assign the contents of ITAB to FTAB. When you assign the unsorted table ITAB to the sorted table FTAB, the contents are automatically sorted by the key of FTAB.
    In Unicode systems, the following conversion is not allowed:
    DATA: BEGIN OF iline,
            num TYPE i,
          END OF iline,
          BEGIN OF fline,
            num TYPE f,
          END OF fline,
          itab LIKE TABLE OF iline,
          ftab LIKE TABLE OF fline.
    DO 3 TIMES.
      iline-num = sy-index.
      APPEND iline-num TO itab.
    ENDDO.
    ftab = itab.
    loop AT ftab INTO fline.
      WRITE: / fline-num.
    ENDLOOP.
    In a non-Unicode system, the output may look something like this:
            6.03823403895813E-154
            6.03969074613219E-154
            6.04114745330626E-154
    Here, the line types of the internal tables ITAB and FTAB are structures each with one component of type I or F. The line types are convertible, but not compatible. Therefore, when assigning ITAB to FTAB, the contents of Table ITAB are converted to type C fields and then written to FTAB. The system interprets the transferred data as type F fields, so that the results are meaningless. In Unicode systems, you are not allowed to convert numeric fields to fields of type C.
    Initializing Internal Tables
    Like all data objects, you can initialize internal tables with the
    CLEAR .
    statement. This statement restores an internal table to the state it was in immediately after you declared it. This means that the table contains no lines. However, the memory already occupied by the memory up until you cleared it remains allocated to the table.
    If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets () after the table name.
    CLEAR , LT, <).
    If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets () after the table name.
    The first criterion for comparing internal tables is the number of lines they contain. The more lines an internal table contains, the larger it is. If two internal tables contain the same number of lines, they are compared line by line, component by component. If components of the table lines are themselves internal tables, they are compared recursively. If you are testing internal tables for anything other than equality, the comparison stops when it reaches the first pair of components that are unequal, and returns the corresponding result.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA: ITAB LIKE TABLE OF LINE,
                 JTAB LIKE TABLE OF LINE.
    DO 3 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
      APPEND LINE TO ITAB.
    ENDDO.
    MOVE ITAB TO JTAB.
    LINE-COL1 = 10. LINE-COL2 = 20.
    APPEND LINE TO ITAB.
    IF ITAB GT JTAB.
    WRITE / 'ITAB GT JTAB'.
    ENDIF.
    APPEND LINE TO JTAB.
    IF ITAB EQ JTAB.
    WRITE / 'ITAB EQ JTAB'.
    ENDIF.
    LINE-COL1 = 30. LINE-COL2 = 80.
    APPEND LINE TO ITAB.
    IF JTAB LE ITAB.
    WRITE / 'JTAB LE ITAB'.
    ENDIF.
    LINE-COL1 = 50. LINE-COL2 = 60.
    APPEND LINE TO JTAB.
    IF ITAB NE JTAB.
    WRITE / 'ITAB NE JTAB'.
    ENDIF.
    IF ITAB LT JTAB.
    WRITE / 'ITAB LT JTAB'.
    ENDIF.
    The output is:
    ITAB GT JTAB
    ITAB EQ JTAB
    JTAB LE ITAB
    ITAB NE JTAB
    ITAB LT JTAB
    This example creates two standard tables, ITAB and JTAB. ITAB is filled with 3 lines and copied to JTAB. Then, another line is appended to ITAB and the first logical expression tests whether ITAB is greater than JTAB. After appending the same line to JTAB, the second logical expression tests whether both tables are equal. Then, another line is appended to ITAB and the third logical expressions tests whether JTAB is less than or equal to ITAB. Next, another line is appended to JTAB. Its contents are unequal to the contents of the last line of ITAB. The next logical expressions test whether ITAB is not equal to JTAB. The first table field whose contents are different in ITAB and JTAB is COL1 in the last line of the table: 30 in ITAB and 50 in JTAB. Therefore, in the last logical expression, ITAB is less than JTAB.
    Sorting Internal Tables
    You can sort a standard or hashed table in a program. To sort a table by its key, use the statement
    SORT  ASCENDING .
    The statement sorts the internal table  ASCENDING
                 BY  ASCENDING
                     ASCENDING .
    The table is now sorted by the specified components : ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table.
    DATA: BEGIN OF LINE,
             COL1 TYPE I,
             COL2 TYPE I,
          END OF LINE.
    DATA ITAB LIKE HASHED TABLE OF LINE WITH UNIQUE KEY COL1
                                        INITIAL SIZE 10.
    DATA: LIN TYPE I,
          INI TYPE I,
          KND TYPE C.
    DESCRIBE TABLE ITAB LINES LIN OCCURS INI KIND KND.
    WRITE: / LIN, INI, KND.
    DO 1000 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    DESCRIBE TABLE ITAB LINES LIN OCCURS INI KIND KND.
    WRITE: / LIN, INI, KND.
    The output is:
             0         10  H
         1,000         10  H
    Here, a hashed table ITAB is created and filled. The DESCRIBE TABLE statement is processed before and after the table is filled. The current number of lines changes, but the number of initial lines cannot change.
    INSERT LINE INTO TABLE ITAB.
    LINE-TEXT = 'Moller'.
    CONVERT TEXT LINE-TEXT INTO SORTABLE CODE LINE-XTEXT.
    INSERT LINE INTO TABLE ITAB.
    LINE-TEXT = 'Miller'.
    CONVERT TEXT LINE-TEXT INTO SORTABLE CODE LINE-XTEXT.
    INSERT LINE INTO TABLE ITAB.
    SORT ITAB.
    PERFORM LOOP_AT_ITAB.
    SORT ITAB BY XTEXT.
    PERFORM LOOP_AT_ITAB.
    SORT ITAB AS TEXT.
    PERFORM LOOP_AT_ITAB.
    FORM LOOP_AT_ITAB.
      LOOP AT ITAB INTO LINE.
        WRITE / LINE-TEXT.
      ENDLOOP.
      SKIP.
    ENDFORM.
    This example demonstrates alphabetical sorting of character fields. The internal table ITAB contains a column with character fields and a column with corresponding binary codes that are alphabetically sortable. The binary codes are created with the CONVERT statement (see Converting to a Sortable Format). The table is sorted three times. First, it is sorted binarily by the TEXT field. Second, it is sorted binarily by the XTEXT field. Third, it is sorted alphabetically by the TEXT field. Since there is no directly corresponding case in English, we have taken the results from a German text environment:
    Miller
    Moller
    Muller
    Möller
    Miller
    Moller
    Möller
    Muller
    Miller
    Moller
    Möller
    Muller
    After the first sorting, 'Möller' follows behind 'Muller' since the internal code for the letter 'ö' comes after the code for 'u'. The other two sorts are alphabetical
    The binary sort by XTEXT has the same result as the alphabetical sorting by the field TEXT.
    Regards,
    Amit
    Reward all helpful replies.

  • How we can store internal table in cookies

    Hello All,
    I want to store all the content of the internal table in the server side cookie. and use it after wards.
    I have studied the thread http://help.sap.com/saphelp_nw70/helpdata/en/ed/bb153aab4a0c0ee10000000a114084/frameset.htm
    but i am still facing problems in it.
    Please Help..
    Thanks In advance
    Abhinav

    Hi Abhinav,
      Use server side cookies for to store and retrieve the internal table datas…
    For example...
      Set the server side cookies for
      session handling in browser side
    *-->Set the cookie for internal table data output.
      CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>SET_SERVER_COOKIE
        EXPORTING
          NAME                  = 'name'
          APPLICATION_NAME      = RUNTIME->APPLICATION_NAME
          APPLICATION_NAMESPACE = RUNTIME->APPLICATION_NAMESPACE
          USERNAME              = USR
          SESSION_ID            = 'RES_SESSION'
          DATA_VALUE            = I_OUTPUT
          DATA_NAME             = 'i_output'
          EXPIRY_TIME_ABS       = SY-UZEIT
          EXPIRY_DATE_ABS       = EDATE.
    Use below example get the datas after wards
        Get internal table datas from server side cooike.
    CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
      EXPORTING
        name                  = 'name'
        application_name      = runtime->application_name
        application_namespace = runtime->application_namespace
        username              = sy-uname
        session_id            = 'RES_SESSION'
        data_name             = 'i_output'
      CHANGING
        data_value            = i_output.
    Finally, delete the cookies using below example..
        Deletes Internal table datas cookie.
      CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>DELETE_SERVER_COOKIE
      EXPORTING
      NAME                  = 'name'
      APPLICATION_NAME      = RUNTIME->APPLICATION_NAME
      APPLICATION_NAMESPACE = RUNTIME->APPLICATION_NAMESPACE
      USERNAME              = SY-UNAME
      SESSION_ID            = 'RES_SESSION'.
    Here, i_output is a internal table.
    In parameter like below...
    i_output     TYPE     IT_OUTPUT
    Thnx
    Suriya

  • How many times will internal table get filled?

    Dear BW / ABAP gurus:
    I am observing a routine in a transformation in 7.0 data flow.
    The internal table is created as follows in the global declaration in the Start Routine:
    TYPES:  BEGIN OF ST_PROD,
              /BIC/AZPROD TYPE /BIC/OIAZPROD,
              /BIC/AZCOST TYPE /BIC/OIAZCOST,
            END OF ST_PROD.
    DATA: IT_PROD TYPE TABLE OF ST_PROD,
          WA_PROD TYPE ST_PROD.
    The programmer is fetching data for product cost which is not available in the source. This code is written in the Start Routine:
    SELECT /BIC/AZPROD /BIC/AZCOST
      FROM /BIC/PAZPROD
      INTO CORRESPONDING FIELDS OF TABLE IT_PROD
      WHERE OBJVERS = 'A'.
    My questions:
    (1) Is it a standard practice to create the internal table in the global declaration?
    (2) Is it a standard practice to fill the internal table with data in the Start Routine? Is it possible to fill the internal table with data in the global declaration? Or is the global declaration only reserved for declaring variables and creating internal tables?
    (3) What is the use of 2nd part global?
    (4) Let's say there are 100, 000 records at the source and the DTP package size is 50,000. Then the Start Routine will get executed 2 times. So the code in the Start Routine will hit the database 2 times to fill the internal table. Is this correct?
    Note to mods: Please do not delete the thread. Move to the beginner section if you think this is basic. But please do not delete. It take a long time to type out the questions.

    hi Saurav,
    (1) Is it a standard practice to create the internal table in the global declaration?
    1. No ,internal table should be created in global part only if they are getting used in field level or end routine .Else they must be in local part and should get refreshed at the end  so that performance not get affected.
    (2) Is it a standard practice to fill the internal table with data in the Start Routine? Is it possible to fill the internal table with data in the global declaration? Or is the global declaration only reserved for declaring variables and creating internal tables?
    1.No if only you want to use the data in field level routine and start routine ,you will fill table in start routine otherwise no .
    2.first global part is for data declaration so no in first global part select cannot come .
    3.Second global part can have select but you cannot write any statement using source package or result package here as they are private object of transformation class and not recognized at this area.However simple select on any table other than these will be fine .
    (3) What is the use of 2nd part global?
    1.In second global part you can declare internal table ,structures that are not of type source package or result package but independent and can use them .
    2.If you will declare these table in first global part they will be private object and you cannot write select using them in second global part .
    3.Second global part is also declaration but outside the class so these objects are global across transformation with more flexibility .
    4.If you will declare any data here using the structure of source /result package you will get error .This is a data declaration part comes between transformation definition and implementation part .
    (4) Let's say there are 100, 000 records at the source and the DTP package size is 50,000. Then the Start Routine will get executed 2 times. So the code in the Start Routine will hit the database 2 times to fill the internal table. Is this correct?
    yes the source and result package are actually the DTP packages only so code will get executed same no of time as you have number of packages in DTP extraction .
    Hope this will be helpful .
    Regards,
    Jaya Tiwari

  • Getting unique values from internal table

    Hi Gurus,
    From time to time I hit this problem and so far I havn't found any nice solution. I've an internal table with several fields. I would like to get all unique values for one (or several) of these fields. However let say that this table has a lot of entries so making a copy is not an option. Also changing this table in any way is forbiden.
    For example for table below I would like to get all unique values for field Number. In this case it would be 1,2,3,4.
    Name  | Number |
    name1 | 1|
    name2 | 2|
    name3 | 2|
    name4 | 3|
    name5 | 4|
    name5 | 3|
    Can anyone propose me better solution than going in the loop through all entries in table? Maybe there is some ABAP functionality that I don't know about?
    BR
    Marcin Cholewczuk

    Let's say that if I sort this table I won't be able to restore it to previous order which is important for me
    True...If you sort the table you won't be able to restore. So the only option is to copy/move all the records into another table.
    Sorting If you need to retrive unique values. I don't think without sorting the table would be a nice idea and proper programming to proceed ahead.
    Regarding logic, as replied earlier
    Either we can go with DELETE ADJACENT DUPLICATES or proceed as replied in my earlier post. There might be number of algorithms to resolve this. But we cannot go ahead without sorting or looping.

  • How to get all values in the range of select option into internal table?

    Hi,
    I need to capture all entries coming in the range of select option into one internal table.
    How to do get that?
    For E.g
    select-options: matnr for mara-matnr.(select option)
    IF I enter G0100013507892 as lower value of matnr and G0100014873947 as higher value
    and if there are 10,000 materials in the above range, then I want to capture all theses 10000 materails in one internal table. How to do that?
    Regards,
    Mrunal

    Hello Mrunal Mhaskar  ,
    What i understand you can do one thing  go in debug mode
    Try this code : -
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-low IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-low.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-high IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-high.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    In the i_matnr table high and low values are there.
    Regards,
    Vandana.

Maybe you are looking for

  • Renaming Column Names in a single shot in Requests

    Hi All, We are having one issue while trying to rename the column in the requests. Requirement: We are having two presentation table "Fact Summary" and "Countries Dimension". Both of these tables contain one column "Country Description". Presently in

  • CRASH with WIndows XP - arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrgggh

    My Windows crashes and all I do can't stop it. Any thoughts? # An unexpected error has been detected by HotSpot Virtual Machine: # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02609558, pid=3472, tid=2924 # Java VM: Java HotSpot(TM) Client VM (1.5

  • Can't get timeout to work as expected for USB VISA

    Hi, I'm using VISA in LabVIEW (7.1) to talk to a custom USB device. My program transmits a request and waits for the response (See attached block diagram). The response may take a long time and my program then sits in the Read vi and becomes unrespon

  • Which to buy?  Time capsule or Airport Extreme with USB drive(s)?

    I'm getting either a TC or an Airport Extreme with an external drive. Archive: I noticed that TC can archive to an external drive. It seems this can be handy for creating off-site backups. Can I do this with a drive on Airport Extreme (with a powered

  • Regarding function module error

    hi experts,              i m using hr_infotype_operation....the syntax is like this.. loop at info_table. CALL FUNCTION 'HR_INFOTYPE_OPERATION'   EXPORTING     INFTY                  = '0015'     NUMBER                 = info_table-pernr    SUBTYPE