Posting an Excel file to a FTP Server
Hi,
I have a requirement, where I have to convert the contents of an internal table to an excel file, along with header details and put that file to a FTP Server.
I am able to create an excel file in FTP server, using function module FTP_R3_TO_SERVER and transfer contents of my internal table. But the contents of my internal table are getting copied to one column. How do I get the contents in different columns?
Also how do I get the header details?
Hi,
you can simply create a comma-separated text file on your SAP application server, line by line, each column separated by a semicolon (;). That file can later easily be opened with Excel. Afther the file has been created you can send it to the remote FTP server.
HTH!
Similar Messages
-
Transfer Excel file to external FTP server via PGP
Hi SDN!
I have build an scheduled report to generated an Excel-file from an internal table and saved it in the database. Now my task is to upload it to an external FTP Server of a partner company. The File contains sensible data and shall be encrypted via PGP.
How can i upload to an external FTP server and before that, encrypt the file with PGP? I appreciate any help and look forward to reward some great posts.
Thanks for your help!
Edited by: Steffen Wieprecht on Aug 7, 2008 1:00 PMI found a solution myself, maybe someone is interrested:
I installed a WS FTP Professional on a Server.
Onto this server I wrote the files that have to be ftp-uploaded into one specific folder.
A Perl Script in the scheduled tasks of the machine checks if a new file is in the folder and starts the upload.
In WS FTP the site upload is defined with all PGP Keys so they are store secure.
This solution can be used by any programming language that is able to write files in the upload folder.
Best Regards,
Steffen -
Excel file format to FTP server
hi all,
By using FM's i am able to upload data from SAP to FTP in .XLS format
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
handle = w_hdl
fname = 'test.xls' "file path of destination system
character_mode = 'X'
TABLES
text = it_data1
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
RAISING invalid_output_file.
ENDIF.
While viewing this excel sheet a popup is triggering as ''The file you are trying to open is in different format than specificed by the extention.Verify the fileis not corruptedabd is from a trusted source before opening the file .Do you want to open the file now ? Yes or No "
If Yes selected data is opened correctly only but i need to ignore this message .
When i see the SAVE AS TYPE its showing text format and FILENAME as test.xls
When i change SAVE AS TYPE to EXCEL 97-2003 its fine.but i need this should be updated automatical when i send from SAP itself.Sachin, this question is asked several times each week in the forum. There are solutions, in short: DOI or OLE for dialog, external softwares for other cases. As said by breakpoint, you'll be able to process these files more easily and quickly, if they are saved under other (text) formats: txt, csv, xml, xslx.
Please search and read these posts and revert back if any question. -
Excel file cannot connect to server, offline copy
Good day,
I have a user in my company's portal (SharePoint 2007) that cannot upload changes made in excel file.
He needs to have the compatibility view active in IE in order to be able to open the documents.
If he does not have the compatibility view of IE for the application he gets an error saying that "cannot connect to the server".
With the compatibility view the user is able to open documents, but what happens is that the excel file connection to the server.
So changes to the excel file are not submitted to the server.
Does anyone have any idea of how to fix this issue?
Is there any other information i can provide that can help on this issue?
Thank you.What is the OS version?
What is the Office version ?
Regards,
Pratik Vyas | SharePoint Consultant |
http://sharepointpratik.blogspot.com
Posting is provided AS IS with no warranties, and confers no rights
Please remember to click Mark As Answer if a post solves your problem or
Vote As Helpful if it was useful. -
Help Fetching files from an FTP server into a DBase or local folder
Hello Gurus!
I need help to automate or design/write an app capable of (replace a manual process) reading log files in an ftp server folder, this log files are called CDR (Call Detail Record) and named as follow cdr.txt.20020221010000 meaning that this log file was created on 2002/02/21 at 01:00:00.
This CDR log files are generated every hour by a Lucent telephone switch using a software/program called EXS ExchangePlus in ASCII format (fixed length delaminated, Char data type). EXS ExchangePlus writes a record in this CDR/log files after the call is completed, i.e. Calling_Number, Called_Number, Date_connect (yyyymmdd), Time_connect (hhmmss), Charged_time (hhmmss, duration of the call), and so on.
The manual process I am using now is:
1. Log in the ftp server into the folder where the CDRs log files are, located the latest generated CDRs log files and downloaded them into a local folder/directory. Normally I download the CDR for full day or 24 CDRs log files.
1a. Optionally sometimes I used a program called VEdit compiled/gather all 24 CDRs into a single file.
2. Once I have downloaded the CDRs I want to process (normally I process a full day 24 CDRs) I imported then into a Data Base temp table, where then I do the conversion of data types (i.e. Dates and times fields from char type -> to ->Date type) and calculations for billing purposes.
So if somebody can help with this, I would really appreciated ideas or any kind of information on how to automated this process.
I�m familiar with Java2 platform (using JDeveloper ) so if somebody has done something like this before using java, this would very helpful. Or Maybe using Visual Basic 6.0 would help too.
Thanks Gurus, and I look forward to hear from you soon!
Alf Pathros!Thanks for the idea, even though an example would help me more.
I already found the FTPClient class.
I also would like to knwo if there is a away Ican append/merged various files CDRs into a single/one to then dump/import it into the database -
Polling of the current file from multiple files in the FTP Server
Hello Experts
I am working on a file to file scenario.We have to poll the file from the FTP server which may contain multiple files with different creation dates.The requirement is to poll only the file created in the current date.Could anyone throw some light on this.
Thanks & Regards
SabyasachiHi Sabyasachi,
You can archive the files that you do not need into another folder manually for the first time.
Later you can schedule the file adapter to poll the folder only once in a day (Poll INterval = 86400 secs)
Do not forget to set the option to archive/delete the file that are already processed.
Regards,
Ravi Kanth Talagana -
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 -
Sender File Adapter - remote FTP server program execution
Hi all,
I have a scenario
X12 -> XI -> File
where sender File adapter is used. The input file is X12 txt document which needs to be converted into X12 xml format. I have created astylus studio XSLT mapping which uses Convertor to convert this txt file to X12 XML.
I don't know how to configure sender file adpater to run this mapping on the source file before picking it up. have created a windows batch file on the FTP server which runs tis XSLT mapping on the txt file and replaces it with X12 format xml. This batch file uses command line parameters of stylus studio to run XSLT mapping on input txt file and generates an xml.
I am not sure how to run this mapping on the input file before processing starts in PI file adapater.
I tried running command line parameters of Sender file adapter but that didn't worked.
Please help.
Thanks
-KulwantHi, Kulwant:
Looks like you would like to execute your mapping program before file adapter pick it up.
Right ? for one interface, it seems out of the XI scope, however if this is your requirement, you can separate into two interfaces:
The first interface is file to file scenario, it is used to execute your mapping program:
The file sender just pick up the txt file, send to integration engine.
Your Message Mapping program need to specify your XSLT mapping, after the mapping, the message is XML format,
then you will use file receiver to send it to certain directory.
Now the XML format file is your input of your second interface.
Regards.
Liang -
How to archive files in another ftp server?
Hi,gurus:
My scenario is file to file and my sender adapter is ftp adapter.
Now I want to archive the send file in another ftp server,how can I implement it?
There is a parameter "Archive files on FTP server" when I choose the processing mode "archive".What's it's use?Thanks in advance.Hi,Santhosh:
Thanks for your reply.
I have checked your blog before,and it is very useful for me.
I still have a problem about command line.
In an sap note,I found the principle of the execution of the command line is like below code:
import java.util.*;
import java.io.*;
public class test {
public static void main(String args[]) {
try {
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("C:/data/test.bat <param1> <param2>");
} catch (Exception e) {
e.printStackTrace();
But you know this method has restriction.If my bat file has many commands,it only execute a part of commands(sometimes 8,sometimes 9 ).
My bat file is like below:
echo open 192.168.67.149 >c:
data
copyResult.txt
echo <username> >>c:
data
copyResult.txt
echo <password> >>c:
data
copyResult.txt
echo cd /receive>>c:
data
copyResult.txt
echo get %2>>c:
data
copyResult.txt
echo cd /ok>>c:
data
copyResult.txt
echo put %2>>c:
data
copyResult.txt
echo cd /archive>>c:
data
copyResult.txt
echo delete send.txt>>c:
data
copyResult.txt
echo quit >>c:
data
copyResult.txt
ftp -s:c:
data
copyResult.txt
del %2
I wanna merge all the "echo" in one command,so it may execute successfully,but I don't know the method.Any ideas? -
Excel file creation on application server
Gurus,
I have seen a lot of threads on excel file creation in application server, but failed to see if anyone had a solution.
Problem: In background execution I need to create an excel sheet on application server, the data would be contained in internal table, The FM like WS_DOWNLOAD etc..cannot support these as they have GUI component.
All the documentation that I have been through states to use dataset which saves the file in.csv or txt format seperated by delimiter, is it possible to save as a true excel file.
same as this thread:
Re: Excel download in Application Server
let me know,
Thanks in advance .* Write column headers, if required
IF column_headers = 'X'.
* ... override field names with LABELS_IN, if specified
IF NOT labels_in[] IS INITIAL.
DESCRIBE TABLE labels_in LINES num_lines.
IF num_lines > num_fields.
RAISE too_many_labels.
ELSEIF num_lines < num_fields.
RAISE too_few_labels.
ENDIF.
ASSIGN COMPONENT 1 OF STRUCTURE labels_in TO <f>.
LOOP AT fields_in.
READ TABLE labels_in INDEX sy-tabix.
fields_in-name = labels_in-name.
MODIFY fields_in.
ENDLOOP.
ENDIF.
* ...write column headers to file...
position = 0.
LOOP AT fields_in.
IF fixed_length NE space.
*** INSERT: DAR was here for Issue 17817 --------------- dar012009 ---v
field_len = STRLEN( fields_in-name ).
*** INSERT: DAR was here for Issue 17817 --------------- dar012009 ---^
DO fields_in-len TIMES.
offset = sy-index - 1.
* IF sy-index > 15. dar012009
IF sy-index > field_len. "dar012009
line_out+position(1) = space.
ELSEIF fields_in-name+offset(1) NE space.
line_out+position(1) = fields_in-name+offset(1).
ELSE.
line_out+position(1) = space.
ENDIF.
position = position + 1.
ENDDO.
ELSE.
CONCATENATE line_out fields_in-name INTO line_out
SEPARATED BY delimiter.
ENDIF.
ENDLOOP.
IF fixed_length EQ space.
SHIFT line_out LEFT DELETING LEADING delimiter.
ENDIF.
IF no_write IS INITIAL. "dar041505
TRANSFER line_out TO file_out.
ENDIF. "dar041505
data_out = line_out. APPEND data_out. "dar041505
ENDIF.
* Write lines to file...
LOOP AT data_in.
CLEAR line_out.
position = 0.
DO num_fields TIMES.
ASSIGN COMPONENT sy-index OF STRUCTURE data_in TO <f>. -
Regarding receiver FILE adapter, REMOTE FTP server
Hi All,
The scenario was to get XML file from a local FTP server and to place that XML file in REMOTE FTP server, which we dont have any control over that REMOTE FTP,
While executing the scenario it is successfully picked the file and processed and it was success in SXMB_MONI, but when we see the Communication Chaneel of the receiver adapter it is generating the following error..
Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: ConnectException: Connection timed out: connect
Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: ConnectException: Connection timed out: connect
clarifications needed ASAP
regards,
Kishore.Hi,
Verify the Host details of the Remote FTP.
Try to ping the Remote host as below
Goto > start>Run --->type cmd and give the command as below
c:\>ping <host details or IP address> press enter and see if you get the successful communication response.
If its not it indicates that the connection is not setup.
Ask you FTP administrators to look into connectivity issue for it.
Thanks
Swarup -
Hai,
I want to read the files present in FTP server without downloading.
Using (org.apache.commons.net.ftp.*); this package I can view the files and directories present in particular host and can even download.
But I want to read the files in directories without downloading them for displaying the file contents in my JApplet.
How can I achieve this?
Waiting for reply...
DhuraiDHURAI wrote:
How I have to specify the path (user name,password) for reading?If you are using the Apache Commons FTP package, as you said, then you don't specify a path. And the path you don't specify wouldn't contain a user name and password because you use those when you make the connection to the server. All of this is covered in the documentation. -
I'm using odiscpget to extract file from remote FTP server and i have a requirement to archive the file after successful extraction into archive directory in the same server.
Do i have an utility to perform a file move in remote server from ODI?
Thanks in Advanceodiscpput will look for a file in local directory to move to remote server isn't it?Yes .. it is.
If you want to do file operation on the remote server only then you need to write your own code for it. -
Excel File downloaded from application server is also opening in notepad
Hi Friends,
While downlaoding an excel file from the application server,we are able to open in notepad also.But this does not conatin the excel properties and hence happening.File should only oopen with excel and no other file type
Can any open help on this
ld_file = '/usr/sap/trans/abap/HR_DATA.xls'.
OPEN DATASET ld_file FOR OUTPUT in text mode ENCODING DEFAULT .
IF sy-subrc = 0.
LOOP AT int_final.
CLEAR wa_string.
CONCATENATE int_final-employee_sno int_final-employee_code INTO wa_string SEPARATED BY con_tab.
CONCATENATE wa_string int_final-first_name INTO wa_string SEPARATED BY con_tab.
please help...
Edited by: Neliea on Oct 29, 2009 1:11 PMHi,
Please refer to these links.
[url]Re: Internal table to excel download?;url]
[url]Re: Transfer from Internal Table to EXCEL file...;url]
Regards,
Aditya -
Want to open a excel file from remote Linux server through ADF UI
HI,
My scenario is a excel template is located in LInux server in a directory. Then I need to download this excel file when I click on a hyperLink which will call the method mentioned below.
however, below method works fine if the file is on windows machine/server but not if on Linux machine. In case of LInux it gives junk file.
please suggest if any solution exists.
Thanks,
SachinModerator Action and Advice:
@ user8106712,
Your post has been split away from the completed 2006 thread you had resurrected.
Hijacking someone else's discussion is poor forum etiquette.
When you do that you are saying:
"My issue is more important than yours. Ignore all that earlier stuff and just pay attention to me."
If you want considerate responses, always start your own new post.
You may also need to occasionally review the OTN Forums FAQ that is linked at the top corner of every page.
Maybe you are looking for
-
How do I Loop through a recordset using PHP
I have a recordset containing a MySql table with 5 columns, each one containing an email address of an official in a club. Each row represents a different club, and each column a different type of official. The first column represents chairmen, the n
-
Dodge and Burn Tool basicly stopped working.
For some reason the Dodge and Burn Tool in Lightrooom 5.4 basicly stopped working. It will only make a slight adjustment no matter how much I change the exposure value. Does anyone know what could be causing this?
-
Problem with web template (WAD ) in BI7
Hi All , I have designed a web template where i have added a buttongroup which contains some buttons like open,save as, print,export to excel,filter,settings where in some of the buttons functionality is not working properly Those are Filter,Open,Set
-
This problem happens after about 10-15 application restarts during development phase. I have read somewhere that this was a known bug in 11g versions of JDev and its integrated WLS (10.3.5 or 10.3.6?). I have then increased memory parameters in confi
-
Error Message when Exporting to Wave, Aiff or SD2
I can export to mp3 no problem but when i try to export to wave, aiff or sd2 files i get the following message: Could Not Create File - The export file could not be created. This may have occurred because there is insufficient disk space, or there mi