Alv heading to display in excel
Hi
i have a problem ,
i want 2 take print of body of alv with ALV header.
while printing , only body is comin for print-out, not a header.
guide me.
points vil be rewarded
write the header under the event top-fo-page and use listheader structure and also use FM ALV_commentary _write
see following code for example
http://sapprograms.blogspot.com/2008/04/alv-grid-display-report.html
Similar Messages
-
Regarding ALV Header to display at Right side of Header
Hi dudes..
How to handle ALV header to print content at right side of the report out-put.
If we use ALV_list dispaly line size ends to 80 and Other than
using OOP's is there any way to do this..
Could You please let me know.How to handle this issue??
Regards,
SgHi,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZALV_PRDS'
i_callback_user_command = 'USER_COMMAND'
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE' "for header alignment
it_fieldcat = t_fcat
i_save = 'A'
it_events = t_eve
TABLES
t_outtab = itab
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
DATA: text TYPE sdydo_text_element.
CALL METHOD document->add_gap
EXPORTING
width = 200.
text = 'Material Information'.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'HEADING'.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
ENDFORM. "HTML_TOP_OF_PAGE
For more details, refer to the methods of the class cl_dd_document
Also check the below link.
https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&pageid=37566
Also this link
Report header using ALV Grid(oops)
Please reward points if it helps
Thanks
Vikranth -
ALV Grid to display in Excel Format
Hi All,
When I am executing the report RFBILA00 in ALV grid and I want to display it in EXCEL. I could not able to do.
I have selected various options like selecting Views---Excel, but the excel sheet is opened but the values are not been displayed.
Can any one suggest any other way.
Thanks,
SriniHi,
it may sound a bit silly, but I have tried to replicate what you did, and managed to get a simple download.
- run RFBILA00, selet ALV gid control for list output
- wait for the report to appear on the screen
- go to the "List" option (upper left row)
- from the drop-down menu of the "List" option select "Export" and the "Spreadsheet"
- the system flags in information box, confirm this message
- after confirmation the system flags another information box, "Export list to XXL", select the "Table" option and confirm
- after confirmation wait for the next information box, confirm that you want "Microsoft Excel"
- wait a few seconds for the system to populate the upcoming spreadsheet
- save a copy of the spreadsheet in .xls-format.
Instead of spreadsheet you may want to consider to "Save to Local File" and then convert to spreadsheet format within "Excel" itself.
Hope this helps.
Kind regards,
Rudolf -
hi i need to display my header of alv in colour format...
can u tell me function module what is used for this requirement.....
advance thanks ........................urgentHi Dasr,
What do you mean by header of ALV? Do you mean column header or a box where we can write our own text?
Regards,
kiran i -
ALV header cannot display fully as assigned in fieldcatolog
Hi,
my ALV output has nearly 100 columns. i assign the fieldcatlog as below.
CLEAR ls_fcat.
ls_fcat-fieldname = 'ANSWER01' .
ls_fcat-scrtext_l = text-011 .
APPEND ls_fcat TO gt_fieldcat.
in sap the field 'ls_fcat-scrtext_l' is 40 char length. and some text-XXX has length less than 40 char but still not display fully in the ALV output screen .
i also assign the layout as ' gs_layout-cwidth_opt = 'X' '.
how to resolve the bug ?give this also...
fieldcat-ddictxt = 'L' "<---- L for Long, S for SHort , M for Medium
fieldcat-seltext_l = text-002.
and check . -
ALV Header getting truncated in excel
I am using the GRid Layout. but when i am downloading the output in the Excel sheet, the headers are getting truncated.
I have tried increasing the width in the FIELDCAT and also removing the coulmn-optimze option in the layout also. but still after trying the headers are getitng truncated.
Any pointers how can i download without the headers getting truncated.
ThanksRefer the code snippet:
Follow this way:
CONSTANTS : c_delim TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
data :it_excel_dwnld TYPE STANDARD TABLE OF t_zzidwnld_data ,
wa_excel_dwnld TYPE t_zzidwnld_data . .
CONCATENATE 'Physical Inventory Document'
'Item '
'Material '
'Material Description'
'Material Group'
'Plant'
'Sloc'
'Doc Date'
'Book Qty'
'Counted Qty'
'Value of Phy Inv Count'
'Standard Price'
'Difference Qty'
'ABS Qty'
'BUn'
INTO wa_excel_dwnld-line
SEPARATED BY c_delim.
APPEND wa_excel_dwnld TO it_excel_dwnld.
CLEAR: wa_excel_dwnld.
LOOP AT it_output INTO wa_output.
CONCATENATE wa_output-iblnr
wa_output-zeili
wa_output-matnr
wa_output-maktx
wa_output-matkl
wa_output-werks
wa_output-lgort
wa_output-bldat
v_buchm
v_menge
v_wrtzl
v_stprs
v_difqy
v_absqy
INTO wa_excel_dwnld-line
SEPARATED BY c_delim.
APPEND wa_excel_dwnld TO it_excel_dwnld.
ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_flname
filetype = 'ASC'
write_field_separator = '#'
TABLES
data_tab = it_excel_dwnld -
Displaying blank line in ALV header
How do I display a blank line in ALV header
For eg i want if i want the ALV header to display as follows
Document Datewise Report as of 31/10/2009
<-- BLANK LINE
Run On : 01/12/2009Hi,
Are you using 'REUSE_ALV_COMMENTARY_WRITE' for displaying the header?
If yes, then I think it is not possible. Instead, use the events table to achieve it.
Use the 'REUSE_ALV_EVENTS_GET' FM to get all possible events and then modify
the events internal table to specify the form name to handle top-of-page event.
eg.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
* EXCEPTIONS
* LIST_TYPE_WRONG = 1
* OTHERS = 2
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
FORM TOP_OF_PAGE.
* Use write statements to display the header data.
ENDFORM.
In write statement use '/' to go to new line. So to insert an empty line you can use something like
write : 'some text' / / 'some text' .
Hope this helps.
Regards,
Bhavesh. -
Truncation of Heading characters when an ALV is exported to an excel sheet
Hi All,
I am facing a problem while printing an ALV output on to an excel sheet. In the header the last characters are being truncated in the excel.
Now, I have the entire data in tb_output itab. So using REUSE_ALV*, i printed the output. Here comes the problem.
I heard about LIST_FROM_MEMORY and LIST_TO_ASCI which can solve this problem. But not much sure how to use those. Whether I need to pass my itab tb_output into any of these?
Please help me out from this problem.
Thanks a lot.
Regards,
SeenuHi!
You have 2 options:
1. Shorten your headings so that their length is LE to the fieldlength of the data they are displaying. E.g. for PO number maximum possible is 10.
2. Try using the parameter OUTPUTLEN in the field catalog. You can increase this to be equal to the length of your column heading.
Hope this helps.
Cheers! -
How to display total in ALV Header
How to display total in ALV Header?
Hi Venkey,
As far as your issue is concerned I would like to quote my perception.
Create a header internal table with title and number of records.
At the later part of your program you should have found the total number of records ,now assign it to the header internal table and print it.
For further clarification you can go check this link:
http://wiki.sdn.sap.com/wiki/display/ABAP/AddHeadertoALVreport
Thanks
P.Srikanth -
Displaying selection screen details in Alv Report output display as Header
Hi all,
May be somebody knows how I can show selected values with select-options in top_of_page using REUSE_ALV_GRID_DISPLAY.
This shoud work for all the reports and diff selection screens .
I need one dynamic process which will for display any report selection screen selected details.(Basically varient information of report).
Small example if possible, please.
Thanks in advance,
RimasHi Thiru,
Thanks for the input.
This is my exact requirement.
Hi Experts,
I would like to Display / Print Select-options selected details in ALV Header.
Ex: Say suppose here i enter kunnr as 1000
lifnr as 2000 to 4000
p_langu as 'EN'.
p_dir as 'C:\TEMP,
p_upda as 'X'
for selection screen below.
SELECTION-SCREEN :BEGIN OF BLOCK blk1 WITH FRAME TITLE text-000.
SELECT-OPTIONS : s_kunnr FOR kna1-kunnr.
SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr.
PARAMETER : p_lanuge LIKE t002-spras DEFAULT sy-langu.
PARAMETER: p_dir LIKE rlgrap-filename
DEFAULT text-003 LOWER CASE.
PARAMETERS: p_upd AS CHECKBOX DEFAULT 'X'.
I dont want to Hard code selection screen values like
DATA: header TYPE slis_t_listheader,
wa TYPE slis_listheader,
wa-typ = 'S'(093).
wa-key = s_lifnr .
wa-info = 'Vendor no".
APPEND wa TO header.
I want dynamic process for all of my selection screen values selected
hard code may be it will be fine small selection screen it will work.
Fur that i got one process to get dynamically through fm
Ex: DATA: irsparams TYPE rsparams OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = program
TABLES
selection_table = irsparams
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3.
loop at irsparams.
write : / irsparams-SELNAME.
write : / irsparams-SIGN.
write : / irsparams-OPTION.
write : / irsparams-LOW.
write : / irsparams-HIGH.
endloop.
I have done my requirement partially but i am failed to achive my full requirement.
Because
rsparams strcture is diff from slis_t_listheader.
Can any one help me for further assistence to display irsparams strcture data in alv header.
Thanks
Nag -
Leading Zeros Missing - When exporting data from ALV grid display to Excel
Hi,
Am exporting the data from ALV GRID DISPLAY to Excel sheet using standard toolbar icon 'Local file'
the leading zeros displayed in the ALV output is missing in the EXCEL sheet.
(eg) in ALV o/p - 0029.
in Excel - Only 29 is appearing.
As per the requiement i have to show the leading zeros in excel also.
Pls help on this issue.
Thanks in advance..Hi ,
Please set the property :
wa_fieldcat-lzero = 'X' .
when you are creating field catalog for display alv data .
your prob will solved .
Regards ,
Nilesh Jain -
How to Display Logo in ALV Header?
Hi
I want to display/ print my company logo image in ALV Header. Please help me how can I do this?
Thanks
Iftikhar Ali
Islamabad.Hi,
If you are already having a logo say ZLOGO .
You can use it this way .
Give TOP-OF-PAGE
call function 'REUSE_ALV_GRID_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.
And in top of page do this .
FORM top-of-page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRIT
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHE
i_logo = 'ZLOGO'
I_END_OF_LIST_GRID =
endform.
Hope this will work .
Reward if found useful.
Regards
SureshP. -
Displaying selection screen data on alv header in multiple rows and columns
Hi
Presently in my requirement , whatever the data entered in selection screen should display on alv header and item details on alv grid display.
for eg...
on alv header
customer no : 1000 to 2000 sales order no: 111
name : gff to ff sales org:
city: country:
item details below this
plz guide me how to solve this issue.
Thanks & Regards,
PradeepHi,
Check this code this may help you.
<code>
TYPE-POOLS : SLIS.
TABLES VBRK.
TYPES : BEGIN OF TY_VBRK,
VBELN TYPE VBRK-VBELN,
VKORG TYPE VBRK-VKORG,
VTWEG TYPE VBRK-VTWEG,
SPART TYPE VBRK-SPART,
FKDAT TYPE VBRK-FKDAT,
END OF TY_VBRK,
BEGIN OF TY_VBRP,
VBELN TYPE VBRP-VBELN,
POSNR TYPE VBRP-POSNR,
MATNR TYPE VBRP-MATNR,
ARKTX TYPE VBRP-ARKTX,
FKIMG TYPE VBRP-FKIMG,
NETWR TYPE VBRP-NETWR,
END OF TY_VBRP,
BEGIN OF TY_TARGET,
VBELN TYPE VBRK-VBELN,
VKORG TYPE VBRK-VKORG,
VTWEG TYPE VBRK-VTWEG,
SPART TYPE VBRK-SPART,
FKDAT TYPE VBRK-FKDAT,
POSNR TYPE VBRP-POSNR,
MATNR TYPE VBRP-MATNR,
ARKTX TYPE VBRP-ARKTX,
FKIMG TYPE VBRP-FKIMG,
NETWR TYPE VBRP-NETWR,
END OF TY_TARGET.
DATA : T_VBRK TYPE TABLE OF TY_VBRK,
W_VBRK TYPE TY_VBRK,
T_VBRP TYPE TABLE OF TY_VBRP,
W_VBRP TYPE TY_VBRP,
T_TARGET TYPE TABLE OF TY_TARGET,
W_TARGET TYPE TY_TARGET,
FIELD CATALOG ******************
T_FCAT TYPE SLIS_T_FIELDCAT_ALV,
W_FCAT TYPE SLIS_FIELDCAT_ALV,
*************************************SUB TOTALS AND SORTING***********
T_SORT TYPE SLIS_T_SORTINFO_ALV,
W_SORT TYPE SLIS_SORTINFO_ALV,
*************************************FOR LIST HEADER******************
T_LIST_HEAD TYPE SLIS_T_LISTHEADER,
W_LIST_HEAD TYPE SLIS_LISTHEADER,
T_LIST_HEAD1 TYPE SLIS_T_LISTHEADER,
W_LIST_HEAD1 TYPE SLIS_LISTHEADER,
*************************************FOR LIST HEADER******************
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
************************************FOR EVENTS************************
T_EVENT TYPE SLIS_T_EVENT,
W_EVENT TYPE SLIS_ALV_EVENT.
*********************************SELECT OPTIONS***********************
SELECT-OPTIONS : S_VBELN FOR VBRK-VBELN DEFAULT 90005316 TO 90005330.
**RETRIVING DATA************************
PERFORM DATA_RETRIVE.
**BUILDING THE FIELD CATALOG************
PERFORM BUILD_FCAT.
**BUILDING THE TABLE FOR LIST HEADER****
PERFORM BUILD_LIST_HEAD.
*******************************CALLING THE FUNCTION MODULE************
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'LIST_TOP_OF_PAGE'
IT_FIELDCAT = T_FCAT
IT_SORT = T_SORT
TABLES
T_OUTTAB = T_TARGET.
*& Form DATA_RETRIVE
FORM DATA_RETRIVE .
SELECT VBELN VKORG VTWEG SPART FKDAT FROM VBRK INTO CORRESPONDING FIELDS
OF TABLE T_VBRK WHERE VBELN IN S_VBELN.
IF SY-SUBRC EQ 0.
SORT T_VBRK BY VBELN.
SELECT VBELN POSNR MATNR ARKTX FKIMG NETWR FROM VBRP INTO TABLE
T_VBRP FOR ALL ENTRIES IN T_VBRK WHERE VBELN = T_VBRK-VBELN.
ENDIF.
LOOP AT T_VBRP INTO W_VBRP.
LOOP AT T_VBRK INTO W_VBRK WHERE VBELN = W_VBRP-VBELN.
W_TARGET-VBELN = W_VBRK-VBELN.
W_TARGET-VKORG = W_VBRK-VKORG.
W_TARGET-VTWEG = W_VBRK-VTWEG.
W_TARGET-SPART = W_VBRK-SPART.
W_TARGET-FKDAT = W_VBRK-FKDAT.
W_TARGET-POSNR = W_VBRP-POSNR.
W_TARGET-MATNR = W_VBRP-MATNR.
W_TARGET-ARKTX = W_VBRP-ARKTX.
W_TARGET-FKIMG = W_VBRP-FKIMG.
W_TARGET-NETWR = W_VBRP-NETWR.
APPEND W_TARGET TO T_TARGET.
ENDLOOP.
ENDLOOP.
SORT T_TARGET BY VBELN.
ENDFORM. " DATA_RETRIVE
*& Form BUILD_FCAT
FORM BUILD_FCAT .
W_FCAT-COL_POS = 1.
W_FCAT-FIELDNAME = 'VBELN'.
W_FCAT-SELTEXT_M = 'BILLING NO'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 2.
W_FCAT-FIELDNAME = 'VKORG'.
W_FCAT-SELTEXT_M = 'SALES ORGANIZATION'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 3.
W_FCAT-FIELDNAME = 'VTWEG'.
W_FCAT-SELTEXT_M = 'DISTRIBUTION CHANNEL'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 4.
W_FCAT-FIELDNAME = 'SPART'.
W_FCAT-SELTEXT_M = 'DIVISION'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 5.
W_FCAT-FIELDNAME = 'FKDAT'.
W_FCAT-SELTEXT_M = 'CREATION DATE'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 6.
W_FCAT-FIELDNAME = 'POSNR'.
W_FCAT-SELTEXT_M = 'BILLING ITEM'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 7.
W_FCAT-FIELDNAME = 'MATNR'.
W_FCAT-SELTEXT_M = 'MATERIAL NUM'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 8.
W_FCAT-FIELDNAME = 'ARKTX'.
W_FCAT-SELTEXT_M = 'DESCRIPTION'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 9.
W_FCAT-FIELDNAME = 'FKIMG'.
W_FCAT-SELTEXT_M = 'QUANTITY'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 10.
W_FCAT-FIELDNAME = 'NETWR'.
W_FCAT-SELTEXT_M = 'NET VALUE'.
W_FCAT-DO_SUM = 'X'.
APPEND W_FCAT TO T_FCAT.
ENDFORM. " BUILD_FCAT
*& Form BUILD_LIST_HEAD
FORM BUILD_LIST_HEAD .
DATA : L_DATE(10),
L_TIME(8).
W_LIST_HEAD-TYP = 'S'.
W_LIST_HEAD-KEY = 'Sales org :'.
W_LIST_HEAD-INFO = S_VBELN-LOW .
APPEND W_LIST_HEAD TO T_LIST_HEAD.
CLEAR W_LIST_HEAD.
W_LIST_HEAD-TYP = 'S'.
W_LIST_HEAD-KEY = 'TO '.
W_LIST_HEAD-INFO = S_VBELN-HIGH.
APPEND W_LIST_HEAD TO T_LIST_HEAD.
CLEAR W_LIST_HEAD.
ENDFORM. " BUILD_LIST_HEAD
*& Form LIST_TOP_OF_PAGE
FORM LIST_TOP_OF_PAGE .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LIST_HEAD.
ENDFORM. " LIST_TOP_OF_PAGE
<code>
Regards -
Displaying the header in the downloaded Excel sheet of BI Report
Hi Friends,
The BI report is mapped in the portal, there is a requirement to add a header part in the excel sheet which is downloaded from the Portal like displaying the company code and the date on which it is pulled out. How can it be done, please guide me.
Thanks
KarthikHi,
then that is an excel formattng.. After downloading, select the MATNR column, use the Menu option Firmat> Cells> Number--> custom and enter '000000000000000000'.
Regards,
Suresh Datti -
ALV HEADER DISPLAY IN VERTICAL
HI,
IT IS POSSIBLE TO DISPLAY THE ALV HEADING IN VERTICAL .
PLZ GIVE ME THE DETAILS.
THANKS,
S.RANIHi,
You can refer the Link:
< link to blocked site removed by moderator>
Hope, this helps you,
Regards,
Kris
Edited by: Thomas Zloch on Oct 27, 2011 9:12 AM
Maybe you are looking for
-
App Store not working
-
Suddenly I can no longer see any entries I've made in my calendar on my iphone 5. Everything still shows on my ipad but not on the phone. I LIVE by this calendar. Help!
-
How to downgrade from iOS 8.1 to 7.1.2 for iPhone 5 ?
Dear Experts How to downgrade from iOS 8.1 to 7.1.2 for iPhone 5 ? The situation is that in Hong Kong, I bought the iPhone 5 for my mainland China friend. The seller said that the iPhone 5 was brand new and was come from USA. I found that iPhone 5 wa
-
Windows XP / RH8 / RoboSource Control 3.1 Tried to open a project that I have not accessed for while. After clicking Yes or No to the "Get latest..." queston I get the error "Adobe RoboHelp 8 has encountered a problem and needs to close. We are
-
Delays receiving emails with MS Exchange/a​ctivsync
hi, in the last week i noticed major good 10-15 minutes delays on my BB Z10 that is connected to my corporate Exchange. Now I have I tried to isolated the area of the problem. I using 2 devices an Andorid and the Z10 configure the same under the same