Down load into excel file
Hi gurus,
I wanna generate a report that should download the data from the internal table to the presentation server in word formart, but the length of the word file should not be greater than 156 characters as the downloaded data is sent to RBI.
Thanks and Regards,
Alson.
Hi Alson,
you can wrap the text to a length of 156 chars using the function module:-
CALL FUNCTION 'RKD_WORD_WRAP'
for eg if u have any variable v_text which is 1000 chars long then u can give the outputlen = 100. This way u can split 1000 chars into 1000/100 = 10 rows. you can either store these lines in an internal table or it is also possible to store these as separate variables each of length 100 chars .
you can refer to the following code:-
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = v_text
DELIMITER = ' '
outputlen = 156
TABLES
out_lines = i_long_text
EXCEPTIONS
outputlen_too_large = 1
OTHERS = 2.
Plz reward points if useful.
Thanks
Rahul
Similar Messages
-
Truncation of leading Zeros when Down Loading into Excel - OLE Objects
Hi,
Can any one help me on this.
I am using <b>OLE Objects</b> to download Data into Excel Sheet. Data with leading Zeros is getting truncated in Excel.
Ex: Report Output is showing Plant Number as 0002. But when i am downloading to Excel Plant value will become 2 .
I would like to have it as 0002 in Excel.
I have declared Werks as CHAR of 4.I am using OLE Obects for Downloading into Excel Sheet.
I am using "OLE2_OBJECT" I can not use any other FMs to down load to Excel.As i am modifying this program not creating.
Thanks In Advance.
K.Nirmala
Message was edited by: Nirmala ReddyHi Nirmala,
While downloading to excel sheet, u need to change the number format of cell from General to Text, then leading zero's won't get deleted. For that u need to set the property of the cell. Please check this sample code,
INCLUDE OLE2INCL.
tables : zobrent.
data : it_kna1 type table of zobrent with header line.
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
DATA H TYPE I.
DATA: cell1 TYPE ole2_object.
*& Event START-OF-SELECTION
START-OF-SELECTION.
select * from zobrent into table it_kna1
where zopanid = '10001'
and zo_brent = '050'.
start Excel
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 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.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'EDate'.
PERFORM FILL_CELL USING 1 2 1 'Brent'.
PERFORM FILL_CELL USING 1 3 1 'Zopanid'.
PERFORM FILL_CELL USING 1 4 1 'Contract Type'.
PERFORM FILL_CELL USING 1 5 1 'Price Type'.
PERFORM FILL_CELL USING 1 6 1 'Installation Type'.
PERFORM FILL_CELL USING 1 7 1 'Volume'.
PERFORM FILL_CELL USING 1 8 1 'AQ'.
PERFORM FILL_CELL USING 1 9 1 '00000123'.
LOOP AT IT_KNA1.
copy values to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_KNA1-zo_effdat.
PERFORM FILL_CELL USING H 2 0 IT_KNA1-zo_brent.
PERFORM FILL_CELL USING H 3 0 IT_KNA1-zopanid.
ENDLOOP.
CALL METHOD OF h_excel 'Cells' = cell1
EXPORTING
#1 = 1
#2 = 1.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
if sy-subrc eq 0.
write : / 'year'(001).
endif.
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.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL.
SET PROPERTY OF H_F 'Bold' = BOLD .
PERFORM ERR_HDL.
***Changing the format of the cell from General to Text
<b>SET PROPERTY OF H_ZL 'NumberFormat' = '@'.</b>
PERFORM ERR_HDL.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL.
ENDFORM.
*& Form ERR_HDL
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
U just paste this code in a sample program & see.
Please reward, if found helpful. -
Se16 down load into excel sheet problem with PO number
Dear All,
While I download vbak table data using se16 from table VBAK ( using System > List> save --> local File --> Spreadsheet ), I get the PO number converted as error like at it's end, the last digit is becoming zero when po number is of 16 digits. means only the last digit is converted to 0.
For example : se16 -> vbak table -> the po numbers
1238643210249039, when I down load in the excel sheet it is appearing as 1238643210249030
(I means the last digit of the PO number is downloaded with error, it is always a u201C0u201D.
if the PO number is of less than 16 digits... the above problem is not there )
How to correct the error ? How to tell solution to functional consultant ? Can you please suggest me
Do we need to apply any OSS message ?
Thanks in ADVANCE.
Edited by: sam kumar on Dec 8, 2008 5:40 PMHi,
Just found that 'Numbers in Microsoft Excel can never have more than 15 significant digits'.
check this link from Microsoft: [http://support.microsoft.com/kb/158071|http://support.microsoft.com/kb/158071]
check this [http://office.microsoft.com/en-us/excel/HA102748231033.aspx|http://office.microsoft.com/en-us/excel/HA102748231033.aspx]
[http://office.microsoft.com/en-us/excel/HA102748231033.aspx#5|http://office.microsoft.com/en-us/excel/HA102748231033.aspx#5]
What i can suggest is, put a apostrophe (') for the value of first cell content at the beginning.
Use Format painter to apply the same for all values in that column.
Regards
Raj
Edited by: Rajasekhar Dinavahi on Dec 8, 2008 10:59 PM
Edited by: Rajasekhar Dinavahi on Dec 8, 2008 11:00 PM
Edited by: Rajasekhar Dinavahi on Dec 8, 2008 11:05 PM -
Preserving prefixed zeros in down load to excel file
In My application lot of character field have character zero as the starting characters. Like Company code= 0600, Property= 00390898 .
When I do a download from Internal table to excel sheet, this character fields are showing with the zeros in front like 600 & 390898. Is there any way preserve the zeros in the excel sheet ?
Also I would Like to know How can I move the character ( ' ) . If I used ''' then it gives compile error.
If I can prefix this character ( ' ) , the field's will be shown with the zeros.
Thanks for your help.
ManoranjanHi Manoranjan,
What is the data type you are using for the Company Code in your internal table?
You can try this way.Suppose your main internal table is itab1 where in the company code is refering the database table (T001-BUKRS).
Declare one more internal table itab2 with company code as Character data type.
Before downloading to excel move itab1 to itab2 and then try to use that itab2 for downloading. Now your excel sheet will have the numbers with zeros preceeding.
Another option is after downloading to excel, I think you can change the properties of the column through Format Cells->Number tab->Text.
Thanks,
Srinivas -
Loading an Excel file into a Z-Table
Hi Gurus,
Can somebody guide me how to load an excel file into a Z-Table.Hi,
You need to write a ABAP code for this....
The following is the code for loading data into an internal table:
types: begin of ttab,
rec(1000) type c,
end of ttab.
types: begin of tdat,
fld1(10) type c,
fld2(10) type c,
fld3(10) type c,
end of tdat.
data: itab type table of ttab with header line.
data: idat type table of tdat with header line.
data: file_str type string.
parameters: p_file type localfile.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
file_str = p_file.
call function 'GUI_UPLOAD'
exporting
filename = file_str
tables
data_tab = itab
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
delete itab index 1.
loop at itab.
clear idat.
split itab-rec at cl_abap_char_utilities=>horizontal_tab
into idat-fld1
idat-fld2
idat-fld3.
append idat.
endloop.
loop at idat.
write:/ idat-fld1, idat-fld2, idat-fld3.
endloop.
From this internal store it onto the database.....
Sharma one more thing you must have posted this question in ABAP fourum for better results....
Hope it helps,
Thanks,
Happy Life,
Aravind -
I have a fairly large spreadsheet which creates layout floorplan maps based on a table of 3,000+ room locations and various cross-referenced attribute lookup tables which add flags & colour coding to the individual rooms. The maps also
include a few graphic elements beyond simple cells and borders, such as EMF images to indicate stairways, etc.
The sheet works perfectly on my Win7 desktop in Excel 2010:
However when loaded into Excel 2013 on my Win7 laptop, all of the images show as a red cross with the wording "This image cannot currently be displayed", thus:
Any ideas, as this looks like a bug in Excel 2013? Thanks.
AndreHi Andre,
What happens if you reimport the images from original source?
Try Running Excel Program firstly, and then open this file within Excel (File->Open).Also if you have Excel 2010 installed , try to open the file using Excel 2010, copy an paste the content to a blank Excel file.
You can also try to check the option 'Disable hardware graphics acceleration'. File->Options->Advanced ...
Wind Zhang
TechNet Community Support -
Hi all,
I am sorry i am asking this question here but i cant find TOAD specific thread.
I want to load an excel file from OS to my database table using TOAD.
Can anyone tell me how to do this?
Thanks
Edited by: user10380680 on Nov 6, 2008 3:17 PMHi,
Check the steps given by "sbmk_design " using TOAD.
How to load excel-csv file into oracle database
Else go for
SQL LOADER
http://www.adp-gmbh.ch/ora/tools/sql_loader/example_3.html
http://lbd.epfl.ch/f/teaching/courses/oracle8i/server.815/a67792/ch04.htm
- Pavan Kumar N -
Procedure to save the output of a query into excel file or flat file
Procedure to save the output of a query into excel file or flat file
I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
I have run the query --
DECLARE @cmd VARCHAR(255)
SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
Exec xp_cmdshell @cmd
error message--
SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
NULL
Goel.AmanHello,
-T:
Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
login_id, and password are not required. If
–T is not specified, you need to specify
–U and –P to successfully log in.
-U:
Specifies the login ID used to connect to SQL Server.
Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
-T option (trusted connection) instead of the
user name and password combination
I would suggest you take a look at the following article:
bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
A similar thread regarding this issue:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
Regards,
Elvis Long
TechNet Community Support -
How to download alv grid output(with field catalog) into excel file format
Hi all,
How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
Please help.
Regards,
Satya.Hi,
On list where alv is displayed, select export icon( green color -> ),select spread sheet.
This will display records in Excel sheet. -
How to convert alv list into excel file?
Hi Experts,
i have created one report for Due Date Analysis.
Now My output is displaying in ALV list. But I need to convert the data which in alv list into Excel File. then only i have to send the Excel File to the Customer Thro Email.
So i need the Function Module to Convert the Data into Excel File.
Thanks,
Neptune.MHi,
U can use function module gui_download.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'C:\Transportaionlane.XLS'
filetype = 'DAT'
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TABLES
ata_tab = t_trans_lane_dis[]
OTHERS = 22
if u want with header then pass the header.
regards
Ahasan -
How to send other language data into excel file in attachment thru mail
Hi - ,
I have to send other language data (russian) into excel file and send as an attachment through e-mail.
I had used F.M SO_NEW_DOCUMENT_ATT_SEND_API1 to send email.
In internal table , it is in correct format, but when using SO_NEW_DOCUMENT_ATT_SEND_API1, the excel file sent has junk characters in it.
Can u please help me on this?
Thanks,
GyanarajHi ,
Can anyone help me on this.
Thanks,
Gyanaraj -
Reg: Download report into Excel file
Hi All,
While downloading the ALV report into excel file(System -> List -> Save -> Local file) or (List -> Export -> Local file), i cannot download full report in to excel. Even though the report contains just 200 rows(I can able to download about 90 lines).
Some reports can able to download all the data, even the report is very big. Currently I am blind to solve, anyone can help me to solve this issue.
Thanks in advance.The most elegant way of downloading ALV display data to EXCEL is displaying the excel in the SAP GUI screen itself. Select "Excel in Place" and then save it from there. Before that you need to let the VB script of SAP know as trusted macro. This is done by opening a blank excel file then go to Tools > options > Security > Macro Security > Trusted Publishers (tab) > (check) Trust access to Visual Basic Project. This activation is one time activation. Once you do this you can see ALV display exactly like in normal ALV with all the colors fields etc.
-
Convert report output into excel file
hiii,
Can we convert output of report into excel file format?
Plz tell me the.
Thanks in advanceHello,
http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b13895/orbr_paptoexcel.htm
29 Building a Report for Spreadsheet Output
Regards -
Stuck - load the Excel file dynamically with different columns and worksheet names
I have a situation where I want to load the Excel file dynamically, and the excel file have different columns or even worksheet name. Any idea how I could
approach this? I believe there's no way to modify the meta data (specifically the mapping) in the data flow.Hi Chimumu,
The SSIS stock adapters don't supporting dynamic column mapping, to achieve your goal, you need to use Script Task/Component to read the Excel sheet name and the columns in the worksheet, and then map to the output columns of the script component. You can
also refer to the following blogs:
http://micktechblog.blogspot.com/2011/06/ssis-excel-import-with-unknown-number.html
http://wikiprogrammer.wordpress.com/2011/04/08/dynamic-column-mapping-in-ssis-part-1/
Regards,
Mike Yin
TechNet Community Support -
hello...i'm using labview 8.5 for my final year project..can i convert the graph in the labview into excel file by using this labview version? please...help me....ahaksss
Solved!
Go to Solution.If you just want the data, then this may be an option (I'm assuming this works in LV 8.5):
Right click the graph, and select Export -> Export Data to Excel
You need to have Excel on your computer to get this option.
Other options:
o Save your data to a file using Comma (or Tab) Delimited values - open file in Excel
o Use Report Generator functions to create an Excel file
steve
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
Maybe you are looking for
-
OfficeJet all-in-one J6400 Not receiving incoming FAX
Hello, I have OfficeJet J6400 all in one in my office. I'm not receiving faxes from anywhere-- companies, from my home. Strangely, the only fax I receive is the Fax Test reply from HP when I do the 877-HP-FAXME test. I've tried the setup in all
-
Ok, I've been fighting with this server for two nights now and I'm about to punt it! When I was running WLS 7.0 SP1 under NT, life was great. Now that I've turfed that box and started running WLS 7.0 SP2 under red hat 7.2, all hell broke loose! :< My
-
RSR_OLAP_BADI - Correct processed compute method results in "no app. data"
Hi, iu2019m trying to impl. Virtual key figures using the badi RSR_OLAP_BADI Problem: Data which are correctly processed by the Compute method disappears and the query results in u201CNo applicable data foundu201D. By using debugging I can see that t
-
Manual module connection​s
Hallo again! Is it possible to connect modules manually. I mean the auto-route function is nice as long as you do not want right angles. I want to connect two modules around the corner with parallel connections. Thanks for every help. By the way, thi
-
I bought my nokia 6303i classic two years back from a nokia priority dealer at Mumbai. After 6 month my phone had a network problem for two days. And automatically fixed the problem itself. After that i was using this phone without any problem. Recen