Skip to Content
author's profile photo Former Member
Former Member

Type group

What is a type group and wats it purpose?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2008 at 06:03 AM

    Group for storing user-defined data types or constants in the ABAP Dictionary so that they can be accessed by any program.

    The ABAP statement used for this purpose is TYPE-POOLS.

    Type Groups

    Before Release 4.5A, it was not possible to define standalone types in the ABAP Dictionary to which you could refer using a TYPE addition in an ABAP program. It was only possible to refer to flat structures. Structures in programs corresponded to the structures of database tables or structures in the ABAP Dictionary. In ABAP programs, you could only refer to database tables and structures in the ABAP Dictionary using LIKE. It was, however, possible to refer to individual components of the Dictionary type. Complex local data types such as internal tables or deep structures had no equivalent in the ABAP Dictionary. The solution to this from Release 3.0 onwards was to use type groups. Type groups were based on the include technique, and allowed you to store any type definitions globally in the Dictionary by defining them using TYPES statements.

    The definition of a type group is a fragment of ABAP code which you enter in the ABAP Editor. The first statement for the type group <pool> is always:

    TYPE-POOL <pool>.

    After this came the definitions of data types using the TYPES statement, as described in Local Data Types in Programs. It was also possible to define global constants using the CONSTANTS statement. All the names of these data types and constants must begin with the name of the type group and an underscore:

    In an ABAP program, you must declare a type group as follows before you can use it:

    TYPE-POOLS <pool>.

    This statement allows you to use all the data types and constants defined in the type group <pool> in your program. You can use several type groups in the same program.

    Let the type group HKTST be created as follows in the ABAP Dictionary:

    TYPE-POOL hktst.

    TYPES: BEGIN OF hktst_typ1,

    col1(10) TYPE c,

    col2 TYPE i,

    END OF hktst_typ1.

    TYPES hktst_typ2 TYPE p DECIMALS 2.

    CONSTANTS hktst_eleven TYPE i VALUE 11.

    This type group defines two data types HKTST_TYP1 and HKTST_TYP2, as well as a constant HKTST_ELEVEN with the value 11.

    Any ABAP program can use these definition by including a TYPE-POOLS statement:

    TYPE-POOLS hktst.

    DATA: dat1 TYPE hktst_typ1,

    dat2 TYPE hktst_typ2 VALUE '1.23'.

    WRITE: dat2, / hktst_eleven.

    The output is:

    1,23

    11

    The data types defined in the type group are used to declare data objects with the DATA statement and the value of the constant is, as the output shows, known in the program.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 12, 2008 at 05:57 AM

    Hi

    Type group is a collection of types that you define in the ABAP dictionary so that you can access them and define the objects of that type in any of the programs through out the ABAP programs

    type-pools

    type-group

    http://sap.mis.cmich.edu/sap-abap/abap02/sld034.htm

    Regards

    Pavan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2008 at 05:59 AM

    Hi

    You can define data types in a type group in the ABAP/4 Dictionary instead of defining them within an ABAP/4 program.

    The types in a type group must be declared in ABAP/4 programs with the TYPE-POOLS command.

    Regards

    Hitesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.