Текущее время: Вс, июл 20 2025, 17:50

Часовой пояс: UTC + 3 часа


Правила форума


ВНИМАНИЕ!

Вопросы по SAP Query и Quick View - сюда



Начать новую тему Ответить на тему  [ Сообщений: 4 ] 
Автор Сообщение
 Заголовок сообщения: Append структура
СообщениеДобавлено: Вт, май 14 2013, 08:07 
Начинающий
Начинающий

Зарегистрирован:
Пт, апр 27 2012, 18:38
Сообщения: 2
Саповцы,люди добрые выручайте!)) Помогите кто-нибудт с описанием append структуры. Весь интернет облазил,ничего натйи не могу. Очень нужно ))))


Принять этот ответ
Вернуться к началу
 Профиль Отправить email  
 
 Заголовок сообщения: Re: Append структура
СообщениеДобавлено: Вт, май 14 2013, 09:54 
Специалист
Специалист
Аватара пользователя

Зарегистрирован:
Сб, июн 23 2007, 14:56
Сообщения: 203
Syntax
APPEND line_spec TO itab [SORTED BY comp] [result].

Effect
This statement appends one or more rows line_spec to an internal index table itab. If itab is a standard table, you can use SORTED BY to sort the table in a specified way. Use result when appending a single row as of release 6.10 to set a reference to the appended row in the form of a field symbol or a data reference.

For the individual table types, appending is done as follows:

To standard tables, rows are appended directly and without checking the content of the internal table.

To sorted tables, rows are appended only if they correspond to the sort sequence and do not create duplicate entries with unique table key. Otherwise, an untreatable exception is triggered.

To hashed tables, no rows can be appended.

The APPEND statement sets sy-tabix to the table index of the last appended row.



Addition
... SORTED BY comp


Effect
This addition is allowed only if you specify a workarea wa and if you use a standard table, where wa must be compatible to the row type of the table. You can specify component comp as shown in section Specifying Components, however, you can access only one single component and no attributes of classes using the object component selector.

The statement is executed in two steps:

Starting at the last row, the table is searched for a row, in which the value of component comp is greater than or equal to the value of component comp of wa. If such a row exists, the workarea wa is included after this row. If no such row exists, the workarea wa is included before the first row. The table index of all rows following the included rows increases by one.


If the number of rows before the statement is executed is greater than or equal to the number specified in the definition of the internal table in the INITIAL SIZE addition, the newly-created last row is deleted.



Note
When using only the statement APPEND with addition SORTED BY to fill an internal table, this rule results in an internal table that contains no more than the number of rows specified in its definition after INITIAL SIZE and that is sorted in descending order by component comp (ranking).

The SORT statement should usually be used instead of APPEND SORTED BY.

Example
Creating a ranking of the three flights of a connection showing the most free seats.

PARAMETERS: p_carrid TYPE sflight-carrid,
p_connid TYPE sflight-connid.

DATA: BEGIN OF seats,
fldate TYPE sflight-fldate,
seatsocc TYPE sflight-seatsocc,
seatsmax TYPE sflight-seatsmax,
seatsfree TYPE sflight-seatsocc,
END OF seats.

DATA seats_tab LIKE STANDARD TABLE OF seats
INITIAL SIZE 3.

SELECT fldate seatsocc seatsmax
FROM sflight
INTO seats
WHERE carrid = p_carrid AND
connid = p_connid.
seats-seatsfree = seats-seatsmax - seats-seatsocc.
APPEND seats TO seats_tab SORTED BY seatsfree.
ENDSELECT.


Принять этот ответ
Вернуться к началу
 Профиль  
 
 Заголовок сообщения: Re: Append структура
СообщениеДобавлено: Вт, май 14 2013, 10:29 
Старший специалист
Старший специалист

Зарегистрирован:
Чт, май 12 2011, 16:06
Сообщения: 351
Информация об append-структурах есть в курсе bc425. Если интересует, как создать: se11 -- Просмотр -- кнопка "Append structure".


Принять этот ответ
Вернуться к началу
 Профиль  
 
 Заголовок сообщения: Re: Append структура
СообщениеДобавлено: Вт, май 14 2013, 13:21 
Начинающий
Начинающий

Зарегистрирован:
Пт, апр 27 2012, 18:38
Сообщения: 2
Благодарю за помощь!))


Принять этот ответ
Вернуться к началу
 Профиль Отправить email  
 
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 4 ] 

Часовой пояс: UTC + 3 часа


Кто сейчас на конференции

Сейчас этот форум просматривают: Yandex [Bot]


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Русская поддержка phpBB