View previous topic :: View next topic
Author
Message
nebo Участник Joined: 29 Dec 2007 Posts: 31
Posted: Tue May 13, 2008 3:28 pm Post subject: Порядок колонок в alv
Здравствуйте!
Нужно изменить порядок следования колонок в alv -
3 сделать 1
data : begin of gtab occurs 0,
col1 like ze_tab-col1,
col2 like ze_tab-col2,
col3 like ze_tab-col3,
end of gtab.
Пробовал переставлять поля при описании таблицы, результат тот-же.
data : begin of gtab occurs 0,
col3 like ze_tab-col3,
col1 like ze_tab-col1,
col2 like ze_tab-col2,
end of gtab.
Back to top
Armann Модератор Joined: 01 Jan 2008 Posts: 422 Location: Moscow
Posted: Tue May 13, 2008 3:33 pm Post subject:
Это вам нужно порядок в описании field catalog'a менять
Back to top
nebo Участник Joined: 29 Dec 2007 Posts: 31
Posted: Tue May 13, 2008 4:48 pm Post subject:
Пробовал fieldcatalog строить по первому и второму варианту, как в первом сообщении написано. Результат одинаковый.
Back to top
Alex80 Старший специалист Age: 44 Joined: 24 Jan 2008 Posts: 129
Posted: Tue May 13, 2008 5:10 pm Post subject:
Поле USNAM перемещается на первую позицию.
Code: TYPE-POOLS slis.
DATA:
gt_bkpf TYPE TABLE OF bkpf,
gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_fieldcat TYPE LINE OF slis_t_fieldcat_alv.
SELECT * FROM bkpf INTO TABLE gt_bkpf
UP TO 10 ROWS.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'BKPF'
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
gs_fieldcat-col_pos = 1.
MODIFY gt_fieldcat FROM gs_fieldcat TRANSPORTING col_pos WHERE
fieldname = 'USNAM'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = gt_fieldcat
TABLES
t_outtab = gt_bkpf
EXCEPTIONS
program_error = 1
OTHERS = 2.
Back to top
nebo Участник Joined: 29 Dec 2007 Posts: 31
Posted: Tue May 13, 2008 5:27 pm Post subject:
Вот оно ключевое слово
gs_fieldcat-col_pos = 1.
спасибо!
Back to top
Alex80 Старший специалист Age: 44 Joined: 24 Jan 2008 Posts: 129
Posted: Tue May 13, 2008 5:33 pm Post subject:
nebo wrote: Вот оно ключевое слово!
Ключевое слово было выше Armann wrote: Это вам нужно порядок в описании field catalog'a менять
Back to top
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.