Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
AbapWB_content_EN.doc
Скачиваний:
1
Добавлен:
01.03.2025
Размер:
40.44 Mб
Скачать

At line-selection. Call screen 100.

281 Exercise 15: Screens: Data Transport

Exercise Duration: 30 Minutes

Exercise Objectives

After completing this exercise, you will be able to:

• Fill the screen fields with data from the program

Business Example

The screen of your program ZBC400_##_DYNPRO is to display the detailed data for the selected booking. Data changes by the user are to be available in the program after leaving the screen.

System Data

System: Will be assigned Client: Will be assigned User ID: Will be assigned Password: Will be assigned

Set up instructions: No special instructions when using a standard training system

Task 1:

Preparations

1. Extend your program ZBC400_##_DYNPRO_1 or copy the template SAPBC400UDS_DYNPRO_1 to the new name ZBC400_##_DYNPRO_2 for further processing.

2. In your program, use the TABLES statement to create a work area. This work area will serve as the screen interface. This work area must have the same name as the structure used on the screen.

3. Make sure that the key fields of the selected booking are available when the user selects a basic list row (HIDE).

Task 2:

Authorization check and data retrieval before the screen is called

1. Later, you should change your program appropriately so that the data in the database can be changed. Ensure that the screen can only be processed if the user has change authorization for the airline selected. If the user does not have the authorization, return to the basic list with message 047 of message class BC400. Message type 'S' is suitable.

Continued on next page

If the user has the authorization, read the selected posting (all fields) from database table SBOOK in your work area wa_sbook. This single access also retrieves the missing data of the booking and also ensures that current data is available for display.

2. Immediately before calling the screen, copy the relevant data from wa_sbook into the TABLES work area to have it transported to the screen automatically.

Solution 15: Screens: Data Transport

Task 1:

Preparations

1. Extend your program ZBC400_##_DYNPRO_1 or copy the template SAPBC400UDS_DYNPRO_1 to the new name ZBC400_##_DYNPRO_2 for further processing.

a) Carry out this step as usual.

2. In your program, use the TABLES statement to create a work area. This work area will serve as the screen interface. This work area must have the same name as the structure used on the screen.

a) Carry out this step as usual.

3. Make sure that the key fields of the selected booking are available when the user selects a basic list row (HIDE).

a) See source code excerpt in the model solution.

Task 2:

Authorization check and data retrieval before the screen is called

1. Later, you should change your program appropriately so that the data in the database can be changed. Ensure that the screen can only be processed if the user has change authorization for the airline selected. If the user does not have the authorization, return to the basic list with message 047 of message class BC400. Message type 'S' is suitable.

If the user has the authorization, read the selected posting (all fields) from database table SBOOK in your work area wa_sbook. This single access also retrieves the missing data of the booking and also ensures that current data is available for display.

a) See source code excerpt in the model solution.

2. Immediately before calling the screen, copy the relevant data from wa_sbook into the TABLES work area to have it transported to the screen automatically.

a) See the source code excerpt in the model solution.

Result

Source code excerpt: SAPBC400UDS_DYNPRO_2

REPORT sapbc400uds_dynpro_2.

Continued on next page

CONSTANTS: actvt_display TYPE activ_auth VALUE ’03’, actvt_change TYPE activ_auth VALUE ’02’.

PARAMETERS pa_anum TYPE sbook-agencynum.

* workarea for SELECT

DATA wa_sbook TYPE sbook.

* workarea for data communication with screen

TABLES sdyn_book.

START-OF-SELECTION.

SELECT carrid connid fldate bookid

FROM sbook

INTO CORRESPONDING FIELDS OF wa_sbook

WHERE agencynum = pa_anum.

AUTHORITY-CHECK OBJECT ’S_CARRID’

ID ’CARRID’ FIELD wa_sbook-carrid

ID ’ACTVT’ FIELD actvt_display.

IF sy-subrc = 0.

WRITE: / wa_sbook-carrid COLOR col_key, wa_sbook-connid COLOR col_key, wa_sbook-fldate COLOR col_key, wa_sbook-bookid COLOR col_key.

HIDE: wa_sbook-carrid, wa_sbook-connid, wa_sbook-fldate,