10-10-2005 6:20 AM
hi all,
i am doing a program which has to save the text file in the application server. can u tell me how to locate the file after it is been saved to the server. so that i can check whether it is saved correctly or not.
10-10-2005 6:27 AM
Goto transaction <b>AL11</b> then choose the file path u gave example
interface/...
U can go and check like this.
Also sample code for downloading to unix
DATA: v_filepht LIKE FILENAME-FILEINTERN, "Physical file for p_fnam2
* Open the file in application server
OPEN DATASET v_filepht FOR OUTPUT IN TEXT MODE.
IF sy-subrc <> 0.
MESSAGE s185 WITH v_filepht. " File opening error
LEAVE LIST-PROCESSING.
ENDIF.
LOOP AT i_logfile INTO w_logfile.
TRANSFER w_logfile TO v_filepht.
CLEAR w_logfile.
ENDLOOP.
IF sy-subrc = 0.
WRITE:/ text-055, v_filepht, text-056. " File successfully created
ELSE.
WRITE:/ text-057, v_filepht. " Error creating file
ENDIF.
* Closing the file
CLOSE DATASET v_filepht.
Hope this helps.
10-10-2005 6:29 AM
Hi,
fm EPS_GET_DIRECTORY_LISTING
or fm EPS_GET_FILE_ATTRIBUTES
regards Andreas
10-10-2005 11:25 AM
hi all,
first of all i am trying to print the values in presentation server. i have to save the values in a .txt file. i been able to get the values in a text file but i am not able to get the tabs. and also the titles should be aligned. can somebody help me in this.
10-10-2005 1:08 PM
Hi,
do you need to save the file in txt format?
can you use a Excel format?
If yes, you can use the function module XXL_SIMPLE_API to export the data in data sheet, in this way you don't care about title, and layout.
bye enzo
10-11-2005 1:17 PM
hi all,
i have to strictly download the file in '.txt' format. i am able to get the file saved. i need to save it as cols and rows. please suggest me if u know.... thanx for ur valuable time and suggestions.
Message was edited by: Ateeq K
10-11-2005 1:20 PM
Hi
You can save your file as CSV format using ; to separate the field of cols.
Max
10-11-2005 1:34 PM
let me understand your requirement.
you have a internal table which you want to store it in application server and when you read it back download it to presentation server it should be openable in excel right?
and also you wanted to download it in presentation server only with .txt extension.
if yes just try this,
data: temp type string .
loop at itab .
clear temp .
concatenate itab-field1 CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
itab-field2
CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
itab-field3 into temp .
concatenate temp CL_ABAP_CHAR_UTILITIES=>CR_LF into temp .
" now transfer tem instead of the itab work area to dataset
when you read this and download it using gui_download you can download it as .txt file but still be able to open it in excel with proper coloumn row formatting. (what i have done is created excel text tab delimited file).
Hope this helps.
Regards
Raja
10-11-2005 2:32 PM
hai raj,
let me tell u clearly, i have to download the file in application server. first i am verifying it is saved properly or not in the presentation server... after that i gonna move the file to application server. the file should be saved in text (tab delimited) file. i am able to get the file saved in text format but the tab delimited part cannot be solved by me...
thanx for ur valuable suggestion and time....one and all
10-11-2005 2:48 PM
Hi
You can upload the file, can't you?
Now I don't understand which is your true problem: you can't write a file with the right tab or you can't interpret the tab when you're reading the file?
Max
10-10-2005 1:04 PM
HI Ateeq
to find a file on applicatoin server (the server it self) you can use some function module eg.
F4_DXFILENAME_TOPRECURSION
F4_FILENAME_SERVER
bye enzo