Difference between line type and table type

hi,
can any one explain the difference between line type and table type . and how to declare a internal table and work area in BSP's

hi,
Go through this blog, this might help you.
/people/tomas.altman/blog/2004/12/13/sdn-blog-how-to-do-internal-tables-in-bsp
People who have worked with ABAP for a while sometimes forget that the internal table concept is rather different than what exists in most programming languages. It is very powerful, but at the same time can be confusing.
In SAP it is possible to have a table which is the rows and a headerline which is the working area or structure which can then be commited to the table.
With a BSP, if we try to create an internal table within the BSP event or layout we will get the following error: mso-bidi-
                        "InternalTableX" is not an internal table - the "OCCURS n" specification is mso-bidi- missing.
class="MsoNormal"><![if !supportEmptyParas]>The problem we are seeing as an inconsistency has to do with the difference between classic ABAP and ABAP Objects. When SAP introduced ABAP Objects they decided to clean up some of the legacy syntax and create stricter rules. However they didn't want to break the millions of line of code that already existed, so they only implemented these stricter checks when OO is being used. Therefore you can declare a table with a header line in a regular ABAP program or Function Module but you can't have one with a header line in OO.
Because everything in BSP generates ABAP OO classes behind the scenes, you get these same stricter syntax checks. My suggestion is that you have a look in the on-line help at the section on ABAP Objects and always follow the newer syntax rules even when writing classic ABAP programs.
In a BSP when we need to work with a table we must always do the following:
1, in the Types definitions create a structure:
                        types : begin of ts_reclist,
mso-bidi-        style='mso-tab-count:2'>                            receiver type somlreci1-receiver,
mso-bidi-        style='mso-tab-count:2'>                 style='mso-tab-count: 1'>             rec_type type somlreci1-rec_type,
mso-bidi-         style='mso-tab-count:2'>                            end of ts_reclist.
mso-bidi- <![if !supportEmptyParas]> <![endif]>
but we must remember this is only a structure definition and we cannot store anything in it, although we can use it elsewhere as a definition for Structures(WorkAreas)
2, in our Types definitions (this is the best place for this one as we can then access it from many areas without having to create it locally) so in the Types definitions we must create a TableType:
class="MsoNormal">                         types : tt_reclist type table of ts_reclist.
class="MsoNormal"><![if !supportEmptyParas]> <![endif]> this TableType is our table definition and again we cannot store anything in it, but we can use it elsewhere as a definition for InternalTables
3, now that you have laid the foundations you can build and in the event handler, it is now simply a case of creating the InternalTable based upon the Table definition:
                       data: t_reclist type tt_reclist.
and creating the structure based upon the structure definiton:
<![if !supportEmptyParas]>   <![endif]>                         data: s_reclist type ts_reclist.
as described above, the structure becomes the work area and this is where you assign new values for elements of the table eg:<![endif]>
                        s_reclist-receiver = '[email protected]'.   "<-- change address
mso-bidi- <![if !supportEmptyParas]> <![endif]>
mso-bidi-                         s_reclist-rec_type = 'U'.
and then once the data is in the elements of the structure, the structure can be appended to the internal table as follows: class="MsoNormal">
                        append s_reclist to t_reclist.
<![if !supportEmptyParas]> <![endif]>
the internal table will then be readable for the ABAP function and can be applied for example as follows: class="style1">           style='mso-tab-count:1; font-family: "Courier New", Courier, mono;'>          
class="style1">CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
                        EXPORTING
style='mso-tab-count:2'>                                    document_data = docdata
style='mso-tab-count:2'>                                    DOCUMENT_TYPE = 'RAW'
style='mso-tab-count:2'>                                    PUT_IN_OUTBOX = 'X'
style='mso-tab-count:2'>                                    COMMIT_WORK = 'X' "used from rel.6.10
                        TABLES
mso-bidi-font-size: style='mso-tab-count:2'>                                    receivers = t_reclist
class="style1"> <![if !supportEmptyParas]>   <![endif]>
<![if !supportEmptyParas]>F inally, a comment from Thomas Jung,
<![if !supportEmptyParas]> “when defining my work area for an internal table I like to use the like line of statement. That way if I change the structure of my table type, I know that my work area will still be OK. Second, your types and table types don't have to just be declared in your code. You can create a table type in the data dictionary and use it across multiple programs(also great for method and function parameters). I really push hard for the other developers at my company to use the Data Dictionary Types more and more.”
Hope this helps, Do reward.

Similar Messages

  • What is the difference between partner function and partner type

    Hi Gurus,
    What is the difference between partner function and partner type?
    Thanks,
    Paul

    Hi John,
    The partner types allow us to distinguish between different business partners such as customer, vendor, employee etc and the partner functions represent the functionality or role each partner plays within the business transaction.
    For example under the partner type Customer, you will find - Sold to party, Ship to party, Bill to party, Payer.
    The business partners that exist in the market place are represented with a partner type in the R/3 system. Examples of business partners are customer, vendor, employee and contact person.
    The following partner types are defined in the partner processing for the sales & distribution module –
    a.     AP – contact person (06)
    b.     KU – customer (07)
    c.     LI – vendor (08)
    d.     PE – employee/personnel (09)
    Assigning the partner functions in the SAP system determines the functions of particular partner in the sales process. One partner may take on several functions also.
    REWARD POINTS IF HELPFUL
    Regards
    Sai

  • Calling Oracle Stored proc with record type and table Type

    I have a oracle SP which takes record type and table Type which are used for order management.
    Is there anay way to populate parameters with these datatypes and call the stored procedure using ODP.NET?
    Please help.
    Thanks in advance

    Hi,
    ODP supports associative arrays and REF Cursors. There is no support for PLSQL table of records.
    Jenny

  • How does a record type and table type works

    Hi,
    How a record type and table type work for the ref cursor,
    below i m giving an example but its giving me errors
    can any one help me for this?
    declare
    type empcurtyp is ref cursor;
    type rectype is record (veid t.emp_id%type, vename t.ename%type);
    TYPE tabtype IS TABLE OF rectype;
    empcv empcurtyp;
    vtab tabtype;
    begin
    open empcv for select emp_id,ename from t;
    loop
    fetch empcv into vtab;
         exit when empcv%notfound;
         dbms_output.put_line(vtab.vename||vtab.veid);
    end loop;
    close empcv;
    end;
    here we hav table t and i m taking only two fields of the table t which r emp_id and ename.

    Hi,
    What errors are you getting with this? From experience you don't need a loop to put the records into the ref cursor its usually done on block.
    HTHS
    L :-)

  • How could I retrieve metadata about Array Type and Table Type?

    I use DatabaseMetaData.getUDTs() method for obtain metadata about Object Types, but this method doesn't work with Array Type and Table Type.

    JJ,
    Go into the diagrams of the DBTools List Columns and DBTools Get Properties respectively. When you inspect this diagram, you will see the raw ActiveX properties and methods called to get the size information. The value of -1 means the requested recordset is already closed. This is the sort of thing that is controled by the driver (ODBC, OLE DB, Jet, etc) you are using. Notice that you can right click on the property and invoke nodes and get more information about these specific items directly from the ADO online help.
    Crystal

  • Difference between Info structure and Table

    Hi Friends
    I need to know difference between info structure and table (updating a table using a scheduled program),Which one of this is better and why?
    Please help me to get the Pros and Cons of the two available approach.
    Thanks
       Mitesh

    Hi,
         No different, these are just transparent tables like any other. You can select data from them the same as any other transparent table.
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4342729&messageID=1424611
    https://forums.sdn.sap.com/click.jspa?searchID=4342729&messageID=3609095
    Regards

  • Difference between Database view and Table

    Hi there,
    Can anyone tell me the difference between Database view and Table.
    Will the Database view query be more faster than a database table?

    Tables and database views can be defined in the ABAP Dictionary.
    These objects are created in the underlying database with this definition. Changes in the definition of a table or database view are also automatically made in the database.
    Data from several tables can be combined in a meaningful way using a view (join).
    You can also hide information that is of no interest to you (projection) or only display
    those data records that satisfy certain conditions (selection).
    Database views implement an inner join. You only get those records which have an
    entry in all the tables included in the view.
    in views db modifications are not possible
    views only contain data at run time
    when they consult the database
    in case of views the join definitions are already sstored in the database itself
    whereas join as open sql is a query to oracle  database as similar select statements
    Views are optimized by SAP and stored in the repository while Joins
    are in reports that needs to be compiled at every execution
    Reward if helps
    Regards,
    Senthil
    Message was edited by: senthil kumar

  • Purpose of Row type, line type and Table Type..

    Hi All,
    Just I’m started working with OOABAP. Whenever I open some structures, most of the components in the structures have the below three words. What is the exact difference b/w the below words. What is purpose those?
    Row type, line type
    Table type:
    Please let me know.

    hi,
    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.
    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 NON-UNIQUE. 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.
    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.
    At tables with structured row type, the standard key is formed from all character-type columns of the internal table. 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. At tables with non-structured row type, the standard key consists of the entire row. If the row type is also a table, an empty key is defined.
    The user-defined key can contain any columns of the internal table that are no internal table themselves, and do not contain internal tables. References are allowed as table keys. 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.
    Internal tables are always completely specified regarding row type, key and access type
    Hope this helps.

  • Urgent : How to modify the line type and table type

    I am working on ALV Grid Control, i need to know how to modify the line type values to table type.
                 ls_celltab-fieldname = 'ZSAVINGS '.
                 ls_celltab-style = l_mode.
            INSERT ls_celltab INTO TABLE pt_celltab.
    Here ls_celltab is line type and pt_celltab is table type.
    Please give me the suggestion ASAP.
    C.Bharath Kumar

    Hi,
    Here is the example
    DATA: BEGIN OF LINE,
            LAND(3)  TYPE C,
            NAME(10) TYPE C,
            AGE      TYPE I,
            WEIGHT   TYPE P DECIMALS 2,
          END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE
              WITH NON-UNIQUE KEY LAND NAME AGE WEIGHT.
    LINE-LAND = 'G'.   LINE-NAME   = 'Hans'.
    LINE-AGE  = 20.    LINE-WEIGHT = '80.00'.
    INSERT LINE INTO TABLE ITAB.
    LINE-LAND = 'USA'. LINE-NAME   = 'Nancy'.
    LINE-AGE  = 35.    LINE-WEIGHT = '45.00'.
    INSERT LINE INTO TABLE ITAB.
    Regards
    Sudheer

  • Difference in Line manager and Devlopment manager

    Hi Folks,
    Can somebody please tell me that what is the difference between, Line manager and
    Devlopment Manager?
    Where do we find them?As i searched in IMG under transaction PPOME that is for
    organisation and staffing,but there were positions like pool manager,staffing manager ,resources but couldn't find Line Manager and Devlopment manager.
    I am using PTT(system,client 002).
    Please answer.
    Thanks and Regards
    Anshu Jha

    Hi rajiv,
    Thanks for telling that PPOMA_CRM transaction.But there is also one transaction called RPM_EMPDATA ,which can be usedin PTT system, client 002,026. That displays resources and users.Once you fill the user name as(remote_catt) for example , and activate it(F8),it will show overview of employee data.There we can find line manager.But, i don't understand who is the person whose name should be put there ?
    Thanks for your ans wer and find out more if you can help me in that.
    Thanks
    Anshu

  • Difference between line type and internal table?

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

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

  • Difference between Table and Table Type

    Hi
       Can you please let me know the
    Difference between Table and Table Type and
    Difference between Structure and Table Type?
    Regards,
    Sree

    hi,
    table is a data dictionary object in sap. table is of different types
    1. transparent tables
    2. pool tables
    3. cluster tables
    table type gives option for u to select different types of internal tables. they r
    1. standard table
    2. sorted table
    3. hash table
    Structures :
    -Defined like a table and can then be addressed from ABAP programs.
    -Structures contain data only during the runtime of a program.
    -Just like user-defined data type.
    - they are not present in database server and only on application server.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • The difference between FIELD-SYMBOL and normal DATA TYPE

    Dear experts,
    Please see the example below, both are output the same result.
    DATA: EXTERNAL_RECORD(4000),
          POSITION TYPE I,
          LENGTH TYPE N,
          ENTRY TYPE STRING.
    EXTERNAL_RECORD = '0005Smith0007Edwards0005Young'.
    DO.
      LENGTH = EXTERNAL_RECORD+POSITION(4).
      IF LENGTH = 0.
        EXIT.
      ENDIF.
      ADD 4 TO POSITION.
      MOVE EXTERNAL_RECORD+POSITION(LENGTH) TO ENTRY.
      WRITE ENTRY.
      ADD LENGTH TO POSITION.
      IF POSITION >= 4000.
        EXIT.
      ENDIF.
    ENDDO.
    --OR It can be written as--
    DATA: EXTERNAL_RECORD(4000),
          POSITION TYPE I,
          LENGTH TYPE N.
    FIELD-SYMBOLS <ENTRY>.
    EXTERNAL_RECORD = '0005Smith0007Edwards0005Young'.
    DO.
      LENGTH = EXTERNAL_RECORD+POSITION(4).
      IF LENGTH = 0.
        EXIT.
      ENDIF.
      ADD 4 TO POSITION.
      ASSIGN EXTERNAL_RECORD+POSITION(LENGTH) TO <ENTRY>.
      WRITE <ENTRY>.
      ADD LENGTH TO POSITION.
      IF POSITION >= 4000.
        EXIT.
      ENDIF.
    ENDDO.
    Is there any special circumstances we need to use FIELD-SYMBOL?
    Why is FIELD-SYMBOL is introduce in the first place?
    Kindly advice with example.
    Thanks in advance for those who can help me on this.

    HI,
    You can use field symbols to make the program more dynamic. In this example the name of a table control is substituted by a field symbol. Thus you cal call the form with any internal table, using the name of the table control as a parameter.
    Example
    form insert_row
    using p_tc_name.
    field-symbols <tc> type cxtab_control. "Table control
    assign (p_tc_name) to <tc>.
    insert 100 lines in table control
    <tc>-lines = 100.
    Field symbols allow you to:
    **     Assign an alias to a data object(for example, a shortened
            name for data objects structured through several hierarchies
            - <fs>-f instead of rec1-rec2-rec3-f)
    **     Set the offset and length for a string variably at runtime
    **     Set a pointer to a data object that you determine at runtime (dynamic ASSIGN)
    **     Adopt or change the type of a field dynamically at runtime
    **     Access components of a structure
    **     (from Release 4.5A) Point to lines of an internal table
            (process internal tables without a separate work area)
    Field symbols in ABAP are similar to pointers in other programming
    languages. However, pointers (as used in PASCAL or C) differ from ABAP
    field symbols in their reference syntax.
    The statement ASSIGN f to <fs> assigns the field f to field
    symbol <fs>. The field symbol <fs> then "points" to the
    contents of field f at runtime. This means that all changes to the
    contents of f are visible in <fs> and vice versa. You declare
    the field symbol <fs> using the statement FIELD-SYMBOLS: <fs>.
    Reference syntax
    Programming languages such as PASCAL and C use a dereferencing symbol
    to indicate the difference between a reference and the object to which
    it refers; so PASCAL would use p^ for a pointer instead of p, C would
    use *p instead of p. ABAP does not have any such dereferencing symbol.
    **     In PASCAL or C, if you assign a pointer p1 to a pointer p2,
    you force p1 to point to the object to which p2 refers (reference semantics).
    **     In ABAP, if you assign a field symbol <fs1> to a field
    symbol <fs2>, <fs1> takes the value of the data object to
    which <fs2> refers (value semantics).
    **     Field symbols in ABAP are always dereferenced, that is,
    they always access the referenced data object. If you want to
    change the reference yourself in ABAP, you can use the ASSIGN statement
    to assign field symbol <fs1> to field symbol <fs2>.
    Using field symbols
    You declare field symbols using the FIELD-SYMBOLS statement.
    They may be declared either with or without a specific type.
    At runtime you assign a field to the field symbol using the ASSIGN
    statement. All of the operations on the field symbol act on the field
    assigned to it.
    When you assign a field to an untyped field symbol, the field symbol
    adopts the type of the field. If, on the other hand, you want to assign
    a field to a typed field symbol, the type of the field and that of the
    field symbol must be compatible.
    A field symbol can point to any data object and from Release 4.5A,
    they can also point to lines of internal tables.
    The brackets (<>) are part of the syntax.
    Use the expression <fs> IS ASSIGNED to find out whether the field
    symbol <fs> is assigned to a field.
    The statement UNASSIGN <fs> sets the field symbol <fs> so
    that it points to nothing. The logical expression <fs>
    IS ASSIGNED is then false. The corresponding negative expression
    is IF NOT <fs> IS ASSIGNED.
    An unassigned field symbol <fs> behaves as a constant with
    type C(1) and initial value SPACE.
    MOVE <fs>
    TO dest     Transfers the initial value SPACE to the variable dest
    MOVE 'A' to <fs>     
    Not possible, since <fs> is a constant
    (runtime error).
    To lift a type restriction, use the CASTING addition in the
    ASSIGN statement. The data object is then interpreted as though
    it had the data type of the field symbol. You can also do this
    with untyped field symbols using the CASTING TYPE <type> addition.
    The danger with pointers is that they may point to invalid areas.
    This danger is not so acute in ABAP, because the language does not
    use address arithmetic (for example, in other languages, pointer p
    might point to address 1024. After the statement p = p + 10, it would
    point to the address 1034). However, the danger does still exist, and
    memory protection violations lead to runtime errors.
    A pointer in ABAP may not point beyond a segment boundary. ABAP does
    not have one large address space, but rather a set of segments.
    Each of the following has its own segment:
    *     All global data
    *     All local data
    *     Each table work area (TABLES)
    *     Each COMMON PART
    You should only let field symbols move within an elementary field or
    structure where ABAP allows you to assign both within the global data
    and beyond a field boundary.
    Rgds
    Umakanth

  • What's the difference between segment filtering and reduced message type

    Hi gurus,
    What's the difference between segment filtering and reduced message type? It seems they have the same functionality: Reduce the segment while idoc is generated.
    Thanks in advance.

    Hi,
    BD53 is for IDoc Reduction.
    this allows you to create a reduced message based upon a standard message type.If you want see mandatory fields. go to T-coe BD53 and give one standard messege type name and eg: matmas
    there mandatory fields will be in Green color..
    And BD56- This transaction is used to filter out segments of IDocs for combination of sender and receiver. This is usefull in scenarios where a standard IDoc with many segments is used but the receiving partner is only interested in some of the segments
    the table related to this transation is TBD20
      please go through below blog you have an idea abt that,
    http://wiki.sdn.sap.com/wiki/display/ABAP/ReducedMessageTypes
    http://saptotal.com/IDoc%20Segment%20Filtering.html
    regards,
    ganesh.

  • Difference between fully-specified data types. and generic types

    Hi,
    Can anyone tell me the difference between fully-specified data types and generic types.
    Thanks in advance.
    Regards,
    P.S.

    HI
    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 TABLEincludes 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.
    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.
    see this link
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm
    <b>Reward if usefull</b>

Maybe you are looking for

  • How do I make my animation look the same in different browsers?

    Hi! When I play my animation in different browsers it don't look the same as in the preview. In IE some of the parts of the animation have disappeared and in Chrome the pats are no longer in their right places. See picture below.  How do I do to make

  • Problem triggering "WF"

    Hey - We are processing EDI-855 PO acknowledgment(Inbound Idoc).We have custom standalone function module to do the posting on SAP,not using any standard SAP code. If we have any idoc status with '51' needs to be trigger "Work Flow" events and also W

  • Cursor Positioning

    I have several TextFields on a Form. Does anyone know how to position the cursor at a specific field when the Form is redisplayed? Thanks Glen

  • Show all rows in ALV

    Hi, i use an ALV and want to show all exsiting rows. Until now i can only see the first 10 rows. How can i do that? regards, Sharam

  • Solaris 10 startup scripts

    how to replace the startup scripts from Solaris 9 or 8 to Solaris 10?