How to display a file from Application server without downloading it to local drive
I want to dispaly a file from Application server without downloading it to my local system.
i tried the below method but it didn't work.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
APPLICATION = L_FILE
DEFAULT_DIRECTORY = L_DIR
Hi,
Use open dataset to read file from application server.
try like this sample code:
data : p_file like ibipparms-path.
data : rec(350) type c.
data: g_delimiter(1) type c value ','.
maintain the file path in p_file. then
open dataset p_file for input in text mode encoding default.
IF SY-SUBRC = 0.
do n times.
READ dataset p_file into rec.
split rec at g_delimiter into your internal table fields like it-id it-name it-age.
append it.
clear it.
enddo.
close dataset p_file.
Now you have the data in internal table it.
Similar Messages
-
How to upload XML file from Application server.
Hi,
How to upload XML file from Application server.Please tell me as early as possible.
Regards,
Sagar.Hi,
parameters : p_file type ibipparms-path obligatory.
***DOWNLOAD---->SAP INTO EXCEL
filename1 = p_file.
call function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = filename1
filetype = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = it_stock
FIELDNAMES =
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
others = 22
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Regards,
Deepthi. -
How to delete a file from application server?
Hi gurus,
i want delete a file from application server . can any one tell me the BAPI/Fm .
thanks in advanceSee the replies of the thread;
How to delete File from the Application Server,ABAP
But i can smell something fishy in both The specified item was not found. and The specified item was not found. style of posting questions. Also both of you have similar questions in your profile....
Hmmm, Mods have to take care of the Rest...
Regards
Karthik D -
How to copy a file from application server to local system
Guys,
Need to copy a file from application server to local system.Is there an FM for the same.
Tried searching for it but couldn't find anything useful.
Code snippets will be highly appreciated.
Warm Regards,
P.
Moderator message: very frequently asked and answered question, obviously you did not search thoroughly, all points removed.
Edited by: Thomas Zloch on Dec 3, 2010 4:48 PMhi,
You can use the transactions CG3Y or through program u can do like this..
DATA: BEGIN OF IT_FILE OCCURS 0,
LINE TYPE STRING,
END OF IT_FILE.
OPEN DATASET <file_name> FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC IS INITIAL.
DO.
READ DATASET<file_name> INTO IT_FILE-LINE.
IF SY-SUBRC = 0.
APPEND IT_FILE.
CLEAR IT_FILE.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET <file_name>.
Download it to local system using FM - GUI_DOWNLOAD -
How to upload .CSV file from Application Server
Hi Experts,
How to upload .CSV file separated by ',' from Application server to an internal table.
Invoice No,Cust No,Item Type,Invoice Date,days,Discount Amount,Gross Amount,Sales Amount,Customer Order No.,Group,Pay Terms
546162,3233,1,9/4/2007,11,26.79,5358.75,5358.75,11264,HRS,11
546163,2645,1,9/4/2007,11,3.07,305.25,305.25,10781,C,11
Actually I read some already answered posts. But still I have some doubts.
Can anybody please send me the code.
Thanks in Advance.Hi Priya,
Check this code
Yhe logic used here is as follows,
Get all the data into an internal table in the simple format ie: a row with one field contains an entire line
After getting the data, we split each line of the table on every occurrence of the delimiter (comma in your case)
Here, I have named the fields as field01, field02 etc, you could use your own names according to your requirement
parameters: p_file(512).
DATA : BEGIN OF ITAB OCCURS 0,
COL1(1024) TYPE C,
END OF ITAB,
WA_ITAB LIKE LINE OF ITAB.
DATA: BEGIN OF ITAB_2 OCCURS 0,
FIELD01(256),
FIELD02(256),
FIELD03(256),
FIELD04(256),
FIELD05(256),
FIELD06(256),
FIELD07(256),
FIELD08(256),
FIELD09(256),
FIELD10(256),
FIELD11(256),
FIELD12(256),
FIELD13(256),
FIELD14(256),
FIELD15(256),
FIELD16(256),
END OF ITAB_2.
DATA: WA_2 LIKE LINE OF ITAB_2.
OPEN DATASET p_FILE FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.
IF SY-SUBRC = 8.
WRITE:/ 'File' , p_FILE , 'cannot be opened'.
LV_LEAVEPGM = 'X'.
EXIT.
ENDIF.
WHILE SY-SUBRC <> 4.
READ DATASET p_FILE INTO WA_ITAB.
APPEND WA_ITAB TO ITAB.
ENDWHILE.
CLOSE DATASET p_FILE.
LOOP AT ITAB INTO WA_ITAB.
SPLIT WA_ITAB-COL1 AT ',' " where comma is ur demiliter
INTO WA_2-FIELD01 WA_2-FIELD02 WA_2-FIELD03 WA_2-FIELD04
WA_2-FIELD05 WA_2-FIELD06 WA_2-FIELD07 WA_2-FIELD08 WA_2-FIELD09
WA_2-FIELD10 WA_2-FIELD11 WA_2-FIELD12 WA_2-FIELD13 WA_2-FIELD14
WA_2-FIELD15 WA_2-FIELD16.
APPEND WA_2 TO ITAB_2.
CLEAR WA_2.
ENDLOOP.
Message was edited by:
Kris Donald -
How to upload a file from application server?
Hi experts,
I am going to create a conversion program using call function 'HR_INFOTYPE_OPERATION'.In my conversion I am going to upload per_area,emp_subgroup,payroll_area,work contract and orgn_key for the infotype IT0001 and the input file is from application server.I am using check boxes for these 5 fields and for the fields I am selecting the checkbox.I want to upload the datas in the IT0001 using HR_INFOTYPE_OPERATION.That is using the call transaction function.Its urgent give me some ideas or codings for that infotype updating.
Thanks,
Sakthi.CHi
you can use <b>open dataset for input</b>,<b>Read dataset</b> for uploading data from a application server.
Message was edited by:
Raghu Reddy -
How to display HTML file from Unix server on UI at runtime
Hi Experts,
My requirement is to display HTML files, related to some particular person, on UI. The file is existing on a separate UNIX server and a file related to one person may have a lot of attached files as well , as is the case generally with HTML files, including pictures etc. So it is no use transferring file on my CRM system, as the files are kept separately on this UNIX server which is particularly for this kind of storage.
I am able to show files residing on MIME repository ( I created some new HTML files ) of my CRM system on UI. but I don't know how to go ahead with this particular requirement.
One idea is that I can map one folder of my application server to that unix server so that I can see the HTML files in this particular folder. but I don't know how to map MIME repository folder to application server directory or directly to the UNIX server .
Please advise. Is my approach correct or is there any other way ?
thanks in advance.
Regards,
VikasMaybe this is too simple, but have you got an HTTP server on the UNIX machine? You could simply link the URL into you CRM application and display the contents directly from UNIX.
cheers Carsten -
Delete file from application server
Hi,
Can any one tell me how to delete a file from application server?
Thanks,
Rahul.Basic question, please search for available information.
Thread locked.
Thomas -
How to download file from application server
Hi Experts,
I developed report and execute in background mode. for this i used Open dataset transfer and close dataset . i got the requried output . But in this case user want downloaded file on presentation server so can anyone tell me How to download file from application server?
i know it is possible through Tcode CG3Y. but i want code in program.This code will download a file to your Client package by package, so it will also work for huge files.
*& Report ZBI_DOWNLOAD_APPSERVER_FILE
REPORT zbi_download_appserver_file.
PARAMETERS: lv_as_fn TYPE sapb-sappfad
DEFAULT '/usr/sap/WBP/DVEBMGS00/work/ZBSPL_R01.CSV'.
PARAMETERS: lv_cl_fn TYPE string
DEFAULT 'C:\Users\atsvioli\Desktop\Budget Backups\ZBSPL_R01.CSV'.
START-OF-SELECTION.
CONSTANTS blocksize TYPE i VALUE 524287.
CONSTANTS packagesize TYPE i VALUE 8.
TYPES ty_datablock(blocksize) TYPE x.
DATA lv_fil TYPE epsf-epsfilnam.
DATA lv_dir TYPE epsf-epsdirnam.
DATA ls_data TYPE ty_datablock.
DATA lt_data TYPE STANDARD TABLE OF ty_datablock.
DATA lv_block_len TYPE i.
DATA lv_package_len TYPE i.
DATA lv_subrc TYPE sy-subrc.
DATA lv_msgv1 LIKE sy-msgv1.
DATA lv_processed_so_far TYPE p.
DATA lv_append TYPE c.
DATA lv_status TYPE string.
DATA lv_filesize TYPE p.
DATA lv_percent TYPE i.
"Determine size
SPLIT lv_as_fn AT '/' INTO lv_dir lv_fil.
CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
EXPORTING
file_name = lv_fil
dir_name = lv_dir
IMPORTING
file_size_long = lv_filesize.
"Open the file on application server
OPEN DATASET lv_as_fn FOR INPUT IN BINARY MODE MESSAGE lv_msgv1.
IF sy-subrc <> 0.
MESSAGE e048(cms) WITH lv_as_fn lv_msgv1 RAISING file_read_error.
EXIT.
ENDIF.
lv_processed_so_far = 0.
DO.
REFRESH lt_data.
lv_package_len = 0.
DO packagesize TIMES.
CLEAR ls_data.
CLEAR lv_block_len.
READ DATASET lv_as_fn INTO ls_data MAXIMUM LENGTH blocksize LENGTH lv_block_len.
lv_subrc = sy-subrc.
IF lv_block_len > 0.
lv_package_len = lv_package_len + lv_block_len.
APPEND ls_data TO lt_data.
ENDIF.
"End of file
IF lv_subrc <> 0.
EXIT.
ENDIF.
ENDDO.
IF lv_package_len > 0.
"Put file to client
IF lv_processed_so_far = 0.
lv_append = ' '.
ELSE.
lv_append = 'X'.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = lv_package_len
filename = lv_cl_fn
filetype = 'BIN'
append = lv_append
show_transfer_status = abap_false
TABLES
data_tab = lt_data.
lv_processed_so_far = lv_processed_so_far + lv_package_len.
"Status display
lv_percent = lv_processed_so_far * 100 / lv_filesize.
lv_status = |{ lv_percent }% - { lv_processed_so_far } bytes downloaded of { lv_filesize }|.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING "percentage = lv_percent - will make it fash
text = lv_status.
ENDIF.
"End of file
IF lv_subrc <> 0.
EXIT.
ENDIF.
ENDDO.
"Close the file on application server
CLOSE DATASET lv_as_fn. -
How to delete file from application server(Unix)
Hi All,
Using the below code downloading a file from application server(Unix) to client machine. I want to delete the file from application server once it is downloaded to client
We work on Forms 11.1.1.4.0 and Oracle DB 10g. Client machine are Windows 7.
BEGIN
IF webutil_file_transfer.AS_to_Client
(clientFile => Name_In('global.g_file_name')
,serverFile => ls_AppServer_Loc)THEN
message('Data exported Successfully');
ELSE
message('File download from Application Server failed');
END IF;
EXCEPTION
WHEN OTHERS THEN
message('File download failed: '||SUBSTR(sqlerrm,1,200));
END;
I have search for solution on OTN. Few suggested to use HOST.
Can any one help me how to use Host() built_in to delete the file.
Thanks,
MaddyCan any one help me how to use Host() built_in to delete the file.
Host('/bin/rm <complete file path>'); -
How to Select the Latest file from Application Server?
Dear All,
I am working on object, which had requirement to Pick the file from application server.
The Application server contain the files in /temp/sms/ directory. The files are having the name Like smsqry_yyyymmddhhmmss.txt and I have to Pick the Latest file (Base on file name for eg. 'smsqry_20060713102333) from that all and after getting the file I have to delete the file from application server.
So How to do this.
Regardshi,
look function group EPSF-
esp. fm EPS_GET_DIRECTORY_LISTING
if you're looking fo OS-date and time
look here:Re: How do I convert MTIME to date and time?
A.
Message was edited by: Andreas Mann -
How to delete the Generated files from application server(open hub)?
hi experts,
when i try to execute process chain the DTP it is giving below dump. Exception CX_RSBK_REQUEST_LOCKED logged.
when i execute the DTP manually and trying to delete the previous request, it is giving for dump ITAB_DUPLICATE_KEY.
so to delete the generated file from application server, how to delete it for specific dates?
Information on where terminated
Termination occurred in the ABAP program "GPD6S3OE0BCVGC6L9DBNVYQARZM" - in
"START_ROUTINE".
The main program was "RSBATCH_EXECUTE_PROZESS ".
In the source code you have the termination point in line 2874
of the (Include) program "GPD6S3OE0BCVGC6L9DBNVYQARZM".
The program "GPD6S3OE0BCVGC6L9DBNVYQARZM" was started as a background job.
and when i check the dump it is point out at below code
" Populate the lookup table for 0STOR_LOC
SELECT * from /BI0/TSTOR_LOC
into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
but the programme is syntactically correct only.
how to rectify the issue.
regards
venuscm
Edited by: venugopal vadlamudi on Sep 28, 2010 1:59 PMhi experts,
We have written start routine to get the storage location text and sending to File located at Application server through OPEN HUB.
here is the code written in the Transformations
In the global section
Text for 0STOR_LOC
DATA: l_0stor_loc_text TYPE HASHED TABLE OF /bi0/tstor_loc
WITH UNIQUE KEY stor_loc.
DATA: l_0stor_loc_text_wa TYPE /bi0/tstor_loc.
and in the code to get the text
" Populate the lookup table for 0STOR_LOC
*SELECT * from /BI0/TSTOR_LOC*
into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
im sure there is problem with the Routine only. i think i need to change the code if so please provide me the modified one.
thanks
venuscm
Edited by: venugopal vadlamudi on Sep 29, 2010 9:37 AM -
How to copy file from application server
Hello experts,
How to copy file from one folder of application server and paste it to other folder of application server(application server is same)?
Is there any function module exists???
thanks in advance
SaurabhHi you can use this function module to move a file from application server to another folder on application server.
call function 'WS_FILE_COPY'
exporting
destination = m_destination
source = m_source
importing
return = return.
Plus u can use this function module to delete the file from that folder from which u want to replace it.
call function 'WS_FILE_DELETE'
exporting
file = m_source
importing
return = return.
The above FM can help u copy a file from one folder to another and delete the file from that folder. -
How to transfer file from application server to presentation server in background?
Hi Experts,
How to transfer file from application server to presentation server in background?
Thanks in advance
NamitaThanks Raman and Challa,
We want to move file from application server to Shared folder, not on local machine. We checked FM which you guys have provided but those are not able to read file from application server.
We need this program to run in background so that we can use this in daily process chain.
Appreciate your inputs on this.
Thanks,
Namita -
How to upload file from Application Server?
Dear Friends,
How to upload file from Application Server?
Plz. with example...
Regards,
Dharmeshhi,
check the code for upload from application server.
tables: kna1.
types: begin of s_file,
customer type kna1-kunnr,
country type kna1-land1,
name type kna1-name1,
region type kna1-regio,
end of s_file.
*--Internal tables
data: it_file type s_file occurs 0 with header line.
*-- Selection screen
selection-screen: begin of block b1 with frame title text-001.
parameter: p_file type rlgrap-filename default 'C:/customer.txt'
obligatory.
selection-screen: end of block b1.
*-- At selection screen
at selection-screen on value-request for p_file.
perform file_help using p_file.
*-- Process File
start-of-selection.
perform upload_file using p_file.
*-- write File data to o/p
end-of-selection.
perform write_data.
*& Form file_help
form file_help using p_p_file.
data: l_filepath type ibipparms-path.
call function 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
importing
file_name = l_filepath
p_p_file = l_filepath.
endform. " file_help
*& Form upload_file
form upload_file using p_p_file.
call function 'WS_UPLOAD'
exporting
filename = p_p_file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = it_file
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
others = 11
if sy-subrc <> 0.
message i001.
endif.
endform. " upload_file
*& Form write_data
form write_data .
loop at it_file.
write:/ it_file-customer, it_file-country, it_file-name,
it_file-region.
endloop.
endform.
regards,
keerthi.
Maybe you are looking for
-
Why does Server Monitor not work with non-Xserves?
Does anyone know why Server Monitor does not work with non-Xserve computers? We acquired a Power Mac for a server, based on there being no apparent difference except for the obvious. Turns out there are some differences after all. Do Power Macs lack
-
I have added a vi, but it doesn't quite work. Would be very grateful if someone could help, thanks! Attachments: Average_0411041_2.vi 77 KB
-
hi here comes a jsp newbie. i just install the tomcat follow some instruction on web. but when i run the tomcat, it returns some error, can anyone kindly help me on about it? i am using tomcat 4.1 under windows2000 system. here i give out the error w
-
Siri does not work after IOS 7 install
Siri doesent work after I OS 7 install I hear it is a hardware problem. Siri works fine but then you download IOS seven and it stops working. Apple has told a couple people they have to buy a new phone. I hope thats not true. Because I will buy a new
-
When I try to update itunes I get all the way until it is loading the update and get the below error. Errors occurred while installing the updates. If the problem persists, choose Tools > Download Only and try installing manually. Nothing is working,