‎2007 Jul 19 11:04 AM
can any body tell me abt the type pools why we will use and when we will use.
‎2007 Jul 19 11:14 AM
<b>Type Groups</b>
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:
<b>TYPE-POOL <pool>.</b>
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:
<b>TYPE-POOLS <pool>.</b>
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.
example :
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 DATA statement and the value of the constant is, as the output shows, known in the program.
reward points if it is usefull...
Girish
‎2007 Jul 19 11:06 AM
TYPE-POOLS tpool.
Effect
Declaring global data types and constants from a type group.
The TYPE-POOLS statement declares the data types and constants of type group tpool You can specify it in the global data declarations of an ABAP program or in the declaration section of a class or interface. The data types and constants of the type group are visible as of this statement in the current context.
Notes
If the declared type group tpool integrates a further type group with the TYPE-POOLS statement, its data types and constants are also declared.
,,Data types declared using type groups cover ABAP Dictionary data types of the same name.
Example
Declaration of the predefined type group abap. By referring to the table type abap_func_parmbind_tab from the type group abap, the system declares an internal table parameter_tab for the dynamic parameter transfer to function modules.
TYPE-POOLS abap.
DATA parameter_tab TYPE abap_func_parmbind_tab.
‎2007 Jul 19 11:09 AM
Hi,
When you want to group some contants and TYPES that you dont want to store in DDIC sepearately then declare them in a type pool.
Then you can use them in your program with the help of statement.
All the contants and typesdeclared in the type group will start with the TYPE GROUP name.
TYPE-POOLS: abap.
Regards,
Sesh
‎2007 Jul 19 11:14 AM
<b>Type Groups</b>
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:
<b>TYPE-POOL <pool>.</b>
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:
<b>TYPE-POOLS <pool>.</b>
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.
example :
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 DATA statement and the value of the constant is, as the output shows, known in the program.
reward points if it is usefull...
Girish
‎2007 Jul 19 11:38 AM
Hi Ravi,
<b>TYPE-POOL</b>
<i>The introductory statement TYPE-POOL can only be used for type groups (type T programs). A program introduced with the TYPE-POOL statement can only contain global type definitions and constants declarations.</i>
<b>Basic form
TYPE-POOL typepool.</b>
<b>Effect</b>Introduces a type group. <b>You can only maintain a type group via the ABAP/4 Dictionary (using Transaction SE11 ).</b> The name typepool must match the name in the ABAP/4 Dictionary . You can only define types and constants in type groups. The names of all these types and constants must begin with the name of the type group and an underscore.
<b>Example</b>
TYPE-POOL ABCDE.
TYPES: ABCDE_PACKED TYPE P,
ABCDE_INT TYPE I.
<b>Basic form
TYPE-POOLS typepool.</b>
<b>Effect</b>
Includes the types and constants of a type group. If the type group typepool has already been included, the statement is ignored. You can only maintain a type group via the ABAP/4 Dictionary (using Transaction SE11 ). You introduce a type group with the <b>TYPE-POOL</b> statement. Since the types and constants specified in a type group have global validity, you cannot use the statement within a FORM or FUNCTION .
<b>Example</b>
TYPE-POOLS VERI1.
DATA X TYPE VERI1_TYP1.Regards
Sathish
‎2007 Jul 19 11:48 AM
TYPE-POOLS
Syntax
TYPE-POOLS tpool.
Effect
In order to use the definitions of a type group, you have to integrate the type group into
the program.
The TYPE-POOLS statement integrates the type group tpool into the current context. You can
specify it in the global data declarations of an ABAP program or in the declaration section
of a class or interface. The data types and constants of the type group are visible as of
this statement in the current context.
For ALV:
YOu need defined in types pool SLIS.
The reason is,
TYPE-POOLS SLIS.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
The type SLIS_T_FIELDCAT_ALV is defined in type pools SLIS.
-
Type-pools are just a way of modulerizing code, The code that is held in a type pools are
just a bunch of TYPES statements, Then when you say TYPE-POOLS statement in your program,
you can then use any TYPE which as been defined in the type-pool.
Types-pools: slis.
For example, you can now use any type which is defined in SLIS. The SLIS Type Pool holds all
of the types used when programming the ALV grid using the REUSE function modules.
-
Type Pools : are collection of Data type declarations.
These type declarations are globally available across all SAP applications.
Type pools can be created in SE11 (SAP dictionary).
Basic form
TYPE-POOLS typepool.
Effect
Includes the types and constants of a type group. If the type group typepool has already
been included, the statement is ignored. You can only maintain a type group via the ABAP/4
Dictionary (using Transaction SE11 ). You introduce a type group with the TYPE-POOL
statement. Since the types and constants specified in a type group have global validity, you
cannot use the statement within a FORM or FUNCTION .
Example
TYPE-POOLS VERI1.
DATA X TYPE VERI1_TYP1.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3138358411d1829f0000e829fbfe/content.htm
regards,
srinivas
<b>*reward for useful answers*</b>