cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple lines in ALV Header

Former Member
0 Kudos

Hi all,

We have an ALV header that it is being created with the function función 'REUSE_ALV_COMMENTARY_WRITE'.

Our problem is that we are inserting such many lines in the header, that the ALV main is dissapearing, so we have to drag the screen line with the mouse in order to scroll the header and show the ALV main.

Is there any way to auto scroll the header? Can I fix the position where the ALV main is going to be printed?

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks for the help.

Is this only possible with ABAP OOP?

former_member188685
Active Contributor
0 Kudos

You can do this using the FM also...

/people/community.user/blog/2007/05/07/alignment-of-data-in-top-of-page-in-alv-grid

Try this

Answers (6)

Answers (6)

Former Member
0 Kudos

Hello Venkat.O, thanks for your help, but I am still getting the same result:

[http://www.fileshost.com/en/file/43522/1-GIF.html]

former_member188685
Active Contributor
0 Kudos

You can use the CL_DD_DOCUMENT Class to Design the TOP_OF_PAGE

Check this Blog.

/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid

Former Member
0 Kudos

Please, help.

venkat_o
Active Contributor
0 Kudos

Hi George,

You can do it like that .

While building fieldcatalog, you can fix it row where column headers should be by specifying row.

w_fieldcat-row_pos       = 5.
w_fieldcat-col_pos       = 1.
w_fieldcat-fieldname     = 'VBELN'.
w_fieldcat-tabname       = 'I_VBAK'.
w_fieldcat-seltext_m     = 'Sales Document'.
append w_fieldcat to i_fieldcat.
clear   w_fieldcat.

Try that .

Thanks,

venkat.O

Former Member
0 Kudos

Thanks for quick questions, but I am already using the type 'S'.

lw_line-typ = 'H'.

lw_line-info = text-074.

APPEND lw_line TO lti_list_commentary.

CLEAR lw_line.

CLEAR lw_ename.

LOOP 100 times INTO lw_ename.

lv_pernr = lw_ename-pernr.

SHIFT lv_pernr LEFT DELETING LEADING '0'.

lw_line-typ = 'S'.

CONCATENATE lv_pernr ename INTO lw_line-info SEPARATED

BY space.

APPEND lw_line TO lti_list_commentary.

CLEAR lw_line.

CLEAR lw_ename.

ENDLOOP.

CALL FUNCTION gc_alv_reuse_commentary

EXPORTING

i_logo = text-080

it_list_commentary = lti_list_commentary.

My problem is that the header is taking all the screen, and in order to show the ALV table, I need to resize the screen with the mouse.

( Draging the line screen at the bottom by myself).

Any other help please?

Former Member
0 Kudos

hi check this report ....

REPORT ZTEST_ALV123.

TABLES VBAK.

TYPE-POOLS SLIS.

TYPES: BEGIN OF T_VBAK,

VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT,

ERNAM TYPE VBAK-ERNAM,

AUDAT TYPE VBAK-AUDAT,

VBTYP TYPE VBAK-VBTYP,

NETWR TYPE VBAK-NETWR,

VKORG TYPE VBAK-VKORG,

VKGRP TYPE VBAK-VKGRP,

END OF T_VBAK.

DATA IT_VBAK TYPE STANDARD TABLE OF T_VBAK INITIAL SIZE 0.

DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV,

W_FLDCAT TYPE SLIS_FIELDCAT_ALV,

GD_LAYOUT TYPE SLIS_LAYOUT_ALV,

GD_REPID TYPE SY-REPID.

START-OF-SELECTION.

PERFORM DATA_RETRIEVAL.

PERFORM BLD_FLDCAT.

PERFORM BLD_LAYOUT.

PERFORM DISPLAY_ALV_REPORT.

FORM BLD_FLDCAT.

W_FLDCAT-FIELDNAME = 'VBELN'.

W_FLDCAT-SELTEXT_M = 'Sales Document'.

W_FLDCAT-COL_POS = 0.

*W_FLDCAT-EMPHASIZE = 'C411'.

W_FLDCAT-OUTPUTLEN = 20.

W_FLDCAT-KEY = 'X'.

W_FLDCAT-ICON = 'X'.

APPEND W_FLDCAT TO FLDCAT.

CLEAR W_FLDCAT.

W_FLDCAT-FIELDNAME = 'ERDAT'.

W_FLDCAT-SELTEXT_L = 'Record Date created'.

W_FLDCAT-COL_POS = 1.

W_FLDCAT-KEY = 'X'.

APPEND W_FLDCAT TO FLDCAT.

CLEAR W_FLDCAT.

W_FLDCAT-FIELDNAME = 'ERNAM'.

W_FLDCAT-SELTEXT_L = 'Cteated Object Person Name'.

APPEND W_FLDCAT TO FLDCAT.

CLEAR W_FLDCAT.

W_FLDCAT-FIELDNAME = 'AUDAT'.

W_FLDCAT-SELTEXT_M = 'Document Date'.

W_FLDCAT-COL_POS = 3.

W_FLDCAT-EMPHASIZE = 'C110'.

APPEND W_FLDCAT TO FLDCAT.

CLEAR W_FLDCAT.

W_FLDCAT-FIELDNAME = 'VBTYP'.

W_FLDCAT-SELTEXT_L = 'SD Document category'.

W_FLDCAT-COL_POS = 4.

APPEND W_FLDCAT TO FLDCAT.

CLEAR W_FLDCAT.

W_FLDCAT-FIELDNAME = 'NETWR'.

W_FLDCAT-SELTEXT_L = 'Net Value of the SO in Document Currency'.

W_FLDCAT-COL_POS = 5.

W_FLDCAT-OUTPUTLEN = 60.

W_FLDCAT-DO_SUM = 'X'.

W_FLDCAT-DATATYPE = 'CURR'.

APPEND W_FLDCAT TO FLDCAT.

CLEAR W_FLDCAT.

W_FLDCAT-FIELDNAME = 'VKORG'.

W_FLDCAT-SELTEXT_L = 'Sales Organization'.

W_FLDCAT-COL_POS = 6.

APPEND W_FLDCAT TO FLDCAT.

CLEAR W_FLDCAT.

W_FLDCAT-FIELDNAME = 'VKGRP'.

W_FLDCAT-SELTEXT_M = 'Sales Group'.

W_FLDCAT-COL_POS = 7.

W_FLDCAT-EMPHASIZE = 'C801'.

APPEND W_FLDCAT TO FLDCAT.

CLEAR W_FLDCAT.

ENDFORM.

FORM BLD_LAYOUT.

GD_LAYOUT-NO_INPUT = 'X'.

GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

GD_LAYOUT-BOX_FIELDNAME = 'VBELN'.

ENDFORM.

FORM DISPLAY_ALV_REPORT.

GD_REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = GD_REPID

IS_LAYOUT = GD_LAYOUT

I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

IT_FIELDCAT = FLDCAT[]

I_SAVE = 'X'

I_GRID_TITLE = 'WELCOME TO ALV'

TABLES

T_OUTTAB = IT_VBAK

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC ne 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM.

FORM DATA_RETRIEVAL.

SELECT VBELN ERDAT ERNAM AUDAT VBTYP NETWR VKORG

UP TO 50 ROWS

FROM VBAK

INTO TABLE IT_VBAK.

ENDFORM.

FORM TOP_OF_PAGE.

DATA: T_HEADER TYPE SLIS_T_LISTHEADER,

W_HEADER TYPE SLIS_LISTHEADER.

W_HEADER-TYP = 'H'.

W_HEADER-INFO = 'WELCOME HEADER LIST'.

APPEND W_HEADER TO T_HEADER.

W_HEADER-TYP = 'S'.

W_HEADER-KEY = 'REPORT:'.

W_HEADER-INFO = SY-REPID.

APPEND W_HEADER TO T_HEADER.

W_HEADER-TYP = 'S'.

W_HEADER-KEY = 'DATE:'.

CONCATENATE SY-DATUM4(2) ' / ' SY-DATUM6(2) ' / ' SY-DATUM(4) INTO W_HEADER-INFO.

APPEND W_HEADER TO T_HEADER.

CLEAR W_HEADER.

W_HEADER-TYP = 'S'.

W_HEADER-KEY = 'Page No:'.

W_HEADER-INFO = SY-PAGNO.

APPEND W_HEADER TO T_HEADER.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = T_HEADER.

ENDFORM.

regards,

venkat.

dhruv_shah3
Active Contributor
0 Kudos

Hi,

You have to write the Text in the Single Line...as and when the screen size increases the scroll bar will automatically appear..

Also, there is type H,A,S you have to give it as H.

HTH

Regards,

Dhruv Shah

Former Member
0 Kudos

Hi,

Did you try with slis_listheader-type eq 'H'.

Regards,

RSS.