Application Development and Automation 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: 
Read only

alv list header.

Former Member
0 Likes
985

hello.

could u pls tell me how to display quantity and currency fields in ALV list header?

thanx in advance.

regards,

Maya.

hello.

could u pls tell me how to display quantity and currency fields in ALV list header?

thanx in advance.

regards,

Maya.

10 REPLIES 10
Read only

Former Member
0 Likes
926

Display it in Top-of-page event.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_rephead.htm

Add Title(heading) to ALV Grid   

In order to insert a report heading in to the ALV grid you need to perform the following steps:
    	           1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'top-of-page' FORM
	           2. Create 'top-of-page' FORM
 

 call function 'REUSE_ALV_LIST_DISPLAY'
       exporting
            i_callback_program      = gd_repid
            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            i_save                  = 'X'
       tables
            t_outtab                = it_ekko
       exceptions
            program_error           = 1
            others                  = 2.


*-------------------------------------------------------------------*
* Form  TOP-OF-PAGE                                                 *
*-------------------------------------------------------------------*
* ALV Report Header                                                 *
*-------------------------------------------------------------------*
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
      wa_header type slis_listheader,
      t_line like wa_header-info,
      ld_lines type i,
      ld_linesc(10) type c.

* Title
  wa_header-typ  = 'H'.
  wa_header-info = 'EKKO Table Report'.
  append wa_header to t_header.
  clear wa_header.

* Date
  wa_header-typ  = 'S'.
  wa_header-key = 'Date: '.
  CONCATENATE  sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) INTO wa_header-info.   "todays date
  append wa_header to t_header.
  clear: wa_header.

* Total No. of Records Selected
  describe table it_ekko lines ld_lines.
  ld_linesc = ld_lines.
  concatenate 'Total No. of Records Selected: ' ld_linesc
                    into t_line separated by space.
  wa_header-typ  = 'A'.
  wa_header-info = t_line.
  append wa_header to t_header.
  clear: wa_header, t_line.

  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
            it_list_commentary = t_header.
*            i_logo             = 'Z_LOGO'.
endform.

Read only

0 Likes
926

MSEG-LBKUM

Quantity.

DATA: v_lbkum(16) TYPE c.
 v_lbkum = itab-lbkum.
  wa_header-typ  = 'S'.
  wa_header-key = 'Total valuated stock before the posting: '.
  wa_header-info = v_lbkum.   "Quantity 
  append wa_header to t_header.
  clear: wa_header.

Hope this will solve ur problem.

In my code just replace this and try.

Reward if this helps.

Read only

rahulkavuri
Active Contributor
0 Likes
926
Read only

Former Member
0 Likes
926

DATA : ILISTHEADER TYPE SLIS_T_LISTHEADER,

WLISTHEADER TYPE SLIS_LISTHEADER.

DATA : QTY(13),

CURR(15).

QTY = MSEG-MENGE.

CURR = KOMV-BWTAR.

CONCATENATE QTY CURR INTO WLISTHEADER-INFO.

WLISTHEADER-TYP = 'H'.

NOW PASS IT TO ALV COMMENTARY WRTIE FM.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
926

THANK U....

BUT I WANT TO DISPLAY QUANTITY FIELD(MSEG-LBKUM) IN THE HEADER..

IF I TRY TO DO SO...ITS DISPLAYING THE FOLLOWING ERROR...

"ITAB-LBKUM" MUST BE CHARACTER-TYPE DATA OBJECT..

REGARDS,

MAYA.

Read only

0 Likes
926

Hello Maya,

What u can do is:


data: lv_menge(13).
loop at itab.
lv_menge = itab-lbkum.
  WA_COMMENTARY-TYP  = 'H'.
  WA_COMMENTARY-INFO = LV_MENGE.
  APPEND WA_COMMENTARY TO IT_COMMENTARY.
endloop.

Vasanth

Read only

0 Likes
926

u need to move LKBUM to a character type field (C, N, D, T, STRING) and then use it for display

otherwise may be its not possible

Read only

Former Member
0 Likes
926

THANK U VERY MUCH.... I GOT IT...

BUT I HAVE ONE MORE QUESTION....

AM USING ALV LIST....I CAN COLOR ALV LIST HEADER...BUT I WANT TO COLOR ONLY ONE LINE OUT OF 4 IN THE HEADER..IS THAT POSSIBLE?

PLS HELP ME...

REGARDS,

MAYA.

Read only

0 Likes
926

Hello,

Not possible, sorry.

If u want to check. See this thread.

If useful reward.

Vasanth

Read only

0 Likes
926

I am not sure, but u can try out using write statements and then move teh same into wa_headerinfo.