Файл: BC430_EN_Col62_FV_Part_A4_-_ABAP_Dictionary.pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 03.04.2021

Просмотров: 2291

Скачиваний: 40

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.
background image

BC430

Lesson: Basic Data Types

When using this statement, you can use all the data types and constants that are
defined in the

zmytp

type group in the program. Several type groups can be

used in a program.

2006/Q2

© 2007 SAP AG. All rights reserved.

23


background image

Unit 2: Data objects in the ABAP Dictionary

BC430

24

© 2007 SAP AG. All rights reserved.

2006/Q2


background image

BC430

Lesson: Basic Data Types

Exercise 1: Basic Data Types

Exercise Objectives

After completing this exercise, you will be able to:

Create basic data types in the Dictionary and use them in ABAP programs

Business Example

For your development project, you should create several global data types to
which the other project members have access.

Task 1:

Create two domains, so that you can use them later in data elements.

1.

Call transaction SE11.

2.

Create a

domain

with the name

ZDO_10NUM_##

in the initial screen of

the ABAP Dictionary.

3.

The domain should be created for data elements that should take on 10-digit
decimal numbers. From these 10 digits, 2 should be reserved for the decimal
places. The data elements should also be able to be used for business
calculations.

4.

Save (as

local object

) and activate the domain.

5.

In the initial screen of the ABAP Dictionary, create a domain with the name

ZDO_30CHAR_##

. The domain should be able to hold 30 text characters

and, in the entry fields, the entry of lower-case letters should be permitted.

6.

Save (as

local object

) and activate the domain.

Task 2:

Create several data elements and use the already defined domains for the technical
properties.

1.

Call transaction SE11.

2.

Enter a data element (

ZLASTNAME##

) for the surname of a person and

use a suitable domain. The data element should be able to hold 30 letters in
upper and lower case.

3.

Enter a data element (

ZFIRSTNAME##

) for the first name of a person and

use a suitable domain. The data element should be able to hold 30 letters in
upper and lower case.

Continued on next page

2006/Q2

© 2007 SAP AG. All rights reserved.

25


background image

Unit 2: Data objects in the ABAP Dictionary

BC430

4.

Create a data element (

ZASSETS##

) for assets and use a suitable domain.

The data element should be used for business calculations.

5.

Create a data element (

ZLIABILITIES##

) for liabilities and use a suitable

domain. The data element should be used for business calculations.

Task 3:

Create a program

1.

Create the executable program

ZBC430_##_DATA_ELEMENTS

without

“TOP Include”.

2.

Create the following entry fields in the program with the ABAP command

PARAMETERS

.

Parameter

Data Type

pa_fname

ZFIRSTNAME##

pa_lname

ZLASTNAME##

pa_activ

ZASSETS##

pa_liabs

ZLIABILITIES##

Calculate assets minus liabilities and output all parameters as well as the
calculation results in a list.

3.

Execute the program and enter the different values in the selection screen,
which you output in a list.

26

© 2007 SAP AG. All rights reserved.

2006/Q2


background image

BC430

Lesson: Basic Data Types

Solution 1: Basic Data Types

Task 1:

Create two domains, so that you can use them later in data elements.

1.

Call transaction SE11.

a)

In the SAP EASY ACCESS menu,enter

se11

in the command field and

confirm your entry

If you are in another transaction, you have to enter

/n se11

in the

command field and confirm the entry

2.

Create a

domain

with the name

ZDO_10NUM_##

in the initial screen of

the ABAP Dictionary.

a)

Select the

Domain

radio button.

b)

Enter the name of the domain in the input field.

c)

Press the

Create

button

3.

The domain should be created for data elements that should take on 10-digit
decimal numbers. From these 10 digits, 2 should be reserved for the decimal
places. The data elements should also be able to be used for business
calculations.

a)

Enter a meaningful description for the domain in the

short description

field.

b)

In the

Data type

field, enter the value

DEC

or select this entry from

the input help (F4).

c)

In the

No. Characters

field, enter the value

10

d)

In the

Decimal Places

field, enter the value

2

e)

Select the

+/- sign

check box

4.

Save (as

local object

) and activate the domain.

a)

Click on

Save

at the top of the screen.

5.

In the initial screen of the ABAP Dictionary, create a domain with the name

ZDO_30CHAR_##

. The domain should be able to hold 30 text characters

and, in the entry fields, the entry of lower-case letters should be permitted.

a)

Proceed as in the previous steps and define the corresponding properties
in the

Definition

tab page

6.

Save (as

local object

) and activate the domain.

a)

Click on

Save

at the top of the screen.

Continued on next page

2006/Q2

© 2007 SAP AG. All rights reserved.

27