[internal tables] TYPES or DATA

Hi,
starting with ABAP and try to understand internal tables. The structure
of an internal table isn't quiet clear. They have a work area and a table body,
but why do I need a additionally type of line?
Is this content, my tutorial uses DATA to define the itab and TYPES to define
the workarea (type of line). I don't really understand the different between those
commands.
Does anyone got a good web blog to understand internal tables completly?
thx
chris

Hi,
The Statements TYPES and DATA
Each ABAP program define its own data types using the statement.
TYPES dtype TYPE type ...
and declare its own variables or instance attributes of classes using the statement
DATA var {TYPE type} ...
Within the program or a class, you can also define local data types and variables within procedures. Local variables in procedures obscure identically-named variables in the main program or class.
When creating data types and data objects, there are a number of naming convention that also apply for other local program definitions, such as procedures. These are described in detail in the keyword documentation.
The Additions TYPE and LIKE
The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
·        Definition of local types in a program
·        Declaration of data objects
·        Dynamic creation of data objects
·        Specification of the type of formal parameters in subroutines
·        Specification of the type of formal parameters in methods
·        Specification of the type of field symbols
Constructing New Data Types
The TYPE addition allows you to construct new data types in the TYPES, DATA; CONSTANTS; and STATICSstatements. In the TYPES statement, these are local data types in the program. In the other statements, they are attributes of new data objects, meaning that the newly defined data types are not free-standing. Rather, they are linked to database objects.This means that you can refer to them using the LIKEaddition, but not using TYPE.
To construct new data types, the addition TYPE can be used with the following type constructors:
·        Construction of reference types
REF TO type|dobj
·        Construction of structured data types
BEGIN OF struc_type.
END OF struc_type.
·        Construction of table types
tabkind OF linetype
These data types only exist during the runtime of the ABAP program.
Referring to Known Data Types or Data Objects
Using the additions TYPE or LIKE in the TYPESstatement, local data types in a program can be referred to known data types or data objects. This is mainly the case with user-defined elementary data types. If you declare variables using the additions TYPE type or LIKE dobj with statement DATA, the data type of var is already fully defined before the declaration is made.
The known types or data that are referred to must be visible at the point where the data type or variable is declared.
A known data type can be any of the following:
·        A predefined ABAP type to which you refer using the TYPE addition
·        An existing local data type in the program to which you refer using the TYPE addition
·        The data type of a local data object in the program to which you refer using the LIKE addition
·        A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.
The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context.  The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.
·        In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.
·        You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:
DATA dref TYPE REF TO cl_global.
DATA:  f1 LIKE cl_global=>attr,
       f2 LIKE dref->attr.
You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.
TYPES: BEGIN OF struct,
         number_1 TYPE i,
         number_2 TYPE p DECIMALS 2,
       END OF struct.
DATA:  wa_struct TYPE struct,
       number    LIKE wa_struct-number_2,
       date      LIKE sy-datum,
       time      TYPE t,
       text      TYPE string,
       company   TYPE s_carr_id.
This example declares variables with reference to the internal type STRUCT in the program, a component of an existing data object wa_struct, the predefined data object SY-DATUM, the predefined ABAP type t and STRING, and the data element S_CARR_ID from the ABAP Dictionary.
Referring to Generic Data Types
If you refer to one of the generic predefined ABAP types of fixed length (c, n, p, x) in the TYPES or DATA statement, you must specify the undefined technical attributes.
TYPES|DATA var[(length)] TYPE type ...
TYPES|DATA var TYPE type ...
DATA: text1,
      text2 LENGTH 2,
      text3 TYPE c LENGTH 3,
      pack TYPE p DECIMALS 2 VALUE '1.225'.
This example creates three character variables with field lengths of one, two, and three bytes respectively, and a packed number variable with field length 8 bytes and two decimal places. If the attribute Fixed point arithmetic is set, the value of pack is 1.23.
This example shows how to declare elementary data objects with reference to predefined ABAP types.
PROGRAM demo_elementary_data_objects.
DATA text1  TYPE c LENGTH 20.
DATA text2  TYPE string.
DATA number TYPE i.
text1 = 'The number'.
number = 100.
text2 = 'is an integer.'.
WRITE: text1, number, text2.
This program produces the following output on the screen:
The number              100 is an integer.
In this example, the data objects text1, text2 and number are declared with the DATA statement. The technical attributes are determined by referring to the predefined ABAP types c, string, and I. Values from unnamed literals are assigned to the data objects. The contents of the named data objects are displayed on the list.
Specifying a Start Value
When you declare an elementary fixed-length variable, the DATAstatement automatically fills it with the type-specific initial value as listed in the table in the Predefined ABAP Types section.
However, you can also specify a starting value of a fixed-length elementary variable (also within a structure declaration) using the VALUE addition in the DATAstatement:
DATA var ... VALUE val|{IS INITIAL}.
Specifying start values:
DATA: counter TYPE p VALUE 1,
      date    TYPE d VALUE '19980601',
      flag    TYPE n VALUE IS INITIAL.
After this data declaration, the character string flag contains its type specific
Initial value ‘0’.
Regarsd

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

  • Displaying an internal table with raw data in an ALV

    Hi Experts,
    Can you please help me out I'm retrieving an ABAP Report List which i submitted to memory, I'm using the function module LIST_FROM_MEMORY to retrieve the list from memory and storing it in an internal table. The problem is i'm struggling to display the List using an ALV coz the internal table contains raw data. Your help wil be much appreciated.

    My ASCII internal table is empty. Below I have included a code sample of what I want to do.
    Type-pools slis.
    DATA: MTAB_REPORT_LIST LIKE ABAPLIST OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF MTAB_REPORT_ASCII OCCURS 0,
            LINE(255) TYPE C,
          END OF MTAB_REPORT_ASCII.
    START-OF-SELECTION.
    *-- Submit a report.  This one is the chart of accounts
      SUBMIT ZPRINTREPORT
        EXPORTING LIST TO MEMORY           " Save list in memory
        AND RETURN.    " Return control to this program
    END-OF-SELECTION.
    *-- Get the list from memory
      CALL FUNCTION 'LIST_FROM_MEMORY'
           TABLES
                LISTOBJECT = MTAB_REPORT_LIST
           EXCEPTIONS
                NOT_FOUND  = 1
                OTHERS     = 2.
    if sy-subrc <> 0.
      write / 'unable 2 retrieve list from memory'.
    else.
    "REFRESH MTAB_REPORT_ASCII.
    CALL FUNCTION 'LIST_TO_ASCI'
    TABLES
    listasci = MTAB_REPORT_ASCII " list converted to ASCII
    listobject = MTAB_REPORT_LIST
    EXCEPTIONS
    empty_list = 1
    list_index_invalid = 2
    OTHERS = 3.
    if sy-subrc = 1.
       write 'list ASCII list empty'.
    else.
    WRITE: MTAB_REPORT_ASCII, ' ff'.
    " perform build_alv tables MTAB_REPORT_LIST.
    endif.
    endif.
    "CALL FUNCTION 'WRITE_LIST'
    "      TABLES
    "           LISTOBJECT = MTAB_REPORT_LIST
    "      EXCEPTIONS
    "           EMPTY_LIST = 1
    "           OTHERS     = 2.
    FORM build_alv tables MTAB_REPORT_ASCII.
    ALV required data objects.
    "DATA: w_title   TYPE lvc_title,
    "        w_comm    TYPE slis_formname,
    "        w_status  TYPE slis_formname,
    "        x_layout  TYPE slis_layout_alv,
    "        t_event    TYPE slis_t_event,
    "        t_fieldcat TYPE slis_t_fieldcat_alv,
    "        t_sort     TYPE slis_t_sortinfo_alv.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    Layout
      x_layout-zebra = 'X'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = sy-repid
                I_INTERNAL_TABNAME     = 'MTAB_REPORT_ASCII' 
                I_INCLNAME             = sy-repid
           CHANGING
                CT_FIELDCAT            = int_fcat
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = sy-repid
                IT_FIELDCAT        = int_fcat
                I_SAVE             = 'A'
           TABLES
                T_OUTTAB           = MTAB_REPORT_ASCII
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.

  • Senarious for using different internal table types

    please give scenarios for  using different internal table types?

    Refer to the following.
    Internal table types
    This section describes how to define internal tables locally in a program. You can also define internal tables globally as data types in the ABAP Dictionary.
    Like all local data types in programs , you define internal tables using the TYPES statement. If you do not refer to an existing table type using the TYPE or LIKE addition, you can use the TYPES statement to construct a new local internal table in your program.
    TYPES <t> TYPE|LIKE <tabkind> OF <linetype> [WITH <key>]
    [INITIAL SIZE <n>].
    After TYPE or LIKE, there is no reference to an existing data type. Instead, the type constructor occurs:
    <tabkind> OF <linetype> [WITH <key>]
    The type constructor defines the table type <tabkind>, the line type <linetype>, and the key <key> of the internal table <t>.
    You can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZE addition.
    Table type
    You can specify the table type <tabkind> as follows:
    Generic table types
    INDEX TABLE
    For creating a generic table type with index access.
    ANY TABLE
    For creating a fully-generic table type.
    Data types defined using generic types can currently only be used for field symbols and for interface parameters in procedures . The generic type INDEX TABLE includes standard tables and sorted tables. These are the two table types for which index access is allowed. You cannot pass hashed tables to field symbols or interface parameters defined in this way. The generic type ANY TABLE can represent any table. You can pass tables of all three types to field symbols and interface parameters defined in this way. However, these field symbols and parameters will then only allow operations that are possible for all tables, that is, index operations are not allowed.
    Fully-Specified Table Types
    STANDARD TABLE or TABLE
    For creating standard tables.
    SORTED TABLE
    For creating sorted tables.
    HASHED TABLE
    For creating hashed tables.
    Fully-specified table types determine how the system will access the entries in the table in key operations. It uses a linear search for standard tables, a binary search for sorted tables, and a search using a hash algorithm for hashed tables.
    Line type
    For the line type <linetype>, you can specify:
    Any data type if you are using the TYPE addition. This can be a predefined ABAP type, a local type in the program, or a data type from the ABAP Dictionary. If you specify any of the generic elementary types C, N, P, or X, any attributes that you fail to specify (field length, number of decimal places) are automatically filled with the default values. You cannot specify any other generic types.
    Any data object recognized within the program at that point if you are using the LIKE addition. The line type adopts the fully-specified data type of the data object to which you refer. Except for within classes, you can still use the LIKE addition to refer to database tables and structures in the ABAP Dictionary (for compatibility reasons).
    All of the lines in the internal table have the fully-specified technical attributes of the specified data type.
    Key
    You can specify the key <key> of an internal table as follows:
    [UNIQUE|NON-UNIQUE] KEY <col1> ... <col n>
    In tables with a structured line type, all of the components <coli> 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|NON-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|NON-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 <n>
    This size does not belong to the data type of the internal table, and does not affect the type check. You can use the above addition to reserve memory space for <n> table lines when you declare the table object.
    When this initial area is full, the system makes twice as much extra space available up to a limit of 8KB. Further memory areas of 12KB each are then allocated.
    You can usually leave it to the system to work out the initial memory requirement. The first time you fill the table, little memory is used. The space occupied, depending on the line width, is 16 <= <n> <= 100.
    It only makes sense to specify a concrete value of <n> if you can specify a precise number of table entries when you create the table and need to allocate exactly that amount of memory (exception: Appending table lines to ranked lists). This can be particularly important for deep-structured internal tables where the inner table only has a few entries (less than 5, for example).
    To avoid excessive requests for memory, large values of <n> are treated as follows: The largest possible value of <n> is 8KB divided by the length of the line. If you specify a larger value of <n>, 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.
    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.
    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.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm

  • Getting dynamically the internal table type

    Hello all,
    is there a standard function to get the internal table type name.like if a internal table is based on sflight,by using the function i pass the internal table and get the type sflight.
    regards
    kaushik

    for this we have the CL_ABAP_TYPEDESCR class, subclasses and all of their methods.
    Coding should look something like this:
    DATA: dref TYPE REF TO data.
    FIELD-SYMBOLS: <table> TYPE STANDARD TABLE,
                   <line>  TYPE ANY.
    DATA: lr_reference TYPE REF TO cl_abap_typedescr.
    DATA: lr_tab       TYPE REF TO cl_abap_tabledescr.
    DATA: lr_data      TYPE REF TO cl_abap_datadescr.
    PARAMETERS: pa_tab TYPE tabname DEFAULT 'BUT000'.
    CREATE DATA dref TYPE STANDARD TABLE OF (pa_tab).
    ASSIGN dref->* TO <table>.
    SELECT * FROM but000 INTO TABLE <table>
             UP TO 10 ROWS.
    CALL METHOD cl_abap_typedescr=>describe_by_data
      EXPORTING
        p_data      = <table>
      RECEIVING
        p_descr_ref = lr_reference.
    lr_tab ?= lr_reference.
    lr_data = lr_tab->get_table_line_type( ).
    WRITE lr_data->absolute_name.
    Edited by: Micky Oestreich on Jan 19, 2009 8:09 AM
    Edited by: Micky Oestreich on Jan 19, 2009 8:44 AM

  • How to fill internal table with no data in debugging mode

    Hi all,
             I modified one existing program.Now I want to test it.I am not given test data.So in the middle of my debugging, I found that one internal table with no data.My problem is how to fill that internal table with few records in that debugging mode just as we change contents in debugging mode.If I want to proceed further means that internal table must have some records.
    Please I dont know how to create test data so I am trying to create values temporarily in debugging mode only.
    Thanks,
    Balaji

    Hi,
    In the debugging do the following..
    Click the Table button..
    Double click on the internal table name..
    Then in the bottom of the screen you will get the buttons like CHANGE, INSERT, APPEND, DELETE..
    Use the APPEND button to insert records to the internal table..
    Thanks,
    Naren

  • Dynamic Internal Table for reading data from external file

    Hello All,
    The task was to create a internal table with dynamic columns,
    Actually this is my first task in the WebAS 6.20, my program is based on input file provided by user with certain effort. this file can have different effort for a one yr to five year frame..
    I needed to read the raw data from file, based on months create a internal table to hold the data, after this i need to validate the data...
    I have browsed thru dynamic internal table topic, but couldn't find any dynamic appending structure, the dynamic structure would contains 12 month fileds.
    can any one help me in getting my task completed..
    Thanks
    Kumar

    Hi,
    I see that you posted the same question a couple of days ago at Dynamic Internal Table for reading data from external file Didn't Charles's response address your problem?
    Regards

  • Internal Table Types (Standard, Sorted, Hashed)

    Hi all,
    I wonder about using internal table types. I always work with standard table type. I don't know when i have to use the standard, sorted or hashed itab type. Is there limits for line counts of types, like over 200.000 lines use hashed table type etc. ? I need performance improvements for itabs.
    Thx,

    the terminology of internal tables is unfortunately quite confusing:
    internal tables use 'index' for the row number of the line in the table, if you know then you can access it directly. It is actually the sy-tabix variable which you have to know.
    Things which are called index on the database are called keys, i.e. the sorted primary key of a SORTED table or the hashed primary key of a HASHED table (the technical realization is actually called index).
    With the newest basis release (7.02 or 7.20) there are also secondary keys possible on internal tables, for all 3 types.
    Siegfried

  • Internal table to XML data in Application Server

    Dear Experts,
    I have converted the internal table data into XML format using CL_XML_DOCUMENT class and CREATE_WITH_DATA - method. Here I have to upload this XML converted file in the given application server path. Kindly suggest me some methods or class, other options to do this.
    I need to upload the XML file in to specified application server path. Kindly give some ideas.
    Regards,
    Sakthi

    I guess you want to transfer XML document type ref to IF_IXML_DOCUMENT (which is instantiated with this method and stored in attribute M_DOCUMENT ) to a file on application server. Is that right?
    If so please refer below program you should get the idea
    DATA: gr_ixml TYPE REF TO if_ixml,
          gr_ixml_doc TYPE REF TO if_ixml_document.
    gr_ixml = cl_ixml=>create( ).
    "here you have the same kind of XML document
    "as the one created with method CREATE_WITH_DATA
    gr_ixml_doc = gr_ixml->create_document( ). 
    DATA  gr_ixml_element TYPE REF TO if_ixml_element.
    CALL METHOD gr_ixml_doc->create_element
      EXPORTING
        name = 'JOBS'
      RECEIVING
        rval = gr_ixml_element.
    CALL METHOD gr_ixml_doc->append_child
      EXPORTING
        new_child = gr_ixml_element.
    CALL METHOD gr_ixml_element->set_attribute
      EXPORTING
        name  = 'OBJID'
        value = '566677890'.
    "serialization
    DATA g_encoding_type TYPE string.
    DATA g_stream_factory TYPE REF TO if_ixml_stream_factory.
    DATA gr_encoding TYPE REF TO if_ixml_encoding.
    g_stream_factory = gr_ixml->create_stream_factory( ).
    gr_encoding = gr_ixml->create_encoding( byte_order = 0
                                           character_set = 'UTF-8' ).
    DATA b_xml TYPE xstring.
    DATA gr_ostream TYPE REF TO if_ixml_ostream.
    gr_ostream = g_stream_factory->create_ostream_xstring( b_xml ).
    CALL METHOD gr_ostream->set_encoding
      EXPORTING
        encoding = gr_encoding.
    CALL METHOD gr_ixml_doc->render
      EXPORTING
        ostream = gr_ostream
        recursive = 'X'.
    DATA g_resize TYPE i.
    g_resize = gr_ostream->get_num_written_raw( ).
    data ex_tab type table of x255.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer                = b_xml
      tables
        binary_tab            = ex_tab.
    "now open file on application server
    OPEN DATASET dset FOR OUTPUT IN BINARY MODE.
    "and transfer ex_tab to dset
    Regards
    Marcin

  • Unicode error:a line of internal table and a data object are not mutually c

    Hi Friends,
        This is the issue in upgradation from 4.6c to ECC6.0
        I have an internal table itab which has include structure say 'xyz' . In xyz there is a field of type int4 as third field. I have a field as l_line which is a string.
    data : begin of itab occurs 0.
             include structure zxyz.
    data: end of itab.
    data: l_line type string.
    In the program I am getting the unicode error as:
    " A line of "itab" and "l_line" are not mutually convertible in unicode program." at he following line.
    loop at itab into l_line.
    endloop.
    Thanks,
    Ali.

    Hi Narendran,
    I did the same earlier, but the field l_line is again used in the another line as follows
    IF l_line CS w_group.----
    (1)
    where     w_group         LIKE zstr-cctr_group.
    here zstr-cctr_group is same as one of the fields of structure xyz.
    in line 1 it is giving warning as
    l_line is incompatible and it must be C,N,D,T or string.
    Thanks,
    Ali

  • Internal table for huge data

    HI,
    I have to populate internal table with huge number of data.
    What type of internal is suitable for this?
    Regards,
    Ram

    Hi ram,
    As long as you do not have any complex read functionalities, or nested loops, it should be fine to use the normal internal table.
    Regards,
    Ravi

  • How to display internal table or DDIC data into Form

    Hi
         can anybody help me that how can i show the field data from internal table or DDIC into SAPscript form.
    Pls let me know the example of both se38 code and text element screen.

    Why cant u refer a standard sapscript program.
    refer form RVORDER01
    in SE38 refer program RVADOR01
    Thi sis simple example.
    DATA: IT_INVOICEDETAIL LIKE TABLE OF ZINVOICEDETAIL WITH HEADER LINE.
    DATA: TOTAL LIKE ZINVOICEDETAIL-AMOUNT,
          CARRY LIKE ZINVOICEDETAIL-AMOUNT.
    SELECT * FROM ZINVOICEDETAIL INTO TABLE IT_INVOICEDETAIL.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
       FORM                              = 'ZDEMO1'.
       CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'HEAD'
      FUNCTION                       = 'SET'
       TYPE                           = 'TOP'
       WINDOW                         = 'MAIN'.
    LOOP AT IT_INVOICEDETAIL.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'BOX'
       WINDOW                         = 'MAIN'.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'ITEM'
       WINDOW                         = 'MAIN'.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'SUMMARY'
      FUNCTION                       = 'SET'
       TYPE                           = 'BOTTOM'
       WINDOW                         = 'MAIN'.
    ENDLOOP.
    CALL FUNCTION 'CLOSE_FORM'.
    In SE71 form u have to create the text element.
    BOX, ITEM,SUMMARY.
    /E  ITEM.
    P1 &IT_INVOICEDETAIL-TOTAL&

  • How to populate dynamic internal table fields with data??

    Hi Folks,
    How to assign a particular internal table field to a dynamically assigned internal table?
    I have an excel sheet, and i upload the excel sheet data into an internal IT_EXLOAD table using FM ALSM_EXCEL_TO_INTERNAL_TABLE
    Now i created a dynamic internal table which has the same column as in my DB table.
    I have to fill the dynamically created Internal table with the IT_EXLOAD data dynamically.
    Suppose in future if i add some field in DB table and for that field if i add some column in excel sheet there is no need to change in the program.
    Looking for reply...
    Best Regards,
    Sayak

    hi,
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_path
                i_begin_col             = '1'
                i_begin_row             = '2'
                i_end_col               = '2'
                i_end_row               = '1000'
           TABLES
                intern                  = intern
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
    *declare intern_tmp as internal table tb_data in wich you want the data
    *and declare a field symbol <fs_123>
    LOOP AT intern.
        ASSIGN COMPONENT intern-col OF STRUCTURE
        intern_tmp TO <fs_123>.
        IF NOT <fs_123> IS ASSIGNED.
          CLEAR intern.
          CLEAR intern_tmp.
          CONTINUE.
        ENDIF.
        <fs_123> = intern-value.
        AT END OF row.
          CLEAR tb_data.
          MOVE-CORRESPONDING: intern_tmp TO tb_data.
          APPEND tb_data.
          CLEAR intern_tmp.
        ENDAT.
        CLEAR intern.
      ENDLOOP.
    **paste this code and you can see the data in ur tables dynamically.
    Thanks
    Nitin Sachdeva

  • HR abap :  how to declare internal table to fetch data from 0585 infotype

    Hi all ,
    I am able to fetch the data from pa0585 infotype for set of employee no , but the problem is as the fields in pa0585 (like Contr to ULIP , NSC , Medical Treatment,Contribution to Certain Pension Funds so on ..) will be changed dynamically and will be displayed based on the amount value in descending order iam not able to store the values of the fileds into internal table . I dont understand how to declare the internal table ..Please help in if u have solved this kind of problem.
    I shld get the output in this way ...
    Emp No     Name    Medical treatment       Contr to ULIP             ....... so on
    101          abc           10000                        150000                      .......so on
    102          xyz           12000                        150000                      .......so on
    My header shld be fixed and I shld display values in this way .... I can use write statement to display directly .
    Thanks ....

    Hi
    Decalre INFOTYPE
    Goto SE37 - Find FM -
    READINFOTYPE*

  • How to insert  data from different internal  table  into a data base table

    hi all,
             I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
    in short i want to do something like the foll:
    INSERT  INTO ZMIS_CODES-CODE VALUE '1'.
    *INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)

    REPORT  ZINSERT.
    tables kna1.
    data: itab LIKE KNA1.
    data lv_kUNAG LIKE KNA1-KUNNR.
    lv_kuNAG =  '0000010223'.
    ITAB-kuNNR = lv_kuNAG.
    ITAB-name1 = 'XYZ'.
    INSERT INTO KNA1 VALUES ITAB.
    IF SY-SUBRC = 0.
    WRITE:/ 'SUCCESS'.
    ELSE.
    WRITE:/ 'FAILED'.
    ENDIF.
    Here lv_kunag is ref to kna1 kunnr passed in different name
    In internal table .
    Try and let me know if this logic dint work.

Maybe you are looking for

  • How to set default TV show cover in iTunes 11?

    Hi to all! I have just updated to the new iTunes 11 and I am going through all the changes and the new features. My first to question to anyone who has ansewrs is this: As I saw in the TV Shows section they have finaly gathered all the seasons into e

  • E3000 - Possible to see list of wirelessly connected PCs?

    Hello, I just bought a Linksys E3000 and I have a quick question I hope you can answer. My old wireless router (Zyxel P334WT) that I bought the E3000 to replace, had a page in the web interface that allowed the admin to view who was connected to the

  • How do I adjust keyframes for smoother movement in FCPX?

    I am having a lot of trouble adjusting keyframes in Final Cut Pro X.  I have a video project that is 97% still images. All I want to do is simple pans and zooms across the picture. The keyframes in FCPX are giving me nightmares.  I spent all day tryi

  • Font book problems 10.9

    Hi guys, Can anyone help with this issue of Font Book not loading fonts? They've all gone hideaway since upgrading, and as a graphic designer it's a nightmare as I only have a handful to choose from. I'm on 10.9.2 I use the Adobe CC apps. Help or a l

  • Facebook won't refresh

    FFacebook app on iPad doesn't refresh. It tries but eventually times out.  I have to reboot the iPad in order for it to update the FB feed. It's annoying!  I've tried deleting the app and reloading but the issue is still there.