SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Порядок колонок в alv



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
nebo
Участник
Участник



Joined: 29 Dec 2007
Posts: 31

PostPosted: Tue May 13, 2008 3:28 pm    Post subject: Порядок колонок в alv Reply with quote

Здравствуйте!
Нужно изменить порядок следования колонок в 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
View user's profile Send private message
Armann
Модератор
Модератор



Joined: 01 Jan 2008
Posts: 422
Location: Moscow

PostPosted: Tue May 13, 2008 3:33 pm    Post subject: Reply with quote

Это вам нужно порядок в описании field catalog'a менять
Back to top
View user's profile Send private message Blog
nebo
Участник
Участник



Joined: 29 Dec 2007
Posts: 31

PostPosted: Tue May 13, 2008 4:48 pm    Post subject: Reply with quote

Пробовал fieldcatalog строить по первому и второму варианту, как в первом сообщении написано. Результат одинаковый.
Back to top
View user's profile Send private message
Alex80
Старший специалист
Старший специалист


Age: 43
Joined: 24 Jan 2008
Posts: 129

PostPosted: Tue May 13, 2008 5:10 pm    Post subject: Reply with quote

Поле 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
View user's profile Send private message
nebo
Участник
Участник



Joined: 29 Dec 2007
Posts: 31

PostPosted: Tue May 13, 2008 5:27 pm    Post subject: Reply with quote

Вот оно ключевое слово
gs_fieldcat-col_pos = 1.

спасибо!
Back to top
View user's profile Send private message
Alex80
Старший специалист
Старший специалист


Age: 43
Joined: 24 Jan 2008
Posts: 129

PostPosted: Tue May 13, 2008 5:33 pm    Post subject: Reply with quote

nebo wrote:
Вот оно ключевое слово!
Ключевое слово было выше
Armann wrote:
Это вам нужно порядок в описании field catalog'a менять
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.