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 LIST. Неверный формат вывода.



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



Joined: 14 Jan 2010
Posts: 18

PostPosted: Tue Jan 19, 2010 6:44 pm    Post subject: ALV LIST. Неверный формат вывода. Reply with quote

Доброго времени суток.
Разбираясь с ALV решил попробывать написать простенькую программу.

Вот собственно она:

Code:

REPORT ZNNNN NO STANDARD PAGE HEADING
                       MESSAGE-ID 00
                       LINE-SIZE 200.


***********************************************************************
* TYPES
***********************************************************************
TYPE-POOLS: SLIS.


***********************************************************************
* DATA AND TABLES
***********************************************************************
TABLES: ZMYTABLE.

DATA: T_TAB LIKE ZMYTABLE OCCURS 0 WITH HEADER LINE.

DATA: T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
      T_EVENT    TYPE SLIS_T_EVENT WITH HEADER LINE,
      WA_LAYOUT  TYPE SLIS_LAYOUT_ALV,
      WA_COLORS  TYPE SLIS_COLTYPES.

DATA: W_SY_REPID LIKE SY-REPID,
      W_SY_PAGNO LIKE SY-PAGNO.
***********************************************************************
* INITIALIZATION
***********************************************************************
INITIALIZATION.
  SELECT * FROM ZMYTABLE
           INTO T_TAB.
  APPEND T_TAB.
  ENDSELECT.

  W_SY_REPID = SY-REPID.
  W_SY_PAGNO = SY-PAGNO.
  CLEAR T_FIELDCAT[].
***********************************************************************
* START OF SELECTION
***********************************************************************
START-OF-SELECTION.
  T_FIELDCAT-TABNAME = 'T_TAB'.
  T_FIELDCAT-FIELDNAME = 'MANDT'.
  T_FIELDCAT-SELTEXT_S = 'MANDANT'.
  T_FIELDCAT-SELTEXT_M = 'MANDANT'.
  T_FIELDCAT-SELTEXT_L = 'MANDANT'.
*  T_FIELDCAT-KEY = 'X'.
  APPEND T_FIELDCAT.

  T_FIELDCAT-TABNAME = 'T_TAB'.
  T_FIELDCAT-FIELDNAME = 'MATNR'.
  T_FIELDCAT-SELTEXT_S = 'MATERIAL'.
  T_FIELDCAT-SELTEXT_M = 'MATERIAL'.
  T_FIELDCAT-SELTEXT_L = 'MATERIAL'.
*  T_FIELDCAT-KEY = 'X'.
  APPEND T_FIELDCAT.

  T_FIELDCAT-TABNAME = 'T_TAB'.
  T_FIELDCAT-FIELDNAME = 'ID'.
  T_FIELDCAT-SELTEXT_S = 'ID'.
  T_FIELDCAT-SELTEXT_M = 'ID'.
  T_FIELDCAT-SELTEXT_L = 'ID'.
*  T_FIELDCAT-KEY = 'X'.
  APPEND T_FIELDCAT.

  T_FIELDCAT-TABNAME = 'T_TAB'.
  T_FIELDCAT-FIELDNAME = 'TELEPHONE'.
  T_FIELDCAT-SELTEXT_S = 'TELEPHONE'.
  T_FIELDCAT-SELTEXT_M = 'TELEPHONE'.
  T_FIELDCAT-SELTEXT_L = 'TELEPHONE'.
*  T_FIELDCAT-KEY = 'X'.
  APPEND T_FIELDCAT.

  WA_LAYOUT-ZEBRA = 'X'.
  WA_LAYOUT-WINDOW_TITLEBAR = 'ALV LIST'.
  WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
  WA_LAYOUT-detail_titlebar = 'A'.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      I_PROGRAM_NAME = W_SY_REPID
      I_INTERNAL_TABNAME = 'T_TAB'
      I_INCLNAME = W_SY_REPID
      I_CLIENT_NEVER_DISPLAY = 'B'
    CHANGING
      CT_FIELDCAT = T_FIELDCAT[].

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = W_SY_REPID
      I_STRUCTURE_NAME   = 'T_TAB'
      IS_LAUOUT          = WA_LAYOUT
      IT_FIELDCAT        = T_FIELDCAT[]
    TABLES
      T_OUTTAB           = T_TAB.

END-OF-SELECTION.


Меня интересует момент:
Code:

  WA_LAYOUT-ZEBRA = 'X'.
  WA_LAYOUT-WINDOW_TITLEBAR = 'ALV LIST'.
  WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
  WA_LAYOUT-detail_titlebar = 'A'.

Вроде бы я заполнил эту структуру правильно. Однако при выводе
заданные параметры не учитываются. В чем ошибка?
Back to top
View user's profile Send private message
Roronoa Zoro
Участник
Участник



Joined: 14 Jan 2010
Posts: 18

PostPosted: Tue Jan 19, 2010 6:50 pm    Post subject: Reply with quote

Всё. Только что решил.
Ошибка в невнимательности.
Вместо LAYOUT написал LAUOUT.
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.