Table Types and Type Groups in ABAP

 

Table Types

Table types are type definitions for Internal tables. By using them you can declare internal tables in your program.

Creating a table type
  • Go to SE11, select Data type Radio button, provide a name for table type, and click Create button. Ex. ZTSCARR

typegr1

  • Select Table type radio button and click Continue.

typegr2

  • In the maintenance screen provide short text
  • Provide an existing DDIC structure name as line type. Ex. SCARR

typegr3

  • under the tab initialization and access select the type of the internal table. Usually we create Standard tables.

typegr4

  • Finally Save and activate.
  • In the future programs internal tables without header line can be created using this table type. Ex. DATA it_data TYPE ZTSCARR.

Type Groups

Type group is a DDIC object which is a collection of user defined Data types and constants.

Creating a type group
  1. Go to SE11, select Type Group radio button and provide a name for it. Ex. ZBRSL, and click on Create button.

typegr5

  1. In the maintenance screen, provide short text and start creating your own user defined data types and Constants.

typegr6

  1. Every data type and Constant should be prefixed by the name of the type group.
TYPES: ZBRSL_STR(30) TYPE C.
TYPES: ZBRSL_FLOAT TYPE P DECIMALS 3.

TYPES: BEGIN OF ZBRSL_STUDENT,

               RNO TYPE I,

               NAME(20) TYPE C,

               FEE TYPE P DECIMALS 2,

          END OF ZBRSL_STUDENT.

CONSTANTS ZBRSL_PI TYPE P DECIMALS 3 VALUE '3.147'.

4. Finally save and Activate.

5. To use a type group in a program attach it to the program by the key word:

TYPE-POOLS        Ex: TYPE-POOLS ZBRSL.

 

Comments

Popular posts from this blog

Domains and Data Elements

How to update exchange rates via process chain in BW

Sample ABAP program for Updating notepad file data to Internal table and Sending it to Application server