Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to create data class

Former Member
0 Likes
2,647

Hi Guys,

I have one issue with data class, When we are creating the table, we use to select the APP01, APP02 and etc, but i need to create my own data class.

Could any one help me, how to create the data class?

Thanks,

Gourisankar.

7 REPLIES 7
Read only

Former Member
0 Likes
1,632

This message was moderated.

Read only

Former Member
0 Likes
1,632

Hi,

The data class defines the physical area of the database (for ORACLE the TABLESPACE) in which your table is logically stored. If you choose a data class correctly, your table will automatically be assigned to the correct area when it is created on the database.

The most important data classes are (other than the system data):

APPL0 Master data

APPL1 Transaction data

APPL2 Organizational and customizing data

Master data is data which is frequently read, but rarely updated. Transaction data is data which is frequently updated.Organizational und customizing data is data which is defined when the system is initialized and then rarely changed.

There are two more data classes available, USR and USR1. These are reserved for user developments. The tables assigned to these data classes are stored in a tablespace for user developments.

You can create your own data class under USR and USR1.

hope it will help you.

Regards

Rajesh Kumar

Read only

tarangini_katta
Active Contributor
0 Likes
1,632

Hi Gourisankar,

Why you want to create Own data class.U have the data class usr1 usr2 for user data classes.

I think it is not good to create ur own data class.

Thanks,

Read only

Former Member
0 Likes
1,632
Read only

abap_team
Explorer
0 Likes
1,632

Hi GauriShankar

You can use class in two ways.

1) Global Class

It can be created in se24.Give the name of the class and short description and you will get into the class builder

In the attributes tab, give the two numbers as

a Public Instance Type I description

b Public Instance Type I description

In the methods tab, Click on the constructor button to create the constructor method. You can click on the parameters tab to give the parameters for the method

Give the parameters as

param_a Importing Type I description

param_b Importing Type I description

Now create a new method whose description is

add Instance Description

Double click on the method name to go into the editor.

In the constructor method

Just assign

a = param_a and

b = param_b

Now in the add method

data: sum type i.

sum = a + b.

message i001(zmess) with sum.

Now save and activate the class.

Now in the main program.

data: obj type ref to ZMYCLASS.

start-of-selection.

create object obj exporting param_a = 10

param_b = 20.

call method obj->add.

This will be the way to use classes.

2) Local classes.

Just go through this document to have a better idea.

http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt

Read only

shadow
Participant
0 Likes
1,632

Hi,

Data class,

The Data class determines in which table space the table is stored when it

is created in the database.

which are appropriate for application tables:

APPL0 - Master data (data frequently accessed but rarely updated)

APPL1 - Transaction data (data that is changed frequently)

APPL2 - Organizational data (customizing data that is entered when system is

Configured and then rarely changed)

The other two types are:

USR

USR1 - Intended for customers own developments.

Regard's

Shaik.

Read only

former_member206439
Contributor
0 Likes
1,632

Hi

data class are defined by SAP depending upon the selction coresponding physical area will be selected .

If you choose the data class correctly, your table is automatically assigned to the correct area (tablespace or DBspace) of the database when it is created. Each data class corresponds to a physical area in which all the tables assigned to this data class are stored. There are the following data classes:

APPL0 (master data): Data which is seldomly changed. An example of master data is the data contained in an address file, such as the name, address and telephone number.

APPL1 (transaction data): Data that is frequently changed. An example of transaction data is the goods in a warehouse, which change after each purchase order.

APPL2 (organizational data): Customizing data that is defined when the system is installed and seldomly changed. An example is the table with country codes.

Two further data classes, USR and USR1, are provided for the customer. These are for user developments. The tables assigned to these data classes are stored in a tablespace for user developments.