Коллеги, почему падает в дамп такой код. xtable не пустая.
Code:
TYPES: BEGIN OF xtable_type,
ebeln TYPE ekko-ebeln,
ebelp TYPE ekpo-ebelp,
ekorg TYPE ekko-ekorg,
bukrs TYPE ekko-bukrs,
zekkn TYPE ekkn-zekkn.
TYPES: END OF xtable_type.
DATA: xtable TYPE xtable_type OCCURS 0
WITH HEADER LINE.
DATA: str_order TYPE string
str_order = 'ebeln ebelp'.
SORT xtable BY (str_order).
Описание падения
Quote:
Error analysis
The current ABAP program "Zxxx " tried to process the internal
table
"XTABLE[]" with "SORT".
The component "ebeln ebelp" was specified dynamically as the contents of the
field "STR_ORDER".
One of the following errors occurred:
- The line type "XTABLE_TYPE" of the internal table "XTABLE[]" does not
contain a component "ebeln ebelp".
- "ebeln ebelp" contained a specification in the form "A->B" to signify
dynamic access to an object attribute.
This is currently only allowed statically.
- "ebeln ebelp" contained an invalid offset or length specification
(for example, you may have tried to access part of a field with
type I or STRING).
- "ebeln ebelp" contained significant trailing spaces
(only possible with type STRING).
TYPES: BEGIN OF xtable_type,
ebeln TYPE ekko-ebeln,
ebelp TYPE ekpo-ebelp,
ekorg TYPE ekko-ekorg,
bukrs TYPE ekko-bukrs,
zekkn TYPE ekkn-zekkn.
TYPES: END OF xtable_type.
DATA: xtable TYPE xtable_type OCCURS 0
WITH HEADER LINE.
DATA: lt_sort TYPE abap_sortorder_tab,
ls_sort TYPE abap_sortorder.
ls_sort-name = 'EBELN'.
APPEND ls_sort TO lt_sort.
ls_sort-name = 'EBELP'.
APPEND ls_sort TO lt_sort.
SORT xtable BY (lt_sort).
July7, что это за типы abap_sortorder_tab, abap_sortorder?
в моей системе их нет.
Когда заменил на
DATA: lt_sort TYPE TABLE OF LINE72,
ls_sort TYPE LINE72.
ругается на синтаксис
"LT_SORT" must be a character data object (data type C, N, D, T or STRING). field string).
With the addition BY (otab), the table is not sorted according to the table key, but instead according to the component specified dynamically in the internal table otab as of release 7.0).
...
For otab, a standard table of the table type ABAP_SORTORDER_TAB from the ABAP Dictionary must be specified.
поэтому код, приведенный Armann, не компилируется в 7.0
Создал пример в 4.7:
Code:
REPORT zz_sort .
TYPES: BEGIN OF xtable_type,
ebeln TYPE ekko-ebeln,
ebelp TYPE ekpo-ebelp,
ekorg TYPE ekko-ekorg,
bukrs TYPE ekko-bukrs,
zekkn TYPE ekkn-zekkn.
TYPES: END OF xtable_type.
DATA: xtable TYPE xtable_type OCCURS 0
WITH HEADER LINE.
DATA: str_order(72) TYPE c OCCURS 2 WITH HEADER LINE.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.