Download to Excel file from ALV Grid
Hi,
I'm having a problem in downloading ALV Grid to excel file. The problem are the numbers are not in float format. I want them all in float format. Numbers in thousands are formatted with comma and decimals but numbers less than thousands are not in decimals.
Ex:
5 should be 5.00.
In ALV, this number is being displayed as 5.00 but when downloaded it displayed as 5 only.
Did you mention the INTTYPE and Decimals in the fieldcatalog for those fields.
INTTYPE = 'P'.
DECIMALS_OUT = '3'.
try this..
also
use the Option
short cut CTRLSHFTF9 option
Local File->Spreadsheet-> and save it to excel file.
Similar Messages
-
Download to excel sheet from ALV Grid report
Hi,
I need to download 3 lakhs of data to excel sheet but the constraint is that excel is having max limit of 65000 line items.
So i need to know the way in which i can create more than one sheet in excel while downloading so that each sheet can hold upto 65000 line items.
i need to create atleast 6 sheets in excel while downloading from report.
please help.Hi,
While downloading the data, it will prompt you save the list in file - Uncoverted, Spreadsheet, Rich text format, HTML format, Copy to Clipboard.
Why don't you try using Uncoverted format and give extension as .txt file.
So that you can download all 3 lacs of records.
Even if you use any FM, it will indirectly use excel for downloading and it will have restriction of having 65000 records only.
Thanks,
Sriram Ponna. -
I would like to create a workflow in Automator or a script in AppleScript (or a combination of the two), that opens Safari to a specified page and downloads an excel file from this page and saves the downloaded document to my desktop.
Is this something that be done? If so, how?
I have so far been able to build a workflow in Automator to open Safari and added an AppleScript that takes Safari to a specific page that has an Excel document.
I can't figure out where to go from here... Any help would be apprecitated.
Thanks!Would you have the web address the excel sheet is on?
Is there a simular web page you could point to if not?
Would there be a copy of the file on an FTP page. This would be easier.
curl
http://www.cyberciti.biz/faq/mac-os-x-terminal-download-file/
http://www.thegeekstuff.com/2012/04/curl-examples/
http://curl.haxx.se/docs/manpage.html
Macintosh-HD -> Applications -> Utilities -> Terminal
# Press return to run a command.
the curl is a terminal command ( Unix ). It allows you to read a file off of the web.
man curl
provides cryptic information on the commnad curl.
press the space bar to advance a page.
press letter to q to quit.
What you may have to is to read in the web page as a text file. Go "fishing" through the page to find the excel file you need. Once you find the file, you can use curl to read the file.
curl is a very full featured command. (read complex to figure out ).
It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on. Here is an example.
Author: rccharles
For testing, run in the Script Editor.
1) Click on the Event Log tab to see the output from the log statement
2) Click on Run
For running shell commands see:
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- debug lines
set desktopPath to (path to desktop) as string
log "desktopPath = " & desktopPath
set unixDesktopPath to POSIX path of desktopPath
log "unixDesktopPath = " & unixDesktopPath
set quotedUnixDesktopPath to quoted form of unixDesktopPath
log "quoted form is " & quotedUnixDesktopPath
try
set fromUnix to do shell script "ls -l " & quotedUnixDesktopPath
display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
on error errMsg
log "ls -l error..." & errMsg
end try
end run -
Warning while downloading an Excel file from WD ABAP
Hi folks,
In one of requirements, Client wants to download all the data that is appearing on the screen ( WD ABAP Application ) to an Excel with a layout in different manner.
We achieved this with Simple Transformations.
Now the question is while downloading the excel file, the framework/other is throwing an Warning like
" The file you are trying to open, 'info.xls', is in a different format than specified by the extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? "
Note: All the users of my client are using MS Office 2002 / 2003.
I am using the following code........!
*------ Call Transformation for Excel OUTPUT
CALL TRANSFORMATION ZEXCEL_OUTPUT
SOURCE
t_dates = t_dates
t_info = t_info
RESULT XML l_xml_string.
REPLACE ALL OCCURRENCES OF '<?xml version="1.0" encoding="utf-16"?>' l_xml_string WITH '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?>'.
**-- Call Function Module for converting string data to XSTRING
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = l_xml_string
mimetype = 'application/xml'
IMPORTING
buffer = l_xml_xstring
EXCEPTIONS
failed = 1
OTHERS = 2.
CALL METHOD cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = 'info.xml'
i_content = l_xml_xstring
i_mime_type = 'application/vnd.ms-excel'.
With this code I am generating a file of type XML SPREADSHEET 2003. While opening this file I am getting the above message which the user unwanted......
Can any one help me on this -
> How to avoid this warning?
Thanks and Regards,
Aneel Danda
Edited by: danda aneel on Jul 13, 2010 1:43 PMFirstly, Thanks for Your quick Response, Thomas.
Even though what ever may be the file name I am passing either info.xml or Info.xls , In error info.xls is coming.
Kindly provide me an alternative on this XML doesn't seem like it would match the 'application/vnd.ms-excel'.
what is the supported format.?
Similarly, It is not considering the UTF-8 / UTF-16 for xml.........same result is appearing in the output.
Edited by: danda aneel on Jul 14, 2010 7:52 AM -
Download all excel files from sharepoint location to local folder
Hi,
How to I copy all excel files stored at sharepoint location to local folder?
Regards,
NidhiHi NidhiP,
To download Excel files from a SharePoint library by using SSIS, we need to make use of the Script Task. In the Script Task, we can use the methods provided by
Lists Web Service to work with SharePoint files, and then use the
WebClient.DownloadFile Method or
FileStream Class to transfer the files from SharePoint to local file system.
For the code examples, please refer to:
http://www.codeproject.com/Questions/457161/how-to-download-files-from-Sharepoint-document-lib?tab=mostrecent
http://blogs.msdn.com/b/sowmyancs/archive/2007/09/15/how-to-download-files-from-a-sharepoint-document-library-remotely-via-lists-asmx-webservice-sps-2003-moss-2007.aspx
http://sqlblogcasts.com/blogs/drjohn/archive/2007/11/04/downloading-excel-files-from-sharepoint-using-ssis.aspx
Regards,
Mike Yin
TechNet Community Support -
Not able to download all the rows to excel sheet from alv grid display
Hi experts,
I am not able to download all the rows which are displayed in alv grid display for some material numbers.
for some materials i am able to download, i used two ways to download 1) from icon(local file) on grid 2) menu list->export.
i checked in debugging till selecting the spread sheet pop up window, i am able to see all the data in internal table.
Can you suggest me what will be the problem....
thanks in advance,hi sandeep,
sorry for didnt specify clearly.
note: EX: "asaasdada in this sentence i said " this symbol is special character not the text.
building final internal table code
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = p_capid
datuv = sy-datum
ehndl = '1'
mktls = 'X'
mehrs = 'X'
mmory = '1'
mtnrv = p_matnr
stlal = '1'
stpst = 0
svwvo = 'X'
werks = p_werks
vrsvo = 'X'
TABLES
stb = i_stb
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
conversion_error = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_stb1[] = i_stb[].
IF NOT i_stb1[] IS INITIAL.
SORT i_stb1 BY idnrk.
DELETE ADJACENT DUPLICATES FROM i_stb1 COMPARING idnrk.
SELECT bmatn ematn FROM ampl INTO TABLE i_ampl
FOR ALL ENTRIES IN i_stb1
WHERE bmatn = i_stb1-idnrk AND
datuv LE sy-datum AND
datub GE sy-datum.
SELECT
matnr
bwkey
verpr
stprs
bwprh
FROM mbew
INTO TABLE i_mbew
FOR ALL ENTRIES IN i_stb1
WHERE
matnr EQ i_stb1-idnrk AND
bwkey EQ i_stb1-werks.
IF NOT i_stb1[] IS INITIAL.
SELECT matnr werks beskz
dzeit webaz plifz
ekgrp
INTO TABLE i_marc
FROM marc
FOR ALL ENTRIES IN i_stb1
WHERE matnr = i_stb1-idnrk
AND werks = i_stb1-werks.
SORT i_marc BY matnr werks.
ENDIF.
CLEAR i_ekpo.
CLEAR i_vend.
IF NOT i_stb1[] IS INITIAL.
SELECT ebeln ebelp matnr werks loekz aedat
netpr peinh
INTO TABLE i_ekpo
FROM ekpo
FOR ALL ENTRIES IN i_stb1
WHERE matnr = i_stb1-idnrk
AND werks = i_stb1-werks.
SORT i_ekpo BY matnr ASCENDING
aedat DESCENDING
ebeln DESCENDING
ebelp DESCENDING.
IF NOT i_ekpo IS INITIAL.
SELECT k~ebeln k~lifnr l~name1
INTO TABLE i_vend
FROM ekko AS k INNER JOIN lfa1 AS l
ON k~lifnr EQ l~lifnr
FOR ALL ENTRIES IN i_ekpo
WHERE ebeln = i_ekpo-ebeln.
SORT i_vend BY ebeln.
ENDIF.
ENDIF.
ENDIF.
i_ampl1[] = i_ampl[].
IF NOT i_ampl1[] IS INITIAL.
SORT i_ampl1 BY ematn.
DELETE ADJACENT DUPLICATES FROM i_ampl1 COMPARING ematn.
SELECT matnr mfrpn mfrnr FROM mara INTO TABLE i_mara
FOR ALL ENTRIES IN i_ampl1
WHERE matnr = i_ampl1-ematn.
ENDIF.
SORT i_ampl BY bmatn.
IF NOT i_stb[] IS INITIAL.
SELECT stlty stlnr stlkn stpoz idnrk potx1 potx2
INTO TABLE i_stpo
FROM stpo
FOR ALL ENTRIES IN i_stb
WHERE stlty = i_stb-stlty
AND stlnr = i_stb-stlnr
AND stlkn = i_stb-stlkn
AND stpoz = i_stb-stpoz
AND idnrk = i_stb-idnrk.
SORT i_stpo BY stlty stlnr stlkn stpoz idnrk.
ENDIF.
LOOP AT i_stb INTO wa_stb.
READ TABLE i_marc INTO wa_marc
WITH KEY matnr = wa_stb-idnrk
werks = wa_stb-werks
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-beskz = wa_marc-beskz.
wa_outtab-dzeit = wa_marc-dzeit.
wa_outtab-webaz = wa_marc-webaz.
wa_outtab-plifz = wa_marc-plifz.
wa_outtab-ekgrp = wa_marc-ekgrp.
ENDIF.
READ TABLE i_ekpo INTO wa_ekpo
WITH KEY matnr = wa_stb-idnrk.
IF sy-subrc = 0.
wa_outtab-netpr = wa_ekpo-netpr.
wa_outtab-peinh = wa_ekpo-peinh.
READ TABLE i_vend INTO wa_vend
WITH KEY ebeln = wa_ekpo-ebeln
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-lifnr = wa_vend-lifnr.
wa_outtab-name_sup = wa_vend-name1.
ENDIF.
ENDIF.
READ TABLE i_stpo INTO wa_stpo
WITH KEY stlty = wa_stb-stlty
stlnr = wa_stb-stlnr
stlkn = wa_stb-stlkn
stpoz = wa_stb-stpoz
idnrk = wa_stb-idnrk
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-potx1 = wa_stpo-potx1.
wa_outtab-potx2 = wa_stpo-potx2.
ENDIF.
READ TABLE i_mbew INTO wa_mbew
WITH KEY
matnr = wa_stb-idnrk
bwkey = wa_stb-werks.
IF sy-subrc IS INITIAL.
MOVE:
wa_mbew-verpr TO wa_outtab-verpr,
wa_mbew-stprs TO wa_outtab-stprs,
wa_mbew-bwprh TO wa_outtab-bwprh.
ENDIF.
wa_outtab-matnr = p_matnr.
wa_outtab-posnr = wa_stb-posnr.
wa_outtab-stufe = wa_stb-stufe.
wa_outtab-idnrk = wa_stb-idnrk.
wa_outtab-ojtxb = wa_stb-ojtxp.
wa_outtab-menge = wa_stb-menge.
wa_outtab-meins = wa_stb-meins.
MOVE: wa_stb-zzitem_draw_no TO wa_outtab-zzitem_draw_no.
IF wa_stb-upskz = 'X'.
SELECT * FROM stpu INTO TABLE i_stpu
WHERE stlty = wa_stb-stlty AND
stlnr = wa_stb-stlnr AND
stlkn = wa_stb-stlkn AND
stpoz = wa_stb-stpoz.
ENDIF.
LOOP AT i_stpu INTO wa_stpu.
wa_outtab-upmng = wa_stpu-upmng.
wa_outtab-ebort = wa_stpu-ebort.
wa_outtab-uposz = wa_stpu-uposz.
CONCATENATE v_ebort wa_stpu-ebort INTO v_ebort
SEPARATED BY space.
ENDLOOP.
MOVE strlen( v_ebort ) TO v_len.
MOVE: 0 TO x,
128 TO y.
DATA : lt_tab TYPE TABLE OF swastrtab.
DATA : ls_tab LIKE LINE OF lt_tab.
DATA : lv_ebort TYPE string.
CLEAR lv_ebort. CLEAR lt_tab.
MOVE v_ebort TO lv_ebort.
CALL FUNCTION 'SWA_STRING_SPLIT'
EXPORTING
input_string = lv_ebort
max_component_length = 128
TABLES
string_components = lt_tab
EXCEPTIONS
max_component_length_invalid = 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.
IF lt_tab[] IS NOT INITIAL.
LOOP AT lt_tab INTO ls_tab.
CLEAR lv_ebort.
MOVE: ls_tab-str TO lv_ebort.
CONDENSE lv_ebort.
MOVE lv_ebort TO wa_outtab-ebort.
APPEND wa_outtab TO i_outtab.
CLEAR:
wa_outtab-matnr,
wa_outtab-posnr,
wa_outtab-zzitem_draw_no,
wa_outtab-ojtxb,
wa_outtab-menge,
wa_outtab-meins,
wa_outtab-uposz,
wa_outtab-upmng,
wa_outtab-verpr,
wa_outtab-stprs,
wa_outtab-bwprh,
wa_outtab-lifnr,
wa_outtab-name_sup,
wa_outtab-potx1,
wa_outtab-potx2,
wa_outtab-netpr,
wa_outtab-peinh.
* wa_outtab-idnrk.
ENDLOOP.
ELSE.
APPEND wa_outtab TO i_outtab.
ENDIF.
CLEAR v_ebort.
CLEAR: wa_stpu.
REFRESH: i_stpu.
LOOP AT i_ampl INTO wa_ampl WHERE bmatn = wa_stb-idnrk.
READ TABLE i_mara INTO wa_mara WITH TABLE KEY matnr = wa_ampl-ematn.
IF sy-subrc = 0.
LOOP AT i_outtab INTO wa_outtab
WHERE
idnrk = wa_stb-idnrk AND
flag NE 'X'.
wa_outtab-mfrpn = wa_mara-mfrpn.
wa_outtab-mfrnr = wa_mara-mfrnr.
SELECT SINGLE name1 FROM lfa1 INTO wa_outtab-name1 WHERE lifnr = wa_mara-mfrnr.
MOVE 'X' TO wa_outtab-flag.
MODIFY i_outtab FROM wa_outtab
TRANSPORTING mfrpn mfrnr name1 flag.
EXIT.
ENDLOOP.
IF sy-subrc <> 0.
CLEAR:
wa_outtab-matnr,
wa_outtab-posnr,
wa_outtab-zzitem_draw_no,
wa_outtab-ojtxb,
wa_outtab-ebort,
* wa_outtab-idnrk,
wa_outtab-menge,
wa_outtab-meins,
wa_outtab-uposz,
wa_outtab-upmng,
wa_outtab-verpr,
wa_outtab-stprs,
wa_outtab-bwprh,
wa_outtab-lifnr,
wa_outtab-name_sup,
wa_outtab-potx1,
wa_outtab-potx2,
wa_outtab-netpr,
wa_outtab-peinh.
wa_outtab-mfrpn = wa_mara-mfrpn.
wa_outtab-mfrnr = wa_mara-mfrnr.
SELECT SINGLE name1 FROM lfa1 INTO wa_outtab-name1 WHERE lifnr = wa_mara-mfrnr.
APPEND wa_outtab TO i_outtab.
ENDIF.
ENDIF.
REFRESH i_stpu.
CLEAR i_stpu.
ENDLOOP. CLEAR: wa_matnr1, wa_mfrnr, wa_outtab.
ENDLOOP.
Edited by: srinivasareddy j on Mar 9, 2011 7:16 AM
Edited by: srinivasareddy j on Mar 9, 2011 7:20 AM -
Downloading to Excel Sheet from ALV display
Hi Friends,
Here i am displaying data in ALV grid. i want to download data to excel file . My data is stored in a field symbol.Could you please tell me how to download this? Currently i am trying with
CALL FUNCTION 'OLE_SERVER_CHECK'
CALL FUNCTION 'XXL_SIMPLE_API'
But i am not getting the result.
Thanks.Download a report to excel with format (border, color cell, etc)
Try this program...
Code:
REPORT ZTEST 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
Regards,
Pavan -
Can I download a spool file from ALV payroll recon report in Fixed Ascii?
We have a process that imports the spool files from our various nightly payroll recon reports but have recently upgraded to ECC 6.0 and the ALV formatted report does not appear to create a fixed format spool file - the width of the columns changes from spool to spool based on the contents.
Does anyone know how to accomplish our need?
Thanks,
DeWayneDoes the printer show up in the Windows Printers folder? We've used PDF995 or Cute pdfwriter for years. All of these create virtual windows printers. When you print to them, a dialog box pops up asking for the filename for the pdf. If you have Activex calls to Excel in order to open a file, you should be able to make ActiveX calls to print it to a print driver such as this. I don't know if any of these drives have a way to bypass the filename dialog box. That may take some research and experimentation. I don't know where the postscript file comes into play in the scenario you are describing.
-
Leading spaces in excel file from ALV
Hi Guys,
once I export a record from ALV to excel. Some values I think all values that are TYPE I. How can I remove this leading spaces.
Ex: ' 100'
something like that.. so if you dont expand the column with you wont see the value 100. I checked the internal table being passed to ALV. It doesnt have leading spaces also in the ALV display. there is no leading spaces. Is there something to to with column width optimization? I need this to optimize the column headers. Thanks in Advance!
Regards,
Michael NacionalesThere is one table CRVS_B with field SFHNR, while creating PRTS I need this field, so I do like this:
select max( SFHNR ) into l_sfhnr
from CRVS_B.
add var to l_sfhnr.
So for example l_sfhnr is equal to 000000000000000010, then after add, it gives me 11, and surprisingly in database 11 is placing position in such a way that last char is empty so it is not 11 but 00000000000000011 ( 17 chars ) as after 11 one empty space, and when it comes next time:
select max( SFHNR ) into l_sfhnr
from CRVS_B.
add var to l_sfhnr.
the value of l_sfhnr is still 000000000000000010......
else try this
Hi
Field_catalog:
Field catalog with field descriptions
2.7.1. Description
Field catalog containing descriptions of the list output fields (usually a subset of the internal output table fields). A field catalog is required for every ALV list output.
The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the REUSE_ALV_FIELDCATALOG_MERGE module
See also the documentation of the function module REUSE_ALV_FIELDCATALOG_MERGE.
The minimal field catalog is documented under 'default'. The caller can use the other optional parameters to assign output attributes to a field which differ from the default.
A field catalog need not be built-up and passed explicitly only under the following conditions:
The internal table to be output has the same structure as a Data Dictionary structure which is referred to in the internal table declaration using LIKE or INCLUDE STRUCTURE.
all fields in this structure are to be output
the structure name is passed to ALV in the parameter I_STRUCTURE_NAME.
See also the documentation of the IMPORTING paramter I_STRUCTURE_NAME.
Positioning
row_pos (row position)
value set: 0, 1 - 3
Only relevant if the list output is to be multi-line (two or three lines) by default.
A multi-line list can also be defined by the user interactively if the default list is one-line.
The parameter specifies the relative output line of the column in a multi-line list.
col_pos (column position)
value set: 0, 1 - 60
only relevant when the default relative column positions differ from the field catalog field sequence. The parameter specifies the relative column position of the field in the list output. The column order can be changed interactively by the user. If this parameter is initial for all field catalog entries, columns appear in the field catalog field sequence.
Identification
fieldname (field name)
value set: internal output table field name (required parameter)
Name of the internal output table field which is described by this field catalog entry
tabname (internal output table)
value set: SPACE, internal output table name
This parameter is used in 'manual' field catalog build-up only for hierarchical-sequential lists.
Name of the internal output table which contains the field FIELDCAT-FIELDNAME.
Data Dictionary reference
ref_fieldname (reference field name)
value set: SPACE, Data Dictionary field name
Name of the Data Dictionary field referred to.
This parameter is only used when the internal output table field described by the current field catalog entry has a reference to the Data Dictionary (not a program field), and the field name in the internal output table is different from the name of the field in the Data Dictionary. If the field names are identical, naming the Data Dictionary structure or table in the FIELDCAT-REF_TABNAME parameter is sufficient.
ref_tabname (reference table/structure field name)
value set: SPACE, name of a Data Dictionary structure or table
Structure or table name of the referred Data Dictionary field.
This parameter is only used when the internal output table field described by the current field catalog entry has a Data Dictionary reference (not a program field).
Reference to fields with currency/measurement unit
Each internal output table sum or quantity field whose decimal places are to be formatted appropriately for the unit in the list must follow the convention:
the field is of data type QUAN or CURR (internal type P) (the field must really have this physical data type. Overwriting the physical data type with the parameter FIELDCAT-DATATYPE has no effect)
There is a field in the internal output table which contains the associated unit.
There is also an entry in the field catalog for the unit field.
(If the unit is not to appear as a column in the list, and cannot be interactively displayed as a column, e.g. because it is always unambiguous and is therefore explicitly output by the caller in the list header, the field catalog units field entry can take the parameter FIELDCAT-TECH = 'X'.
The association of a value field to a unit affects the output as follows:
appropriate decimal places display for the unit
an initialized field with a link to a non-initial unit is output as '0' for the unit (if FIELDCAT-NO_ZERO is initial). When this field is summed, this unit affects whether the units are homogeneous.
an initialized field with a link to an initial unit is output as SPACE. When this field is summed, the unit SPACE does not affect the homogeneity of the units.
When non-initial fields with an initial unit are summed, the unit SPACE is considered to be a unit.
Link to currency unit
cfieldname (currency unit field name)
value set: SPACE, output table field name
Only relevant for amount columns with associated unit.
Name of the internal output table field containing the currency unit associated with the amount field FIELDCAT-FIELDNAME. The field in FIELDCAT-CFIELDNAME must have its own field catalog entry.
ctabname (internal currency unit field output table)
value set: SPACE, output table field name
only relevant for hierarchical-sequential lists
Name of the internal output table containing the FIELDCAT-CFIELDNAME field.
Link to measurement unit
qfieldname (measurement unit field name)
value set: SPACE, output table field name
only relevant for quantity columns with unit link.
Name of the internal output table field containing the measurement unit associated with the quantity field FIELDCAT-FIELDNAME.
The field in FIELDCAT-QFIELDNAME must have its own field catalog entry.
qtabname (internal measurement unit field output table)
value set: SPACE, output table field name
only relevant for hierarchical-sequential lists
Name of the internal output table containing the FIELDCAT-QFIELDNAME field.
Column output options
outputlen (column width)
value set: 0 (initial), n
For fields with a Data Dictionary link this parameter can be left initial.
For fields without a Data Dictionary link (program field) the parameter must be given the value of the desired field list output length (column width).
initial = column width is the output length of the referred Data Dictionary field (domain).
n = column width is n characters
key (key column)
value set: SPACE, 'X' 'X' = kex field (key field output in color)
Key fields can not be interactively hidden. Parameter FIELDCAT-NO_OUT must be left initial.
For exceptions see the documentation of the FIELDCAT-KEY_SEL parameter.
key_sel (hideable key column)
value set: SPACE, 'X'
only relevant when FIELDCAT-KEY = 'X'
Key field which can be hidden interactively.
The key column sequence cannot be changed interactively by the user.
The output is controlled by the FIELDCAT-NO_OUT parameter analogously to non-key fields.
no_out (field in field list)
value set: SPACE, 'X' 'X' = field is not displayed in the current list.
The user can interactively choose the field for output from the field list.
The user can display the contents of these fields at line level using the 'Detail' function.
See also the 'Detail screen' documentation of the parameter IS_LAYOUT.
tech (technical field)
value set: SPACE, 'X' 'X' = technical field
Field cannot be output in the list and cannot be displayed interactively.
Field can only be used in the field catalog (not in IT_SORT, ...).
emphasize (highlight columns in color)
value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)
'X' = column is colored with the default column highlight color.
'Cxyz' = column is colored with a coded color:
C: Color (coding must begin with C)
x: color number
y: bold
z: inverse
hotspot (column as hotspot)
value set: SPACE, 'X'
'X' = column cells are output as hotspots
fix_column (fix column)
value set: SPACE, 'X'
Not relevant for block lists (output of several lists consecutively)
'X' = column fixed (does not scroll horizontally)
All columns to be fixed must have this flag, starting from the left. If a column without this flag is output, only the columns to the left of this column are fixed. The user can change the column fixing interactively. See also the documentation of the Layout parameter
IS_LAYOUT-NO_KEYFIX of the IMPORTING paramter IS_LAYOUT.
do_sum (sum over column)
value set: SPACE, 'X' 'X' = a sum is to be calculated over this internal output table field.
This function can also be called by the user interactively.
no_sum (sums forbidden)
value set: SPACE, 'X' 'X' = no sum can be calculated over this field, although the data type of the field would allow summing.
input (column ready for input)
Function not available
Format column contents
icon
value set: SPACE, 'X' 'X' = column contents to be output as an icon.
The caller must consider the printability of icons.
symbol
value set: SPACE, 'X' 'X' = column contents are to be output as a symbol.
The internal output table column must be a valid symbol character.
The caller must consider the printability of symbols.
Symbols can usually be printed, but may not always be output correctly, depending on the printer configuration.
just (justification)
value set: SPACE, 'R', 'L', 'C'
Only relevant for fields of data type CHAR or NUMC
' ' = default justification for this data type
'R' = right-justified output
'L' = left-justified output
'C' = centered output
The justification of the column header always follows the justification of the columns. Independent justification of the column neader is not possible.
lzero (leading zeros)
value set: SPACE, 'X'
Only relevant for fields of data type NUMC
ALV outputs NUMC fields right-justified without leading zeros by default.
'X' = output with leading zeros
Note: If a NUMC field is output left-justified or centered by FIELDCAT-JUST, leading zeros are output. If the output of leading zeros is suppressed by a Data Dictionary reference ALPHA conversion exit, the output is always left-justified.
no_sign (no +/- sign) Only relevant for value fields
value set: SPACE, 'X' 'X' = value output without +/ sign
no_zero (suppress zeros) Only relevant for value fields
value set: SPACE, 'X' 'X' = suppress zeros
edit_mask (field formatting)
value set: SPACE, template
template = see documentation of WRITE formatting option USING EDIT MASK template
The output conversion conv can be made by template = '== conv'.
Texts
The following text parameters should be specified for program fields without a Data Dictionary reference. The texts are taken from the Data Dictionary for fields with a Data Dictionary reference. If this is not desired, the text parameters can also be specified. The Data Dictionary texts are then ignored. If the user changes the column width interactively, the column header text with the appropriate length is always used. The interactive function 'Optimize column width' takes account of both the field contents and the column headers: if all field contents are shorter than the shortest column header, the column width depends on the column header.
The 'long field label' is also used in display variant definition, sort, etc. popups.
seltext_l (long field label)
seltext_m (medium field label)
seltext_s (short field label)
reptext_ddic (header)
analogous to the Data element maintenance 'Header'
The specified text is not necessarily output in the list, an optimum among all texts is sought.
ddictxt (specify text)
value set: SPACE, 'L', 'M', 'S'
You can specify with values 'L', 'M', and 'S', the keyword that should always be used as column header. If the column width changes, no attempt is made in this case to find an appropriate header for the new output width.
Parameters for program fields without Data Dictionary reference
see also 'Text' parameters
datatype (data type)
value set: SPACE, Data Dictionary data type (CHAR, NUMC,...)
Only relevant for fields without Data Dictionary reference
Program field data type
ddic_outputlen (external output length)
value set: 0 (initial), n
Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit.
Prerequisites:
FIELDCAT-EDIT_MASK = '==conv'
see also the documentation of the parameter FIELDCAT-EDIT_MASK
FIELDCAT-INTLEN = n
see also the documentation of the parameter FIELDCAT-INTLEN
n = external format field output length
The column width FIELDCAT-OUTPUTLEN need not be the same as the external format output length (FIELDCAT-DDIC_OUTPUTLEN).
intlen (internal output length)
value set: 0 (initial), n
Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit.
Prerequisites:
FIELDCAT-EDIT_MASK = '==conv'
see also the documentation of the parameter FIELDCAT-EDIT_MASK
FIELDCAT-DDIC_OUTPUTLEN = n
see also the documentation of the parameter FIELDCAT-DDIC_OUTPUTLEN
n = internal format field output length
rollname (data element)
value set: SPACE, Data Dictionary data element name
F1 help can be provided for a program field without a Data Dictionary reference, or F1 help which differs from the Data Dictionary help can be provided for a field with a Data Dictionary reference, using this parameter.
When F1 help is called for this field, the documentation of the specified data element is displayed.
If the FIELDCAT-ROLLNAME is initial for fields with a Data Dictionary reference, the documentation of the data element of the referred Data Dictionary field is output.
Others
sp_group (field group key)
value set: SPACE, CHAR(1)
Field group key.
Keys are assigned to group names in the IT_SPECIAL_GROUPS parameter (see also the documentation of the parameter IT_SPECIAL_GROUPS).
When such an assignment is made in the field catalog and in IT_SPECIAL_GROUPS, the fields are grouped correspondingly in the display variant popup.
reprep (Report/Report interface selection criterion)
value set: SPACE, 'X'
Prerequisites:
The system contains the Report/Report interface (function group RSTI, table TRSTI)
Parameter LAYOUT-REPREP = 'X'
(see also the documentation of the parameter LAYOUT-REPREP of the IMPORTING parameter IS_LAYOUT )
'X' = When the Report/Report interface is called, the value of this field is passed in the selected interface start record as a selection criterion.
2.7.2. Default
The following entries are usually sufficient for internal table fields with a reference to a field defined in the Data Dictionary :
fieldname
ref_tabname
Notes:
ALV gets the remaining information from the Data Dictionary.
If no relative column position (COL_POS) is specified, the fields are output in the list in the order in which they were added to the field catalog.
REF_FIELDNAME need only be specifid when the name of the internal table field differs from the name of the referred Data Dictionary field.
Information which is explicitly entered in the field catalog is not overwritten by information from the Data Dictionary.
Priority rule:
Entries in the field catalog have priority over differing entries in the Data Dictionary.
The following entries are usually sufficient for internal table fields without a reference to the Data Dictionary (program fields):
fieldname
outputlen
datatype
seltext_s
seltext_m
seltext_l
Notes:
F1 help can be provided for program fields by assigning a data element to the parameter ROLLNAME.
If the parameters SELTEXT_S, SELTEXT_M, SELTEXT_L, and REPTEXT_DDIC contain appropriate field labels, the program field column headers are also adjusted appropriately when the column width changes.
B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
The Important Parameters are :
I. Export :
i. I_program_name : report id
ii. I_internal_tabname : the internal output table
iii. I_inclname : include or the report name where all the dynamic forms are handled.
II Changing
ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
declared in the type pool SLIS.
Reward points if useful
Regards
Anji
Vijayendra Rao
Posts: 1,699
Questions: 28
Registered: 9/14/04
Forum points: 3,018
Re: ALV
Posted: May 14, 2007 8:29 PM in response to: kotireddy Reply
Hi,
Field catalog defines the attributes and specifies the technical details of the columns displayed in an ALV output.
You can check the following thread to see how to build a field catalog and how to work with ALV.
Message was edited by:
Karthikeyan Pandurangan -
How to download attachments excel file from gmail
hi,
i cant able to download attachments from gmail.com, ly i can able to view. can anyone explain how to download attachments from mail.
rgds
pravinYou can't download attachments with an email account via webmail access using a browser.
You can view attachments in a received email when accessing the account with the iPhone's Mail app and you can save photo attachments to the iPhone's Camera Roll and save PDF attachments to the iBooks app, but all other attachments such as a Word or Excel document can be viewed only. -
Field value is truncated while downloading to excel sheet from ALV report
Hi All,
I developed ALV report and displaying output.
In that output i had a filed VBRP-PRODH filed.
In the output it is coming correctly but while i click downlaod to excel the valus is truncted.
for Example the value for VBRP-PRODH is 03322764170100201
while downlaoding this one to excel it is showing 3322764170100200
Any inputs please..
Regards
JaiWrong forum..post in ABAP
-
Upload and download of excel file in the application server in background
Hi all,
i want to download the excel file from application server into internal table and after processing i have to upload to excel file in the application server in the background mode..
i mean i'll schedule the program in background.
im using FM ALSM_EXCEL_TO_INTERNAL_TABLE its working fine in fore ground but not in back ground.
what method i have to follow ?Hi Ankit,
I think this is not possible to open a Excel-File from the application server because the Excel format before Office 2007 where a binary format (Suffix: .xls). The newer Office file format (Suffix: xlsx) is a zipped XML Format. To read the binary Excel-Format you need an OLE Connection between SAP GUI and Office. But at the application server in background you doesn't have this OLE Connection.
In my opinion you have two possibilities:
1. Convert all files in the CSV format. This file format can be read with open dataset.
2. Upload the files from the presentation server in forground. There are some funktion modules in the standard which can read the xls format. But they have some limits regarding the length of cells content.
My recommendation is solution no. 1. If you know an VBA expert, he can write an Excel-macro which converts all Excel Files in the CSV-Fomat.
Regards
Dirk -
User is not able to download specific excel file in sharepoint
Hi,
Could you please help?
thanks
srabonHi Srabon,
According to your description, my understanding is that you cannot download the excel file from SharePoint.
I recommend to check if the Download a Copy buttons can be used in the Excel web app and in the ribbon of the library.
If both the two buttons cannot work, I recommend to check the permission of the user on the excel file and check if the Information Rights Management is enabled in the library.
When Information Rights Management is enabled in the library and the user has only read permission on the document, then the file cannot be downloaded.
http://office.microsoft.com/en-in/sharepoint-help/apply-information-rights-management-to-a-list-or-library-HA102891460.aspx
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
Taking download into excel from ALV Grid - header is printing in two lines
Hi All,
I have a scenario where I am taking the download from ALV grid to an excel sheet. Now the header of the ALV (column names) is appearing in two lines in the downloaded excel sheet while items (records of the ALV table) are getting displayed in a single line.
This download is taken from the standard download to local file (spreadsheet) button provided by SAP for ALVs.
I am using function module "Reuse_alv_grid_display" for the purpose.
Can somebody provide an idea how I can avoid the header printing in two lines and keep the length as it is.
Thanks in Advance,
ChandanHi..
1. Pass header name in internal table appned first line.
2. after that pass u r data .
3. Use FM. WS_DOWNLOAD
Salil ......
Edited by: salil chavan on Nov 26, 2008 11:07 AM -
Downloads from ALV GRID-Text conversion to dates in EXCEL
When downloading table displays of data from ALV-GRID for excel spreadsheet, we end of with files that have a header and various line ifnromation. IF we manually clear up the display, then we can have the individicual column headers used and force them to text but if we just call the file up as an EXCEL spreadsheet, some part numbers such 12-3465 appear in Excel as Dec-65.
The following is an example of the record (but it is word wrapped within this display limit). In actuality, the verbage enclosed with the <b> represent the start of the lines that have actual display data running out about 90 characters.
Suggestions on how to make the download immediately correct in Excel direct from SAP ALV-GRID without cleaning out the heading lines and manually forcing the affected columns to TEXT format?
thanks
<b>03/02/2007</b> Dynamic List Display 1
<b>Materials-Inforecord Details Report</b>
<b>Purchasing Org: ILMO</b>
<b>Report Run Date:03/02/2007</b> <b>Report Time:14:31:16</b>
<b>Plnt Mat Grp Vendor Name 1 Material Material</b> description Vendor Cat Mfr MPN PC Item Chg. OUn Eq to BUn Net price Per OPUn Inforecord PGr Mv Avg per ValCl
<b>0042 04 106070 BURROWS COMPANY</b> 184110 Glv Exam Ltx Non Ster 02-5001 TILLOTSON 02-5001 CA 2,000 EA 93.40 1 CA 5300006999 999 93.40 2,000 6438there are different options to export to excel which all behave differently, if you go for the menu ->export it differs from the export button from the alv buttonbar.
try the different export to excel options perhaps there is one that behaves the way you want
kind regards
arthur de smidt
Maybe you are looking for
-
How to install HP Deskjet 990cxi on my new laptop running Windows 7 Home Premium on an AMD 64
I have spent two days trying to install my excellent HP Deskjet 990cxi on my new laptop running Win7 Home Premium on an AMD 64-bit processor. I want to do two things: to set the printer up to run direct from a USB port on my laptop. Having done thi
-
Hello, on my N200 0769-EAG I don't get any S-Video output. I tried several cables... I think I installed all drivery correctly, but without any result. I also tried it on linux, but got no answer to TV. Does anyone has an idea? Helpless!!!!!
-
Hi all, Customer request is change idoc status from 29 to 68. 68 = no further processing inbound side 31 = no further processing outbound side if i change status of idoc from 29 to 68 using Fn module IDOC_STATUS_WRITE_TO_DATABASE Data of idoc is vani
-
Proper IMAP prefix for Exchange Server
Does anyone know what the proper IMAP prefix is for Exchange Server? Currently, I have specified "INBOX". On the iPhone, I can see my inbox, and all subfolders, but I can't see any other folders on the same level as inbox. Also, the iPhone has create
-
Importing a WAR project with a resource reference
Just an observation - I'm importing a WAR file in Developer Studio. My war archive includes a web.xml file with a resource-ref entry for a data source. In ealrier Java EE 5 preview versions, the import process would create a web-j2ee-engine.xml fil