Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Header(TOP-OF-PAGE) In HIERSEQ ALV

Former Member
0 Kudos

Hi Experts,

My Requirment is to develop a customer ledger in which the top of page is the detailed customer address follwed by list doc no...

please suggest me how to get the Dynamic top-of page in HIERSEQ ALV ...

Thanks in advance,

With regards,

Prakash

1 ACCEPTED SOLUTION

venkat_o
Active Contributor
0 Kudos

Hi Prakash, <li> Define table for events

DATA : IT_EVENTS   TYPE SLIS_T_EVENT,
       WA_EVENTS   TYPE SLIS_ALV_EVENT.
<li>Build events table
WA_EVENTS-NAME = 'TOP_OF_PAGE'.
  WA_EVENTS-NAME = 'TOP_OF_PAGE'.
  APPEND WA_EVENTS TO IT_EVENTS.
<li>Write call back routine for top of page. Inside you can use just normal WRITE statement to show something on top of page
*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
FORM TOP_OF_PAGE.
  WRITE 'Top of page'.
ENDFORM.                    "top_of_page
<li>Pass events table through function module
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = PROGRAM
      IT_FIELDCAT        = IT_FIELDCAT
      I_TABNAME_HEADER   = 'IT_EKKO'
      I_TABNAME_ITEM     = 'IT_EKPO'
      IT_EVENTS          = IT_EVENTS
      IS_KEYINFO         = GS_KEYINFO
    TABLES
      T_OUTTAB_HEADER    = IT_EKKO
      T_OUTTAB_ITEM      = IT_EKPO.
Thanks Venkat.O

8 REPLIES 8

Former Member
0 Kudos

use FM REUSE_ALV_COMMENTARY_WRITE in subroutine for the event TOP-OF-PAGE.

search REUSE_ALV_COMMENTARY_WRITE in forum. you will get your answer

[sample code|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/bfa9e590-0201-0010-5990-a69ad5c284e2]

0 Kudos

Hi,

I hav used this REUSE_ALV_COMMENTRY_WRITE. but it is fixed for all the pages of the output I need the Header part to changed on every page.

Regards,

Prakash

venkat_o
Active Contributor
0 Kudos

Hi Prakash, <li> Define table for events

DATA : IT_EVENTS   TYPE SLIS_T_EVENT,
       WA_EVENTS   TYPE SLIS_ALV_EVENT.
<li>Build events table
WA_EVENTS-NAME = 'TOP_OF_PAGE'.
  WA_EVENTS-NAME = 'TOP_OF_PAGE'.
  APPEND WA_EVENTS TO IT_EVENTS.
<li>Write call back routine for top of page. Inside you can use just normal WRITE statement to show something on top of page
*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
FORM TOP_OF_PAGE.
  WRITE 'Top of page'.
ENDFORM.                    "top_of_page
<li>Pass events table through function module
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = PROGRAM
      IT_FIELDCAT        = IT_FIELDCAT
      I_TABNAME_HEADER   = 'IT_EKKO'
      I_TABNAME_ITEM     = 'IT_EKPO'
      IT_EVENTS          = IT_EVENTS
      IS_KEYINFO         = GS_KEYINFO
    TABLES
      T_OUTTAB_HEADER    = IT_EKKO
      T_OUTTAB_ITEM      = IT_EKPO.
Thanks Venkat.O

Former Member
0 Kudos

Hi Venkat (),

I dont have to use the REUSE_COMMENTRY_WRITE in this report program (I didnt got any header) Plesse suggest me what to do Sir,

Regards,

Prakash

venkat_o
Active Contributor
0 Kudos

Hi Prakash,

Try this way.

<font color=blue><b><pre>REPORT ZTEST_NOTEPAD.

DATA: BEGIN OF IT_EKKO OCCURS 0,

EBELN TYPE EKKO-EBELN,

BUKRS TYPE EKKO-BUKRS,

BSTYP TYPE EKKO-BSTYP,

BSART TYPE EKKO-BSART,

END OF IT_EKKO.

DATA: BEGIN OF IT_EKPO OCCURS 0,

EBELN TYPE EKPO-EBELN,

EBELP TYPE EKPO-EBELP,

LOEKZ TYPE EKPO-LOEKZ,

TXZ01 TYPE EKPO-TXZ01,

MATNR TYPE EKPO-MATNR,

END OF IT_EKPO.

TYPE-POOLS : SLIS.

DATA : IT_EVENTS TYPE SLIS_T_EVENT,

WA_EVENTS TYPE SLIS_ALV_EVENT,

IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

WA_FIELDCAT LIKE LINE OF IT_FIELDCAT,

LIST_LAYOUT TYPE SLIS_LAYOUT_ALV,

GS_KEYINFO TYPE SLIS_KEYINFO_ALV.

DATA:PROGRAM TYPE SY-REPID.

START-OF-SELECTION.

PROGRAM = SY-REPID.

SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE IT_EKKO UP TO 100 ROWS.

IF NOT IT_EKKO[] IS INITIAL.

SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_EKPO FROM EKPO FOR ALL ENTRIES IN IT_EKKO

WHERE EBELN = IT_EKKO-EBELN.

ENDIF.

WA_EVENTS-NAME = 'TOP_OF_PAGE'.

WA_EVENTS-FORM = 'TOP_OF_PAGE'.

APPEND WA_EVENTS TO IT_EVENTS.

GS_KEYINFO-HEADER01 = 'EBELN'.

GS_KEYINFO-ITEM01 = 'EBELN'.

DEFINE FIELDCATALOG.

WA_FIELDCAT-COL_POS = &1.

WA_FIELDCAT-FIELDNAME = &2.

WA_FIELDCAT-TABNAME = &3.

WA_FIELDCAT-SELTEXT_M = &4.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

END-OF-DEFINITION.

FIELDCATALOG: '1' 'EBELN' 'IT_EKKO' 'EKKO-EBELN',

'2' 'BUKRS' 'IT_EKKO' 'EKKO-BUKRS',

'3' 'BSTYP' 'IT_EKKO' 'EKKO-BSTYP',

'4' 'BSART' 'IT_EKKO' 'EKKO-BSART'.

FIELDCATALOG: '1' 'EBELN' 'IT_EKPO' 'EKPO-EBELN',

'2' 'EBELP' 'IT_EKPO' 'EKPO-EBELP',

'3' 'LOEKZ' 'IT_EKPO' 'EKPO-LOEKZ',

'4' 'TXZ01' 'IT_EKPO' 'EKPO-TXZ01',

'5' 'MATNR' 'IT_EKPO' 'EKPO-MATNR'.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = PROGRAM

IT_FIELDCAT = IT_FIELDCAT

I_TABNAME_HEADER = 'IT_EKKO'

I_TABNAME_ITEM = 'IT_EKPO'

IT_EVENTS = IT_EVENTS

IS_KEYINFO = GS_KEYINFO

TABLES

T_OUTTAB_HEADER = IT_EKKO

T_OUTTAB_ITEM = IT_EKPO.

&----


*& Form TOP-OF-page

&----


FORM TOP_OF_PAGE.

WRITE: SY-TITLE,

/ SY-REPID.

WRITE: SY-DATUM, SY-UZEIT.

WRITE sy-uline.

ENDFORM. "TOP-OF-page</pre></b></font>

Thanks

Venkat.O

Former Member
0 Kudos

Hi Venkat O,

I tried both the ways Sir, my problem is to make the Header Part Dynammic

WRITE: SY-TITLE,

/ SY-REPID.

WRITE: SY-DATUM, SY-UZEIT.

WRITE sy-uline.

I want this part to tb customer Addres which has to be changed on ever page.

Please suggest me how to make the header Dynammic .

Regards,

Prakash

Former Member
0 Kudos

in alv`s you can display only top-of-list and end-of-page only

but you cant display top-of-page and end-of-list.if you want you can try. if you use top-of-list the output is same as top-of-page

Former Member
0 Kudos

Hi,

use the object oriented method for the req.. use the class cl_salv_hierseq_table..

https://wiki.sdn.sap.com/wiki/display/Snippets/Hierarical+ALV

https://wiki.sdn.sap.com/wiki/display/Snippets/displaysimplehirarchiallistwithclass+cl_salv_hierseq_table

Regards,

Deeba