Re: Display format in the ALV report output
Hi Expert,
In the alv report how to display below format in the output.
Example: Jan 2011 feb 2011 march 2011 .......................
no amount no amount no amount
As you seen in the above output i need Below jan 2011 NO and AMOUNT similar for other months.
Can any one throw some light...............
Regards,
Am.
Edited by: anitha.mava on Nov 5, 2011 12:37 PM
Moderator message : Spec dumping is not allowed, search for available information. Thread locked.
Edited by: Vinod Kumar on Nov 7, 2011 9:31 AM
Hi,
Are you able to populate NO ? If yes i don't see why u can't populate No Amount.
If you are not able to populate No.. just pass the same based on the condition to the (string) field that column is referring to ..
Or are u not able to align the columns ? If yes, you will have to do some hit and trial with write statement ..or better why not use grid display ..
Please provide more details ..
Regards,
Pranav.
Similar Messages
-
Problem when dowloading the ALV report output to Excel Sheet.
Hi ,
I am dowloading the ALV report output to Excel Sheet.
There is field Condition Unit(KOMP-KMEIN) in the output of the ALV, this has values PC and CSE , but when I download to Excel Sheet, CSE is appearing as CSE ,but PC is appearing as ******.
Can you please help me in knowing the reson for this.
Regards,
Madhu.hi
refer to following link
http://www.****************/Tutorials/ALV/ColorSALV/Demo.htm
http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm
Cheers
Snehi
Edited by: snehi chouhan on Jul 11, 2008 12:42 PM -
Download the ALV Report output into excel sheet or notepad
Hi,
how to downlaod the alv report out into excel sheet or notepad in a proper manner. program contain large number records....
Thanks in advance!!!!
Regards,
kranthi.Hi
Download a report to excel with format (border, color cell, etc)
Try this program...it may help you to change the font ..etc.
Code:
REPORT ZSIRI NO STANDARD PAGE HEADING.
this report demonstrates how to send some ABAP data to an
EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_MAPL TYPE OLE2_OBJECT, " list of workbooks
H_MAP TYPE OLE2_OBJECT, " workbook
H_ZL TYPE OLE2_OBJECT, " cell
H_F TYPE OLE2_OBJECT. " font
TABLES: SPFLI.
DATA H TYPE I.
table of flights
DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
*& Event START-OF-SELECTION
START-OF-SELECTION.
read flights
SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
display header
ULINE (61).
WRITE: / SY-VLINE NO-GAP,
(3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
ULINE /(61).
display flights
LOOP AT IT_SPFLI.
WRITE: / SY-VLINE NO-GAP,
IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
ENDLOOP.
ULINE /(61).
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-007
EXCEPTIONS
OTHERS = 1.
start Excel
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-008
EXCEPTIONS
OTHERS = 1.
get list of workbooks, initially empty
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP.
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - start
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2.
PERFORM ERR_HDL.
tell user what is going on
SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - end
disconnect from Excel
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:\SKV.XLS'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
FORM FILL_CELL *
sets cell at coordinates i,j to value val boldtype bold *
FORM FILL_CELL USING I J BOLD VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL.
SET PROPERTY OF H_F 'Bold' = BOLD .
PERFORM ERR_HDL.
ENDFORM.
*& Form ERR_HDL
outputs OLE error if any *
--> p1 text
<-- p2 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
Please note that this example maybe slow at filling the excel table
(perhaps four fields per second on a 900 MHz machine - almost 30 seconds
for a short example).
To get the data on properties and methods - there is a bit of smoke and mirrors
going on here; they are EXCEL properties and methods, not sap ones - so you need
to look at excel help to determine how a particular function is structured. then
build the block in sap, as shown in the example.
If you only want to transfer the data to Excel like when you transfer the data from
ALV to Excel simply use the Function Modules:
XXL_SIMPLE_API
If you want more modifications when you transfer it to Excel use:
XXL_FULL_API -
How to send the ALV report output by automated email.
Hi All,
Can any one advice how to send ALV report output by automated email.
Thanks in advance.
Vikram.
Edited by: vikram mallavaram. on Oct 13, 2011 3:26 PM
Moderator message: FAQ, please search for previous discussions of this topic.
Edited by: Thomas Zloch on Oct 13, 2011 3:27 PMHi Ramya,
Check the links below :
http://wiki.sdn.sap.com/wiki/display/Snippets/Sending+Mail
http://wiki.sdn.sap.com/wiki/display/Snippets/AbapEMAILProgram
http://wiki.sdn.sap.com/wiki/display/ABAP/SendMessagetoExternalemailidandSAPUseridvia+ABAP
They will explain you to send an email.
Regards,
Kittu -
How to do the ALV report output in groups and caluculate the tOTALS(URGENT
Hi
In my ALV report output .I have to group the output based on the DAYS field
0-10 days in one group
10-30 days in one group
above 30 days one group
There is also a field by name "AMOUNT" in my output.
I have to calculate SUBTOTALs at the end of every group and at the end of the report i should caluculate GRAND TOTAL.
Please remember that i should not use any any BLOCKED ALVs and for Totals i should not use the SYMBOLS provided in the application toolbar of the report
Thanks in AdvancePlease don't repost your questions...
Check out my answer in your other post.
How to make the ALV report in groups and caluculate the TOTALS
Regards,
Naimesh Patel -
Issue while downloading the alv report output in spreadsheet format .
Hi,
I have a report output, whenever I try to download it in the spreadsheet format to my desktop,
I get the following issue:
Say the correct material number is 10833340001218999 or 10030000063207001
(This appears in the report output)
But in the excel file the number is displayed as 10833340001218900 and 10030000063207000.
Please help.
Regards,
Sucharita.Hi Sucharita,
The reason for your problem could be that in excel 2007, characters more that 15 are replaced with 0.
Or you can try downloading the data using FM 'GUI_DOWNLOAD' , if currently you are using stadard SAP functionality of data downloading.
Best Regards,
Vishal. -
Displaying selection criteria in ALV report output
Hello,
Ive been using REUSE_ALV_GRID_DISPLAY function module to display my report content in ALV.
My reports selection criteria has parameters, select options, checkboxes and radio buttons. As part of the ALV output, I want to display the criteria that the user had selected in the selection screen. I was hoping to do that via parameter "i_callback_top_of_page" and fill the selection criteria in the header area. I'm using REUSE_ALV_COMMENTARY_WRITE to fill the header area.
However, the header area takes too much of view space in the output if I put all the selection screen information in it.
Is there a way to make the header area scrollable? What is a good way of displaying the selection criteria information as part of the report output?
Appreciate your help.
ssHi SS,
1. The purpose of displaying / writring
selection information
in alv is
for identifying what the user has seleccted,
directly from the report (when its printed)
2. So, the option of priting/writing
it on the TOP of alv, is ok.
3. However, U can also choose to WRITE
it at the BOTTOM (instead of top)
4. Try to utilise maximum spacing (horizontally)
field1 : abcd fidl2 = xyz field3 = ppp
field4 : mnc etc. etc.
regards,
amit m. -
How to send the ALV report output in mail
Dear all,
I have developed an ALV report.I need to send this output in the mail.Can anyone help me with the sample code of how to do this.Hi Ramya,
Check the links below :
http://wiki.sdn.sap.com/wiki/display/Snippets/Sending+Mail
http://wiki.sdn.sap.com/wiki/display/Snippets/AbapEMAILProgram
http://wiki.sdn.sap.com/wiki/display/ABAP/SendMessagetoExternalemailidandSAPUseridvia+ABAP
They will explain you to send an email.
Regards,
Kittu -
Display of photograph in alv report output
hi all,
I have uploaded logo in t.code OAER. when i give image name for i_logo in the f.module resue_alv_commentary_write..it is able to
display logo given respectively..
but when i uploaded photo(jpg)...it is not displaying the photo in the output...may i know why it is happenning so...pls anyone
<<text removed>>
Thanks&Regards
deepika.
Edited by: Matt on Apr 19, 2010 8:59 AMI have uploaded all jpeg format images only..im able to display the rest of images in jpeg extension and also able to display bitmap...
but im unable to display photograph in jpeg format...let me know the reason why it is not?
Thanks&Regards
deepika. -
Display/Print the Selection criteria entered by USER on the ALV Report o/p?
Hi Experts,
I hv a requirement of to print/display the Selection criteria entered by user in the selection screen.........on the top portion of the ALV report output lay out.
There is a FM for this purpose, but, I forgot its name!!
So, let me know the FM or FMs, so that, will choose, which is best one,
or the piece of code, which covers all select-option entries..........appreciated.
thanq
Edited by: SAP ABAPer on Sep 3, 2008 6:35 PMUse the Function RS_REFRESH_FROM_SELECTOPTIONS get the selection details, now format the data accordingly in the TOP_OF_PAGE using the calss CL_DD_DOCUMENT.
Check the below mention code.
REPORT ztest_page.
TABLES: sflight.
DATA : it_flight TYPE TABLE OF sflight WITH HEADER LINE.
DATA BEGIN OF it_sel_opt OCCURS 0.
INCLUDE STRUCTURE rsparams.
DATA END OF it_sel_opt.
SELECT-OPTIONS: s_carrid FOR sflight-carrid.
START-OF-SELECTION.
SELECT * FROM sflight INTO TABLE it_flight
WHERE carrid IN s_carrid.
END-OF-SELECTION.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = sy-repid
TABLES
selection_table = it_sel_opt
EXCEPTIONS
not_found = 01
no_report = 02.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_html_top_of_page = 'TOP_OF_PAGE'
i_structure_name = 'SFLIGHT'
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1
OTHERS = 2.
*& Form top_of_page
* text
* -->DOCUMENT text
FORM top_of_page USING document TYPE REF TO cl_dd_document.
DATA : dl_text(255) TYPE c. "Text
* Add new-line
CALL METHOD document->new_line.
CALL METHOD document->new_line.
CLEAR : dl_text.
* program ID
dl_text = 'Program Name :'.
CALL METHOD document->add_gap.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_heading_int.
CLEAR dl_text.
dl_text = sy-repid.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_negative_inv.
* Add new-line
CALL METHOD document->new_line.
CLEAR : dl_text.
dl_text = 'Selection Criteria'.
CALL METHOD document->add_gap
EXPORTING
width = 34.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_negative_inv.
* Add new-line
CALL METHOD document->new_line.
CLEAR : dl_text.
CONCATENATE 'SELECT Option' 'SIGN' 'OPTION' 'LOW' 'HIGH'
INTO dl_text SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
CALL METHOD document->add_gap
EXPORTING
width = 34.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_negative_inv.
* Add new-line
CALL METHOD document->new_line.
LOOP AT it_sel_opt.
CLEAR : dl_text.
CONCATENATE it_sel_opt-selname it_sel_opt-sign
it_sel_opt-option it_sel_opt-low it_sel_opt-high
INTO dl_text SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
CALL METHOD document->add_gap
EXPORTING
width = 34.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_negative_inv.
* Add new-line
CALL METHOD document->new_line.
ENDLOOP.
ENDFORM. "top_of_page -
ALV Report output in Excel format
Hi ,
I am facing a different behaviour in two computers , while trying to take an Excel format of an ALV report output. After generating the ALV output ,in one , when I click on the Excel Format button - the Excel spreadsheet opens with the output data. In the second computed , under the same action , a blank Excel sheet opens .
Could someone tell me a solution . What aspect is responsible for this ?
Regards ,
SujataReduce the MACRO security settings in the Excel to Medium.
Open an execl sheet, Chose from menu Tootls->Macro->Security.
Chose the radio-buton medium. Close the file and all excel applications.Then try downloading again.
Regards,
Ravi -
ALV report output to be send to the respective users through email
Hi Gurus,
My requirement is to send the ALV report output to the respective users Email ID (Lotus notes) when the report runs in background.
Could any one suggest me with sample coding, How to send a ALV report output to the respective email ID's ( Suggest me the FM that used to send a internal table)
Regards
PaulHi Paul,
Here for u the sample code:
<b>call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_txt = it_message
receivers = it_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.</b>
Hope this helps you.Reply for queries
Regards,
Kumar. -
Text format error in ALV report
Hi Experts,
I am trying to download the ALV report output in to text format but the system is not downloaded the columns correctly. some of the columns are repeating and the alignment also not correct.
Please let me know if anyone have solution for this.
Reward points for good solutions.
Regards,
Venkatuse the Option(SHort Cut) CTRLSHFTF9
Local File->Spread sheet option.
And download to excel file.
Text file you can see format distorted, though it is not distorted.
Better use XLS format.
IF columns are repeating then the problem is with the Fieldcatalog. -
How to Print Selection-Screen along with ALV Report output
Hi,
I have a requirement wherein i need to also print the Selection Screen of a report when I print the ALV report output.
Basically i need to print the ALV output along with selection screen.
Could you plz suggest me the way.
Regards,
NitinHi,
My selection Screen is a very big one. It contains around 30 select-options.
So is their any standard method in which you can choose whether you want to take the output printout with or without Selection screen.
Regards,
Nitin -
Problem in display of text in ALV report
Dear experts,
I am working on a MM Report in which I need to display Material Basic data text maintained in MM01,02 Tcodes through ALV report.
I have declared a string type variable for the Basic data text in the Final Internal Table.
For reading the Standard text I am using Read_Text FM, from which I am looping the Text internal table and concatenating it into
String variable.
What I notice is all the content beyond 255 chars is not getting displayed, Even when the ALV report is downloaded to Excel file.
Can you suggest some approach to over come this issue.
Regards,
MurthyHi,
Use the below code
Data : lt_content TYPE TABLE OF tline,
lw_content TYPE tline.
Data : lt_text Type Table of solisti1,
lw_text TYPE solisti1.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = lv_id
language = tdspras
name = lv_name
object = lv_object
archive_handle = 0
local_cat = ' '
TABLES
lines = lt_content
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
loop at lt_content into lw_content.
lw_text-line = lw_content-tdline.
APPEND lw_text TO lt_text.
CLEAR: lw_content, lw_text.
endloop.
Now your whole text is in "lt_text".
Regards,
Avish Mittal
Maybe you are looking for
-
Hi gurur's in BDC for recording other than SHDB any process is there
hi gurur's in BDC for recording other than SHDB any process is there
-
Problem Printing Labels on Zebra label printers
Hi Every one (there may be old solution for my problem, if there is, point me to that) my environment is oracle 6, windows 2000. server is runnig on windows NT. I am generating labels using oracle reports 6 for an application customised for pharmaceu
-
Import Data From Excel In OBIEE 11g
Hi, I created an excel sheet named as product. It has three columns. I selected the range and clicked on table. So I assume that it acts like a table. Named the excel work book as ProductExcel. Later created dsn by selecting this workbook. Now create
-
"Xml Form" Created with Form Builder in a CO
Is it possible to assign a "XML FORM" created with the tool Form Builder of Portal, and assign it to a CO? Regards David Message was edited by: David Valenzuela
-
I received an error for a webpage i entered, how can i fix it so i can log in again
hi, i received a error message in my computer, because i did something wrong, and i want to log in to the web page again but i cant. how can i fix it