How i access file which stored at application server .? Is there any fm ?
Hi,
How i access file which stored at application server . Is there any function module which provide same funtinality.
Regards,
Gurprit Bhatia
Hi ,
U need to use datasets for reading data from application server.Do a f1 on dataset,u will get to know rest of the things.
TRY.
OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING UTF-8.
ENDTRY.
IF sy-subrc = 0.
READ DATASET file INTO <wa_data> MAXIMUM LENGTH 200.
move the data in to internal table
close dataset
Edited by: A kumar on Aug 21, 2008 1:37 PM
Similar Messages
-
Files are stored in application server,
Files are stored in application server, I am using Open dataset to write to a file in unix box.would like to convert my itab into tab delimted and download. Please let know
is there any function?You should do a search to get the right ascii value (you can get an
ascii chart, you can google a bit, you can visit the group's page and
search for tab delimited... ) and replace 09 by the right value. And
that's it.. The technique (which is what it matters) is right.
Another tip:: you could download in two steps: first you use
gui_download or ws_download to create a tab delimited file in your pc or
in a network. Then you upload this file (using gui_upload or ws_upload
into an internal table and the final step is to use open dataset -
transfer - close dataset to write down this last itab to your app
server. -
Reading the data from excel file which is in application server.
Hi,
Iam trying to read the data from excel file which is in application server.
I tried using the function module ALSM_EXCEL_TO_INTERNAL_TABLE. But it didn't work.
I tried just reading using open data set and read data set it is giving junk characters.
Please suggest me if you have any solution.
Best Regards,
Brahma ReddyHi Narendra,
Please see the below code I have written
OPEN DATASET pa_sfile for INPUT in text mode ENCODING DEFAULT MESSAGE wf_mess.
CHECK sy-subrc = 0.
DO.
READ DATASET pa_sfile INTO wf_string.
IF sy-subrc <> 0.
EXIT.
else.
split wf_string at wl_# into wf_field1 wf_field2 wa_upload-field3
wa_upload-field4 wa_upload-field5 wa_upload-field6 wa_upload-field7 wa_upload-field8
wa_upload-field9 wa_upload-field10 wa_upload-field11 wa_upload-field12 wa_upload-field13
wa_upload-field14 wa_upload-field15 wa_upload-field16 wa_upload-field17 wa_upload-field18
wa_upload-field19 wa_upload-field20 wa_upload-field21 wa_upload-field22 wa_upload-field23
wa_upload-field24 wa_upload-field25 wa_upload-field26 wa_upload-field27 wa_upload-field28
wa_upload-field29 wa_upload-field30 wa_upload-field31 wa_upload-field32 wa_upload-field33
wa_upload-field34 wa_upload-field35 wa_upload-field36 .
wa_upload-field1 = wf_field1.
wa_upload-field2 = wf_field2.
append wa_upload to int_upload.
clear wa_upload.
ENDIF.
ENDDO.
CLOSE DATASET pa_sfile.
Please note Iam using ECC5.0 and it is not allowing me to declare wl_# as x as in your code.
Also if Iam using text mode I should use extension encoding etc.( Where as not in your case).
Please suggest me any other way.
Thanks for your help,
Brahma Reddy -
Viewing a file which is in Application Server [al11]
Hi All
I have a file which is residing in Application Server [al11 tcode], how i can display the file using LinkToURL UI Element,
what is the path which i need give in the REFERENCE parameter of the UI Element.
Thanks in Advance
Regards
Chaitanya.AJust becuase the file is in the filesystem of the application server, doesn't necessarily mean that it is exposed to the network at all. This really depends upon your OS and if you have a file share or external web server connected to the OS of your application server.
However if you want to temporarily create a URL via the ABAP application server for a file in the filesystem you can do so by placing the content into the ICM cache.
So you would read the file from the filesystem using the normal ABAP dataset commands.
Here is a small example where I am doing this with different image formats:
****Create the cached response object that we will insert our content into
data: cached_response type ref to if_http_response.
create object cached_response
type
cl_http_response
exporting
add_c_msg = 1.
* cached_response->set_compression( options = cached_response->IF_HTTP_ENTITY~CO_COMPRESS_IN_ALL_CASES ).
try. " ignore, if compression can not be switched on
call method cached_response->set_compression
exporting
options = cached_response->co_compress_based_on_mime_type
exceptions
others = 1.
catch cx_root.
endtry.
****set the data and the headers
data: l_app_type type string.
data: l_xstring type xstring.
case i_format.
when 'BMP'.
cached_response->set_data( me->gx_content ).
l_app_type = 'image/x-ms-bmp'.
when 'GIF'.
me->get_content_ext_format(
exporting
i_format = i_format
importing
e_xstream = l_xstring ).
cached_response->set_data( l_xstring ).
l_app_type = 'image/gif'.
when 'JPG'.
me->get_content_ext_format(
exporting
i_format = i_format
importing
e_xstream = l_xstring ).
cached_response->set_data( l_xstring ).
l_app_type = 'image/jpeg'.
when 'TIF'.
me->get_content_ext_format(
exporting
i_format = i_format
importing
e_xstream = l_xstring ).
cached_response->set_data( l_xstring ).
l_app_type = 'image/tiff'.
when 'PNG'.
me->get_content_ext_format(
exporting
i_format = i_format
importing
e_xstream = l_xstring ).
cached_response->set_data( l_xstring ).
l_app_type = 'image/png'.
when others.
raise exception type zcx_abap_bitmap.
endcase.
cached_response->set_header_field( name = if_http_header_fields=>content_type
value = l_app_type ).
******Set the filename into the response header
* cached_response->set_header_field( name = 'Content-Encoding'
* value = 'compress' ).
****Set the Response Status
cached_response->set_status( code = 200 reason = 'OK' ).
****Set the Cache Timeout - 60 seconds - we only need this in the cache
****long enough to build the page and allow the IFrame on the Client to request it.
cached_response->server_cache_expire_rel( expires_rel = i_cache_timeout ).
****Create a unique URL for the object
data: guid type guid_32.
call function 'GUID_CREATE'
importing
ev_guid_32 = guid.
concatenate i_path '/' guid '.' i_format into r_url.
****Cache the URL
cl_http_server=>server_cache_upload( url = r_url
response = cached_response ).
Another option would be to create a custom ICF handler class. In this class you could pass the file name as URL parameters, read the content using ABAP DATASET commands and return the content in the response object.
Handler classes have to implement the IF_HTTP_EXTENSION Interface. You implent the method HANDLE_REQUEST.
Here is an example implementation of the HANDLE_REQUEST:
* Inform ICF to "keep" (reuse) this handler, and that we answered the HTTP request
if_http_extension~lifetime_rc = if_http_extension=>co_lifetime_keep.
if_http_extension~flow_rc = if_http_extension=>co_flow_ok.
* Determine image name from URL ~script_name/~path_info (= image_name)
data: name type string.
name = server->request->get_header_field( name = if_http_header_fields_sap=>path_info ).
translate name to upper case.
if strlen( name ) >= 1 and name(1) = '/'.
shift name left.
endif.
* Application logic
data: content type xstring.
content = me->load( name ).
if xstrlen( content ) is initial.
raise exception type cx_http_ext_exception exporting msg = 'Invalid URL!'.
endif.
* Set up HTTP response
server->response->set_status( code = 200 reason = 'OK' ).
server->response->set_header_field( name = if_http_header_fields=>content_type value = 'image/png' ).
server->response->server_cache_expire_rel( expires_rel = 86000 ).
server->response->set_header_field( name = if_http_header_fields=>cache_control value = 'max-age=86000' ).
server->response->set_data( content ).
3rd option would be to create an ICM File Handler. I detailed this functionality in the SAP Press book Advanced BSP Programming. It is covered in Chapter 16.2. Here is an exerpt:
The Internet Communication Manager (ICM) allows just such access to any file
system accessible to the underlying operating system. You can map operating file
system directories into ICM URL paths using the profile parameter icm/HTTP/
file_access_<xx>.
If you have never maintained one of the system-profile parameters, now is good
time to make friends with your Basis administrator. With the following additions
to our instance profile and a quick restart of the ICM, we are now able to access
file system directories via HTTP.
icm/HTTP/file_access_0 =
PREFIX=/doc/, DOCROOT=/usr,BROWSEDIR=2
icm/HTTP/file_access_1 =
PREFIX=/doc2/,
DOCROOT=
server\SAPPatches\Netweaver04,BROWSEDIR=2
In the first entry, we are just going to map to the local directory usr. We are able
to control the useru2019s options to browser a directory via the additional parameter
BROWSEDIR. The possible values are: 0 u2013 no browsing allowed, 1 u2013 only file names
are displayed, and 2 u2013 file names along with their size and last change date are displayed.
The second entry really shows off the power of this profile parameter. We are able
to expose a directory on a remote server via UNC paths. Of course the security on
that directory would have to be open to allow read-and-browse access. There is
also no real mechanism to apply security to the ICM URL for this file access node,
so you will want to be careful what you expose through it. -
HOW TO MOVE FILES BETWEEN FOLDERS ON APPLICATION SERVER
Hi ,
I want to move files between folders on application servers and also on presentation server.
Is any ABAP code available for it.
Can anybody help me out in this.
Waiting for reply.
Thanks & regards,
NitinI am also interested in this post. The FB ARCHIVFILE_SERVER_TO_SERVER workes fine for copying the file, however I also need to remove the file from its original location.
Does anybody have a sugestion on how I can do that (in coding).
Regards,
Minim -
How to change the excel file name which is in Application server...
hi friends,
my requirement is getting failed, when i'm trying to change the file name which is in Application server using the FM: SXPG_COMMAND_EXECUTE.
when i execute above FM, i can see all my required details in SM69 like:
COMMAND NAME: ZSPOOL_TEST1
OS: Windows NT
TYPE: Customer
OS COMMAND: cmd rename Y:\OBRZ.PDF OBRZ38582.PDF
once the above FM is executed, i'm getting SY-SUBRC = 2 (exception: COMMAND_NOT_FOUND).
so, can any one guide me how to resolve this issue or is there any other way to rename the file which is in AS?
thanks in advance...Hi ,
First you can tranfer the AS server file to a new application server file.
Then you delete the original file .
To do that you can write code as follows --
DATA : w_file(8) TYPE c VALUE 'FILE_NAM', " your present AS file name
w_new(8) TYPE c VALUE 'NEW_FILE',
fs_itab(255) TYPE c,
t_itab LIKE TABLE OF fs_itab.
OPEN DATASET w_file FOR OUTPUT IN BINARY MODE.
DO.
READ DATASET w_file INTO fs_itab. " Reading value from the AS file to field string
IF sy-subrc NE 0.
EXIT.
ELSE.
APPEND fs_itab TO t_itab. " Populating internal table form the file value
ENDIF.
ENDDO.
OPEN DATASET w_new FOR INPUT IN BINARY MODE. " creating a new file if that does not exist
LOOP AT t_itab INTO fs_itab.
TRANSFER fs_itab TO w_new. " Transfering to file
ENDLOOP.
CLOSE DATASET w_file..
DELETE DATASET w_file. " Dleting the old file
CLOSE DATASET w_new. " Closing the final file
Regards
Pinaki -
Create a Document with an original file stored on application server
Hello,
I start with document managment system : i am able to create new document (CV01N) manually, add a local file and check-in this file.
Now we need to store file which are stored on the SAP Application Server.
Firstly, in the GUI of transaction CV01N, i don't know how to browse file on application server. All files i can't attach as original, are files i can access from my computer.
Is it possible to access also on application server files ?
Moreover, i have to define function module which have to
- Create a document (DMS)
- Attach an orginial file which is stored on application server
- Check-in the file
This function module will be called from a web application
I define this kind of function and run it correctly with a local file (stored on my computer) : i call BAPI "BAPI_DOCUMENT_CREATE2" and "BAPI_DOCUMENT_CHECKIN2"
But i don't how to do with a file stored on application server. I see also note 504692 and try a program like ZZUZTEST_TEST_CHECKIN which use FM CVAPI_DOC_CHECKIN but it return an error Error uploading E:\usr\sap\TD1\DVEBMGS00\data\FACTURE.txt" (this path and file exist on application server and is really the file i want to checkin)
Please could you confirm what i search, is possible or not.
If possible, could help me with some explanations and guidelines and perhaps a sample ?
Thank you very much.
Regards,
Eric
The function used
FUNCTION Z_TEST_CHECKIN.
Checkin the first original of a document info record *
from the application server and/or in the background *
data : w_host like BAPI_DOC_AUX-HOSTNAME.
data: lf_line(255).
data: ls_draw like DRAW,
ls_message_cvapi like messages,
lt_files_cvapi type standard table of CVAPI_DOC_FILE,
lt_files_cvapi_header like CVAPI_DOC_FILE.
data: lt_originals LIKE cvapi_doc_file OCCURS 0 WITH HEADER LINE,
vo_originals LIKE cvapi_doc_file OCCURS 0 WITH HEADER LINE.
ls_draw-dokar = 'ZFT'.
ls_Draw-doknr = '0000000000000004500000032'.
ls_Draw-dokvr = '00'.
ls_Draw-doktl = '000'.
Read Originals contained in the document info record
CALL FUNCTION 'CVAPI_DOC_GETDETAIL'
EXPORTING
pf_batchmode = 'X'
pf_hostname = ' '
pf_dokar = ls_draw-dokar
pf_doknr = ls_draw-doknr
pf_dokvr = ls_draw-dokvr
pf_doktl = ls_draw-doktl
pf_active_files = 'X'
IMPORTING
psx_draw = ls_draw
TABLES
pt_files = vo_originals
EXCEPTIONS
not_found = 1
no_auth = 2
error = 3
OTHERS = 4.
IF sy-subrc <> 0.
WRITE 'Error returned by CVAPI_DOC_GETDETAIL'. "#EC NOTEXT
EXIT.
ENDIF.
Check if we can really access the file from the application server
read table vo_originals index 1.
open dataset vo_originals-filename for input in text mode ENCODING DEFAULT.
if not sy-subrc is initial.
message e500(26) with vo_originals-filename 'not found'.
endif.
read dataset vo_originals-filename into lf_line.
if not sy-subrc is initial.
message e500(26) with vo_originals-filename 'read error'.
endif.
lt_originals = vo_originals.
lt_originals-STORAGE_CAT = 'SAP-SYSTEM'.
append lt_originals.
w_host = sy-host.
CALL FUNCTION 'CVAPI_DOC_CHECKIN'
EXPORTING
PF_DOKAR = ls_draw-dokar
PF_DOKNR = ls_draw-doknr
PF_DOKVR = ls_draw-dokvr
PF_DOKTL = ls_draw-doktl
PS_DOC_STATUS =
PF_FTP_DEST = 'SAPFTPA'
PF_HTTP_DEST = 'SAPHTTPA'
*PF_HOSTNAME = w_host
PS_API_CONTROL =
PF_REPLACE = ' '
PF_CONTENT_PROVIDE = 'SRV'
IMPORTING
PSX_MESSAGE = ls_message_cvapi
TABLES
PT_FILES_X = lt_originals
PT_COMP_X =
PT_CONTENT =
IF ls_message_cvapi-msg_type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_message_cvapi-msg_txt.
ELSE.
COMMIT WORK and wait.
ENDIF.
ENDFUNCTION.This is a bit tricky. I spent lots of hours about this .
You have to set PF_HOSTNAME with your name of your AS and gives the path to the file on the server.
You wrote
*PF_HOSTNAME = w_host
But beware: if you have more thän one AS you have to fix one AS for upload or you have to find the servers name of the file. A better way can be to share one folder by each AS.
You also have to decide between HTTP or FTP.
You wrote:
PF_FTP_DEST = 'SAPFTPA'
PF_HTTP_DEST = 'SAPHTTPA'
You must define only one ! Then you have to check your settings in SM59 about working right.
Pls rate, if this was helpful.
Regards,
Markus -
How to have a live feed from application server log file (realtime viewr )
how to have a live feed from application server log file (realtime viewr for apps log files)
hi , thank you for reading my post.
is there any way to have a live feed of Application server log ?
for example is there any application that can watch the log file and show the changes as new log items come in ?
can some one with more experience help ?Your question would be more suited to the Developer Forums
http://devforums.apple.com
but anyway...
My goal is to develop a web application that is able to run on iPhone too, to capture the audio and video content from its camera and mic.
Web Apps running in Safari don't have access to the camera or mic hardware.
Or I should built a native application distributed through Apple store?
That is your only option, although such a system already exists:
http://itunes.apple.com/us/app/ustream-live-broadcaster/id319362690?mt=8 -
How to retrieve data from an Excel file which is located on server
hi everybody,
I am using SAP NWDS 2004s .
I have done an application on how to export the table data into an Excel .
Now i want to get the data from an Excel file which is located in server and display that data which is in excel in a View for example a Sample view in Webdynpro .
In Sample view i took a uielement textview to display the data ....
can any one help how to procced further
Thanks in advance
MadhaviOptions to read Excel data to WebDynpro context
Reading Excel Sheet from Java without using any Framework
Reading Multiple Sheets of Excel Sheet from Java
Few Threads
How to Display the content of Excel file into Webdynpro Table
Is it possible to upload data from excel file(.xls)
Re: How to export the data as integer into excel sheet?
regards
Vinod -
How I COULD CHECK files are storing in DMS server or DNS server.
Hi, all,
I am storing DMS files ie originals in DMS_C1_ST through Kpro,
Because we have DNS server and DMS server.
Now I m working in Production server,
How I can check the DMS files is storing in DMS server or in DNS server.
The DMS configuration is working fine but I donu2019t know how I could check whether the files or storing in DMS server or in DNS server. Or any other configuration is required.
urgent.
Rgds,
BenHi,
If u r using DMS_C1_ST storage category, then ur original are checking in to SAP data base, because, this category is created using SAP database.If ur using separate content server for storing originals, then create content repository in ur content server and storage category in content repository.
Now while checking in, system will ask u to choose storage category, instead of selecting DMS_C1_ST , select which u have created in ur content server, then ur originals will store in DMS content server.
Regards
Sham -
sold my ipad today. the concern is how to access all info stored in cloud and if possible eventualy merge data into new andriod tablet. Thanks all of you who respond.
>
<IfModule mod_weblogic.c>
WebLogicCluster 127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7003,127.0.0.1:7103,127.0.0.1:7104
MatchExpression /app1
</IfModule>
<Location /weblogic>
SetHandler weblogic-handler
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
DebugConfigInfo ON
PathTrim /weblogic
</Location>
<IfModule mod_weblogic.c>
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
MatchExpression /app2
</IfModule>
<Location /weblogic>
SetHandler weblogic-handler
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
DebugConfigInfo ON
PathTrim /weblogic
</Location>
>
This configuration is weird little bit. There is MatchExpression /app1 and MatchExpression /app2 and at the same time two <Location /weblogic> sections. Are you sure you understand what that configuration stands for?
Try something like this ...
<Location /app1>
SetHandler weblogic-handler
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
DebugConfigInfo ON
</Location>
<Location /app2>
SetHandler weblogic-handler
WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
DebugConfigInfo ON
</Location>
where /app1 and /app2 are contexts of your weblogic applications.
http://download.oracle.com/docs/cd/E11035_01/wls100/plugins/apache.html
http://httpd.apache.org/docs/2.0/mod/core.html#location -
How to move PDF file from Spool to Application Server?
How to move PDF file from Spool to Application Server?
Cannot use RSTXPDFT4 because that converts OTF to PDF and the file is already PDF.
RSTXPDFT5 doesn't work. It picks the file up and assigns it a 'text' type and outputs a 1 line txt (1kb in size) on the server with the spool number in it!
The program which outputs the file to the spool, in the first place, uses adobe forms and outputs to a printer of type PDF.Hi Gemini ,
Please refer the below links.
[http://sap.ittoolbox.com/groups/technical-functional/sap-hr/convert-a-spool-to-pdf-and-save-on-application-server-in-background-720959]
[http://www.sapfans.com/forums/viewtopic.php?f=13&t=325628&start=15]
Edited by: Prasath Arivazhagan on Apr 13, 2010 4:48 PM -
How To Access HTTPS Web Service in Application Module
I need to know how to access HTTPS web service in application module.
If you can provide the tutorial or guidance to achieve this really appreciate.
Thanks
SameeraUse the Web Service Proxy wizard in JDeveloper to create a class that calls your Web service, and then call this class from code in your AM.
http://docs.oracle.com/cd/E16340_01/web.1111/b31974/web_services.htm#CJAHGIEF -
How to access file from AIX server to windows
HI all,
My question is how to represent file folder name of that server
my file folder in AIX server and i want to access that file in window s machine.
* is this the right way to represent the data folder in physical schema declaration
file:///<aix server IP>/usr/oracledi/oracldi/dataNo, it is not. Filename magic alone will not do the job.
AIX supports NFS (network file system) or you can use samba (implementation of the Microsoft SMB protocol to share resources in Un*x) . -
How to access file from AIX server
Hi ,
I am facing a problem with Aix Machine .
I want to access the file from AIX server machine .I am in Windows machine.
Regards
RaghavaHI all,
My question is how to represent file folder name of that server
my file folder in AIX server and i want to access that file in window s machine.
* is this the right way to represent the data folder in physical schema declaration
file:///<aix server IP>/usr/oracledi/oracldi/data
Regards
Raghava
Message was edited by:
Raghava.java
Maybe you are looking for
-
Setting Path variable in Win XP Pro
Hello, I have installed Java SDK 1.3.0_02 on Windows XP professional. I have set my path to: %SystemRoot%\system32; %SystemRoot%; %SystemRoot%\system32\WBEM; %SystemRoot%; %SystemRoot%\system32\WBEM; C:\Program Files\Common Files\Adaptec Shared\Syste
-
Missing eData, eSubmit, eAnalyze menus in Excel 2007
Hi, I've got a strange issue with two of my 7.5 appsets. When I log into the Excel Interface there are no menus for eData, eAnalyze or eSubmit. The Data Manager option is on the eTools menu but selecting it only gives me an Action Pane with "Data Man
-
Export INTERNAL TABLE to shared buffer
Hi all, My requirement: Export INTERNAL TABLE to shared buffer or SAP Memory. Any help will be appreciated. Can SET/GET parameter be adopted for internal tables? Thanks, Tabraiz
-
KM Problem in Portal 7.3 JSF References
Hi Everyone, I'm having trouble with references in my JSF applications. The application has been developed for Portal 7.0 but later on we decided to deploy it on Portal 7.3 . Our application uses KM for some stuff and at that point we are facing Appl
-
Without giving any password it is getting connected in windows
in windowsfrom command prompt when i try to login to oracle it is asking for username but when i just press the enter key for password ( without giving any password) it is getting connected? How do i stop it ? Regards Sudharshan