Need utilities class for application server file system (i.e. unix etc)
I need to do things to directories and files on the application server.
Is there an SAP class with methods for the application server file system (i.e. unix or whatever) with functionality similiar to what is provided by the methods of CL_GUI_FRONTEND_SERVICES for the presentation server?
Is there a group of SAP functions for this task?
You may have a look at Thomas Jung article: [sdn contribution : ABAP Server Side File Access, by Thomas Jung|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/7a13f367-0401-0010-47ba-eab0b15cf31c]
Moreover, in release 7.10, it could be possible that SAP introduced input and output stream classes (to mimic java classes), so I guess there could be the ones for application server file system.
Similar Messages
-
Equalent of F4_filename function module for application server file path
hi experts,
i am using cl_gui_frontend_services=>file_open_dialog
for bring file path dynamically for user, in front end.
same feature i want to give when i am trying upload file from application server.
kindly provide me function module or class method, which will do it.
thanks in advance
regards,
pavanHi,
Use FM F4_DXFILENAME_TOPRECURSION
Sample code here
report ztest.
data : filename like DXFIELDS-LONGPATH.
data : begin of itab occurs 0,
a(200) type c,
end of itab.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = 'A'
*I_SERVER = '?'
*I_PATH =
FILEMASK = '.*'
*FILEOPERATION = 'R'
IMPORTING
*O_LOCATION_FLAG =
*O_SERVER =
O_PATH = filename
*ABEND_FLAG =
EXCEPTIONS
RFC_ERROR = 1
ERROR_WITH_GUI = 2
OTHERS = 3
break-point.
open dataset filename for input in binary mode.
while sy-subrc = 0.
clear itab .
read dataset filename into itab.
append itab.
endwhile.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'd:\abc.txt'
FILETYPE = 'BIN'
TABLES
DATA_TAB = itab
Regards,
Satish -
TCODE for acceess server file system
Hello Gurus,
how can I get into file system for sap application server using TCODE ? . I just want to download a flat file from server to local.
Many thanks,
Frank ZhangHi Frank,
Are you able to load the files in local workstation...or else you copy like one more thing as ask the URL of those files and then load it from tehre...if they are huge save then in sap business workplace and then you can copy at your desk top...
Regards
Srinivas -
File path for application server file
Hi All,
I have a file 'abc.doc' stored on the application sever.
I want to crate a document using the BAPI_DOCUMENT_CREATE and store this file
What is the file path that I need to pass into the bapi.
Please help
Warm Regards
Sunil Kumar.Hello Sunil
You are right. That's the file path you should specify. It looks like your application server is running on UNIX platform. You can use transaction AL11 to locate your file and specify the file path in normal unix format. If this doesnt work, you can try prefixing your file path with "file:// ".
Cheers
Anand -
Adaptiv Computing Controller / do i need NFS Mounts for Application Server?
Hello,
i got a question about the Adaptiv Computing Controller.
Do i need NFS Mounts for the Application servers?
Or can i handle this from the SAN too?
Can anybody help me here?
Thankshttp://ww2.cs.fsu.edu/~rosentha/linux/2.6.26.5/docs/DocBook/libata/ch07.html#excatATAbusErr wrote:
ATA bus error means that data corruption occurred during transmission over ATA bus (SATA or PATA). This type of errors can be indicated by
ICRC or ABRT error as described in the section called “ATA/ATAPI device error (non-NCQ / non-CHECK CONDITION)”.
Controller-specific error completion with error information indicating transmission error.
On some controllers, command timeout. In this case, there may be a mechanism to determine that the timeout is due to transmission error.
Unknown/random errors, timeouts and all sorts of weirdities.
As described above, transmission errors can cause wide variety of symptoms ranging from device ICRC error to random device lockup, and, for many cases, there is no way to tell if an error condition is due to transmission error or not; therefore, it's necessary to employ some kind of heuristic when dealing with errors and timeouts. For example, encountering repetitive ABRT errors for known supported command is likely to indicate ATA bus error.
Once it's determined that ATA bus errors have possibly occurred, lowering ATA bus transmission speed is one of actions which may alleviate the problem.
I'd also add; make sure you have good backups when ATA errors are frequent -
FM to get F4 for application server file or logical file or dataset .
Hi all.
Can any body pls let me know the FMs to get the F4 for applicattionserver file or logical file or unix file or dataset. Thanks in advance.
Kind Regards,
sami.hi,
use the FM: 'F4_DXFILENAME_4_DYNP' in the below mentioned format:
p_file: is the field name in selection screen in which you have to enter the filepath:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_FILE'
dyname = sy-cprog
dynumb = sy-dynnr
filetype = 'P' "P-->Physical
location = 'P' "P Presentation Srever
server = space.
hope it will help you
regards
rahul -
Application server file path vaidation
I have written the code for application server file path validation.
DATA : l_fname TYPE filename-fileintern." type c.
DATA : l_filpath TYPE filename-fileintern,
l_filname(40) TYPE c.
PARAMETER : p_sucfil LIKE rfpdo-rfbifile OBLIGATORY. " rlgrap-filename
AT SELECTION-SCREEN ON p_sucfil.
l_fname = p_sucfil.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
CLIENT = SY-MANDT
logical_filename = l_fname
OPERATING_SYSTEM = SY-OPSYS
PARAMETER_1 = ' '
PARAMETER_2 = ' '
PARAMETER_3 = ' '
USE_PRESENTATION_SERVER = ' '
WITH_FILE_EXTENSION = 'X'
USE_BUFFER = ' '
ELEMINATE_BLANKS = 'X'
IMPORTING
EMERGENCY_FLAG =
FILE_FORMAT =
FILE_NAME = l_filpath
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
message 'Invalid file name' type 'E'.
ENDIF.
But always i will get Invalid file name.
Y is it so.
pls help me.Praveen,
I have checked ur code and I found that if i give a logical file name from
tran. FILE under folder 'Logical file name definition, cross client' then ur code works. Pl. check.
Regards,
Joy.
DATA : l_fname TYPE filename-fileintern." type c.
DATA : l_filpath TYPE filename-fileintern,
l_filname(40) TYPE c.
PARAMETER : p_sucfil LIKE rfpdo-rfbifile OBLIGATORY. " rlgrap-filename
AT SELECTION-SCREEN ON p_sucfil.
l_fname = p_sucfil.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = l_fname
operating_system = sy-opsys
with_file_extension = 'X'
IMPORTING
file_name = l_filpath
EXCEPTIONS
file_not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE 'Invalid file name' TYPE 'E'.
ENDIF. -
How to give the application server file path in the module pool programming
Hi,
Could somebody help me how to provide the application server file path in module pool programming once the logo is uploaded to sap system.
For eg I have imported a logo name owens into sap system by using transaction se78; now I need to call the path in the below url,
if container2 is initial.
CREATE OBJECT CONTAINER2
EXPORTING
CONTAINER_NAME = 'PICTURE_CONTAINER2'.
CREATE OBJECT PICTURE2
EXPORTING
PARENT = CONTAINER2.
CALL METHOD PICTURE2->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>display_mode_fit_center
EXCEPTIONS
ERROR = 1.
CALL METHOD PICTURE2->LOAD_PICTURE_FROM_URL
EXPORTING
URL = " ? "
EXCEPTIONS
ERROR = 1
Others = 2.
endif.
Thanks in advance
Deepuhi Deepu,
Use FM '/SAPDMC/LSM_F4_FRONTEND_FILE' for fetching the data from the application server path/presentation server path
Regards,
Santosh -
Download to application server File tcode relavance
Hi
i need to know the process for application server download and defining the same in file transaction
also the process further to move the logical path to the TQA etc system
also pls send me working example of the downloading to application server to refer for ECC 7.0 as there are some issues to be taken care in new version
regards
Nishantno replies new quesion raised
-
Hi,
We have installed the SOA suite, and I can login to the various components using oc4jadmin/password (bpel, esb, rules author), but for some reason that oc4jadmin password is not working for Application Server Control, which is the only piece of this I really need to log in to.
Any thoughts on what is going wrong?
Cheers,
Pat RockMaybe you change this password internally for another application (such BPEL, WSM,etc) and didn't make change for your main OC4J container.
You can try to change this password by...
1. Open the file [OASHome]\j2ee\home\config\system-jazn-data.xml
2. Find the section that looks like this
[user]
[name]oc4jadmin[name]
[display-name]OC4J Administrator[display-name]
[guid]88836370D11611DC9F30F9C1CD6F1A73[guid]
[description]OC4J Administrator[description]
[credentials]{903}F+iG1A46edXG9RdfY0pD2O4Ge/qyEjsg[credentials]
[user]
3. Replace the value separated by the "Credentials" starting and ending tags with your new desired password, prefixed with an exclamation point
Example:
[user]
[name]oc4jadmin[name]
[display-name]OC4J Administrator[display-name]
[guid]88836370D11611DC9F30F9C1CD6F1A73[guid]
[description]OC4J Administrator[description]
[credentials]!newpassword[credentials]
[user]
4. Save the file and restart OAS
This should not affect other applications.
Greetings. -
Error while accessing the application server file
Hello,
When I try to load the data from CSV file to PSA , I am getting following error message
"Error while accessing the application server file"
"Errors in source system"
I gave the right file path
I am not sure about this error message.
Thanks,Hi ram,
if you have more than one application server running in your BI system (see at transaction SM51) be aware that your infopackage will be executed on the right one. Each application server has its own file system and your job need to run on the server your file is stored on.
Also check if the os user of the SAP system itself (<sid>adm on Unix) has rights to read that file.
Bye
Frank -
Application server file formats.
Hi,
I have one query regarding the application server file formats, when we are creating a file we give some extension (.txt, .dat),what is the use of different extensions.
When we are downloading the file from appl server using CG3Y we have two options(ASC and BIN ) what is the use of these options.
Thanks in advance.Hi,
A text file is a kind of computer file that is structured as a sequence of lines.
A .dat file is a computer file which stores data for use by a computer application or system.
A character encoding consists of a code that pairs a sequence of characters from a given character set (sometimes referred to as code page) with something else, such as a sequence of natural numbers, octets or electrical pulses, in order to facilitate the storage of text in computers and the transmission of text through telecommunication networks.
ASCII and BINARY codes are used for internal representation of data.
The major difference between ASCII and BINARY is that when ASCII mode is used then the READ DATASET stmt starts at new line each time and in case of BINARY it reads character by character ( or some characters).
Thanks and regards. -
Application Server file to internal table
Hi,
How can i read the application server file into the internal table?? Which FM should i use??
Regards,
KitHi,
Open Dataset is used to read or write on to application server ... other than that i am not sure that there exists any way to do the same ... here is a short description for that
FILE HANDLING IN SAP
Introduction
Files on application server are sequential files.
Files on presentation server / workstation are local files.
A sequential file is also called a dataset.
Handling of Sequential file
Three steps are involved in sequential file handling
OPEN
PROCESS
CLOSE
Here processing of file can be READING a file or WRITING on to a file.
OPEN FILE
Before data can be processed, a file needs to be opened.
After processing file is closed.
Syntax:
OPEN DATASET <file name> FOR {OUTPUT/INPUT/APPENDING}
IN {TEXT/BINARY} MODE
This statement returns SY_SUBRC as 0 for successful opening of file or 8, if unsuccessful.
OUTPUT: Opens the file for writing. If the dataset already exists, this will place the cursor at the start of the dataset, the old contents get deleted at the end of the program or when the CLOSE DATASET is encountered.
INPUT: Opens a file for READ and places the cursor at the beginning of the file.
FOR APPENDING: Opens the file for writing and places the cursor at the end of file. If the file does not exist, it is generated.
BINARY MODE: The READ or TRANSFER will be character wise. Each time n characters are READ or transferred. The next READ or TRANSFER will start from the next character position and not on the next line.
IN TEXT MODE: The READ or TRANSFER will start at the beginning of a new line each time. If for READ, the destination is shorter than the source, it gets truncated. If destination is longer, then it is padded with spaces.
Defaults: If nothing is mentioned, then defaults are FOR INPUT and in BINARY MODE.
PROCESS FILE:
Processing a file involves READing the file or Writing on to file TRANSFER.
TRANSFER Statement
Syntax:
TRANSFER <field> TO <file name>.
<Field> can also be a field string / work area / DDIC structure.
Each transfer statement writes a statement to the dataset. In binary mode, it writes the length of the field to the dataset. In text mode, it writes one line to the dataset.
If the file is not already open, TRANSFER tries to OPEN file FOR OUTPUT (IN BINARY MODE) or using the last OPEN DATASET statement for this file.
IF FILE HANDLING, TRANSFER IS THE ONLY STATEMENT WHICH DOES NOT RETURN SY-SUBRC
READ Statement
Syntax:
READ DATASET <file name> INTO <field>.
<Field> can also be a field string / work area / DDIC structure.
Each READ will get one record from the dataset. In binary mode it reads the length of the field and in text mode it reads each line.
CLOSE FILE:
The program will close all sequential files, which are open at the end of the program. However, it is a good programming practice to explicitly close all the datasets that were opened.
Syntax:
CLOSE DATASET <file name>.
SY-SUBRC will be set to 0 or 8 depending on whether the CLOSE is successful or not.
DELETE FILE:
A dataset can be deleted.
Syntax:
DELETE DATASET <file name>.
SY-SUBRC will be set to 0 or 8 depending on whether the DELETE is successful or not.
Pseudo logic for processing the sequential files:
For reading:
Open dataset for input in a particular mode.
Start DO loop.
Read dataset into a field.
If READ is not successful.
Exit the loop.
Endif.
Do relevant processing for that record.
End the do loop.
Close the dataset.
For writing:
Open dataset for output / Appending in a particular mode.
Populate the field that is to be transferred.
TRANSFER the filed to a dataset.
Close the dataset.
chk a sampel
parameters: p_file like rlgrap-filename obligatory
default '/usr/sap/upload.xls'.
types: begin of t_data,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
matnr like vbap-matnr,
werks like vbap-werks,
megne like vbap-zmeng,
end of t_data.
data: it_data type standard table of t_data,
wa_data type t_data.
open dataset p_file for output in text mode encoding default.
if sy-subrc ne 0.
write:/ 'Unable to open file:', p_file.
else.
do.
read dataset p_file into wa_data.
if sy-subrc ne 0.
exit.
else.
append wa_data to it_data.
endif.
enddo.
close dataset p_file.
endif.
And if you want to write on the file.
*--- open UNIX file
open dataset unixfile for output in text mode message w_msg.
if sy-subrc ne 0.
write: / 'Cannot open for writing:', unixfile, w_msg.
exit.
endif.
*--- write UNIX file
loop at it_file.
transfer it_file to unixfile.
endloop.
*--- close UNIX file
close dataset unixfile. -
Application Server file Validity
Hi Experts,
I have one query. I wanted to check the validity of file in application server. The scenerio is like in my selection screen I will provide application server file name.
I wanted to validate whether that file is existing or not. If file is not existing then I need to display an error message.
Can anybody will suggest me how I can achieve this requirement?
Thanks,
NehaHi Neha,
To access the files on Application server we use DATASET operationsd like open, read, close etc.
Now in your case use opendataset as:
open dataset ds_name for output in text mode encoding default.
IF sy-subrc NE 0.
//write your message here.
ENDIF.
CLOSE DATASET ds_name.
Where ds_name = logical path name of your file, or if you want to check for just one file, hard code the path.
Better practice is to use logical path name.
Also declare ds_name as
DATA: ds_name LIKE rfpdo-rfbifile.
Close dataset is used in case file exists you need to close it.
Revert back if you wantto know abt logical file name.
Regards,
Sana. -
Blank line in Application server file
Hi,
I am uploading datas from 2 internal tables to Application server file(same file).
I want a blank like after i finish uploading the first internal table.
Need a blank line between two internal table datas.
Kindly help me in solving this issue.
Regards
Sowmmya VBhi Sowmya...
Do this way.. Sample code....
Data : Blank(100).
OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT ITAB1.
TRANSFER ITAB1 TO P_FILE.
ENDLOOP.
TRANSFER BLANK TO P_FILE. "this will transfer a Blank record.
LOOP AT ITAB2.
TRANSFER ITAB2 TO P_FILE.
ENDLOOP.
CLOSE DATASET P_FILE.
Maybe you are looking for
-
Mountain Lion app not downloading, just sits in the dock 'waiting'.
Hi everyone, A few weeks ago I downloaded the mountain lion software from the app store. However, the download just sits in the dock 'waiting' and doesn't download at all. It eventually disapears from my dock and tells me that there has been an error
-
After yesterday's "update", iTunes can no longer find and play my music library. It points to the correct location in "Advanced", but clearly iTunes is not actually seeing it. What gives? And why does Apple force these constant updates that just s
-
PIXMA MX 870 Printer Wireless does not worK in Firefox, but works in Safari?
the Printer prints in Firefox,but format is all distorted; small and squiggly.
-
How do i repair a corrupt email database
I have lost all my emails from the past several years and the Repair program will not restore them
-
Automater/iphoto/spinning wheel
Hi, I decided to be clever and give all my photos names (as pet the automator demo) and now when I use iphoto, any photo that has been renamed will not open - I just get the spinning disk! I notice that in Iphoto the details for the photos have not c