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

How to use type group

Hi experts,

I Searched the forum for this Issue. But I can't get the answer.

what is the use of type group and how we use it in our program?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Aug 27, 2007 at 09:34 AM

    Hii Naresh..

    Type-group or Type pool is a collection of Data types and Constants which can be called globally from any program.

    It is created in SE11 .

    For eg: Type groups delivered by SAP - ABAP,SLIS...

    To call a type group in a program

    TYPE-POOLS abap.

    DATA : V_TEST TYPE ABAP_TRUE. "it is a constant that stores 'X'.

    <b>Reward if Helpful</b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2007 at 09:29 AM

    Hi

    Please ignore my previous post.

    Type-group is used to declare the different data declarations under single type group. if we want create our own type group go for se11 and create the type group.Please find the given below example for your reference.

    type-pools ztvv1.

    data : emp type ztvv1_stru,

    ded type ztvv1_ded.

    data tsal type p decimals 2.

    move '123' to emp-no.

    move 'RAGHU' to emp-name.

    move '9234.55' to emp-sal.

    move '1123' to ded-hra.

    move '1000' to ded-ta.

    move '600' to ded-pf.

    tsal = emp-sal + ded-hra + ded-ta - ded-pf + ztvv1_sa-bonus.

    write :/10 'EMPLOYEE INFORMATION' color 6 inverse on.

    uline.

    write :/30 'EMPNO',18 emp-no.

    write :/30 'EMPNAME',18 emp-name.

    write :/30 'EMPNETSAL', tsal.

    Reward points!!

    Thanks & Regards,

    Vasudeva Rao.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2007 at 09:39 AM

    type group : ABAP program that cannot be started independently. Contains the definitions of globally visual data types and constants. Does not support any dynpros of its own.

    Before Release 4.5A, it was not possible to define standalone types in the ABAP Dictionary to which you could refer using a TYPEaddition 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 that, you define data types using the statement TYPES. 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: pool_

    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.

    Note:

    As of release 6.40, you can also define data types and constants in the public visibility area of global classes, by which type groups can be completely replaced.

    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 this definition with the 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 DATAstatement and the value of the constant is, as the output shows, known in the program.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2007 at 12:29 PM

    refer" target="_blank">http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3138358411d1829f0000e829fbfe/content.htm">refer this link for type group

    regards,

    srinivas

    <b>*reward for useful answers*</b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2007 at 12:02 PM

    Thanks

    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.