2007 Feb 27 8:32 AM
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.
2007 Feb 27 8:37 AM
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.
2007 Feb 27 9:17 AM
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.
2007 Feb 27 8:37 AM
https://forums.sdn.sap.com/click.jspa?searchID=1359453&messageID=2834947
award points if found helpful
2007 Feb 27 8:39 AM
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
2007 Feb 27 8:46 AM
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.
2007 Feb 27 9:06 AM
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
2007 Feb 27 9:06 AM
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
2007 Feb 27 9:28 AM
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.
2007 Feb 27 9:31 AM
2007 Feb 27 9:32 AM
I am not sure, but u can try out using write statements and then move teh same into wa_headerinfo.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |