Application server directory space
Hi All,
Request to confirm the function module / class / coding required to determine the currently available space
in a directory on the application server.
Regards
Kunal
Hi Arindam,
Thanks for your response.
I believe you have understood our req. correctly.
For an SAP directory , used space = ?, total space = ?
The External command 'ls' only returns the file names in a directory.
I am not sure on implementing the df-k suggested by you.
Is it a separate command or do i have to use it like this
'df -k' in a new command ? Did try this formation but could not get it to work.
Returns an error
'Can't exec external program (No such file or directory) External program terminated with exit code 1
Appreciate your help on this issue.
Regards
Kunal
Similar Messages
-
Application Server Directory file attributes lists
Hi,
I'm searching for Funtion Module or Method to get Application Server Directory file lists with all attributes.
1) FM 'SUBST_GET_FILE_LIST' is not getting midifued date and time.
2) Method CL_GUI_FRONTEND_SERVICES-DIRECTORY_LIST_FILES is getting local directory files.
I'm looking for standard way to get all attributes whatever we are seeing in AL11 transaction like Name, Length, Creator and last changed date and time stamp-
...NandhaHi
The fm SUBST_GET_FILE_LIST is right but you need to convert the date and time by your self, u can use this routine:
PERFORM P6_TO_DATE_TIME_TZ(RSTR0400) USING FILE_LIST-MTIME
FILE_LIST-MOD_TIME
FILE_LIST-MOD_DATE.
Max -
Download all files from a specific application server directory to Local pc
Hi Experts,
I have a requirement of downloading all the files from an application server directory to a local pc.
I know how to download a single file from an application server at a time provided the file name is known.
But my requirement is to download all the files in that particulary directory, because I dont know how many files were created in that directory and what are their names.
Please kindly provide the solution.
Thanks,
Kalikonda.Nelson,
Here is the function module that I have used to get all the application server files.
appl_dir_name is the path of the directory i.e. '/outbound/PD1/Applnserverfiles/'
it_appl_srv_fls is the internal table where all the files gets stored in.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = appl_dir_name
FILE_MASK = ' '
IMPORTING
DIR_NAME =
FILE_COUNTER =
ERROR_COUNTER =
TABLES
dir_list = it_appl_srv_fls
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
hope this solves your problem.
Thanks,
kalikonda. -
How to know the first placed file in Application server directory
Hi All ,
i want to Know the First plased file in a application server directory . i have tried with
FM EPS_GET_FILE_ATTRIBUTES but it is giving the file size. Can anybody give some idea to get the file lastmodify property.
Thanks & Regards
Prithvi.Hi Prithvi!
Use the methods of class CL_GUI_FRONTEND_SERVICES (if your release is at least 620, sorry otherwise).
Method DIRECTORY_LIST_FILES will give you all files of a directory, then you can check with method FILE_GET_ATTRIBUTES for some date info.
But maybe you can agree about a timestamp in the filename - this has to be set by the sender, but is much easier and reliable, too.
Regards,
Christian -
File exist in application server directory
Hi there,
On my SAP server, i have a directory created specifically to store input files generated from other external systems.
From my ABAP program, i need to check if any file exist on that application server directory. If yes, then i will proceed to read the input file and process it.
If it's empty, then output message that file is not available.
Are there any FM to do this?you can use this code to do this...
Upload data from file
DATA: lv_filename TYPE string, "File name
lv_line TYPE string. "One line entry in a file
lv_filename = iv_file_name.
IF iv_location = gc_application.
IF iv_record_count IS SUPPLIED.
Open file
IF gv_file IS INITIAL.
OPEN DATASET lv_filename FOR INPUT IN TEXT MODE
ENCODING DEFAULT
IGNORING CONVERSION ERRORS.
IF sy-subrc <> 0.
RAISE file_open_error.
ENDIF.
gv_file = gc_check.
ENDIF.
Read data
DO iv_record_count TIMES.
READ DATASET lv_filename INTO lv_line.
IF sy-subrc <> 0.
Close file
CLOSE DATASET lv_filename.
IF sy-subrc NE 0.
RAISE file_close_error.
ENDIF.
CLEAR gv_file.
Exit from the loop
EXIT.
ENDIF.
IF iv_separator IS NOT INITIAL.
CALL FUNCTION 'Z_WM_SPLIT_DATA'
EXPORTING
iv_data = lv_line
iv_separator = iv_separator
CHANGING
ct_tab_data = ct_tab_data.
ELSE.
CHECK NOT lv_line IS INITIAL.
APPEND lv_line TO ct_tab_data .
ENDIF.
ENDDO.
ELSE.
Open file
OPEN DATASET lv_filename FOR INPUT IN TEXT MODE
ENCODING DEFAULT
IGNORING CONVERSION ERRORS.
IF sy-subrc <> 0.
RAISE file_open_error.
ENDIF.
Read data
DO.
READ DATASET lv_filename INTO lv_line.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF iv_separator IS NOT INITIAL.
CALL FUNCTION 'Z_WM_SPLIT_DATA'
EXPORTING
iv_data = lv_line
iv_separator = iv_separator
CHANGING
ct_tab_data = ct_tab_data.
ELSE.
CHECK NOT lv_line IS INITIAL.
APPEND lv_line TO ct_tab_data .
ENDIF.
ENDDO.
Close file
CLOSE DATASET lv_filename.
IF sy-subrc NE 0.
RAISE file_close_error.
ENDIF.
ENDIF. -
Read application server directory and file
Hi,
I'm using the FM "RZL_READ_DIR_LOCAL" to retrieve the application server directory and filename. The returned result contain all the directory name and filename. Is there any other FM can separate the result into directory and file??
Regards,
Kithi
Ya One more FM is there - Call Function Gui Upload.
It will read the file from the app server.
See this Example:-
Refer this:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm
ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.
*& Report ZUPLOADTAB * &----
*& Example of Uploading tab delimited file *
REPORT zuploadtab .
PARAMETERS: p_infile LIKE rlgrap-filename
OBLIGATORY DEFAULT '/usr/sap/'..
DATA: ld_file LIKE rlgrap-filename.
*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
name1 like pa0002-VORNA,
name2 like pa0002-name2,
age type i,
END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
wa_record TYPE t_record.
*Text version of data table
TYPES: begin of t_uploadtxt,
name1(10) type c,
name2(15) type c,
age(5) type c,
end of t_uploadtxt.
DATA: wa_uploadtxt TYPE t_uploadtxt.
*String value to data in initially.
DATA: wa_string(255) type c.
constants: con_tab TYPE x VALUE '09'.
*If you have Unicode check active in program attributes then you will
*need to declare constants as follows:
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
*START-OF-SELECTION
START-OF-SELECTION.
ld_file = p_infile.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload TO it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
*END-OF-SELECTION
END-OF-SELECTION.
*!! Text data is now contained within the internal table IT_RECORD
Display report data for illustration purposes
loop at it_record into wa_record.
write:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
endloop.
reward if help. -
Memory or space availabilty in the application server directory
hi
i have AS path /tmp
i want to know how much space is available for the temp folder.
Please suggest any FM.Hi friend,
1. Goto to Transaction SM69.
2. Click on F5.
3. Click on F6.
4. Enter a name in Command Name box ex: z_com
5. Enter a os command in Operating system command box. ex: df -k (uinix command for disk free space of all directories)
6. Give location in application server in Parameters for operating system command box ex: /C dir
7. Click Save.
Goto SE 38 and develop a report using FM 'SXPG_COMMAND_EXECUTE' .
Ex:
REPORT zdemodownload .
data: g_out like BTCXPM occurs 0,
z_com type SXPGCOLIST-NAME value 'df -k'.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = z_com
TABLES
exec_protocol = g_out
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
WRONG_ASYNCHRONOUS_PARAMETERS = 12
CANT_ENQ_TBTCO_ENTRY = 13
JOBCOUNT_GENERATION_ERROR = 14
OTHERS = 15.
IF sy-subrc = 0.
display table g_out..............
ENDIF.
Thanks.......
Edited by: Sap Fan on Feb 19, 2009 12:44 PM
Edited by: Sap Fan on Feb 19, 2009 1:39 PM -
How to check if the file already exists in the application server directory
Hi all. I'm on devsuite 10g.
I transfer file from local machine to application server using webutil function webutil_file_transfer.client_to_as and I want to check if the file I'm transfering already exists on the server directory.
How can I make this?
Thanks all,
Fabriziouse the text_io package and open the file in read-mode.
like this
declare
xFileType text_io.file_type;
begin
xFileType := text_io.fopen('c:\temp\test.txt','R'); --file on the middle tier
-- file exists;
text_io.fclose(xFileType);
exception
when others then
--file doesn't exist
end;
regards
Christian -
How to check whether the Application Server directory exits or not
Hi,
I have a selection screen in which I give the Application server file name(UNIX file) as input. Here, I would like to check whether the Server directory exists or not.
Let us say, the path I gave in the selection screen is /usr/sap/tmp/testfile.txt . Here, the file name is testfile.txt and the server directory is /usr/sap/tmp . I would like to check whether this directory /usr/sap/tmp exists in the server or not. I am not bothered about the file name as I am going to write data into the file. I am mainly concerned about whether the directory exists in the server or not. and one more thing... this is the Application Server path not the Local path.
Can anyone help me on the same how to check whether the server directory exists or not.
Thanks in advance.
Best Regards,
Pradeep.Also you can use the FM EPS_GET_DIRECTORY_LISTING for this purpose.
Store the directory name
l_dpath = p_file+0(l_no).
Validate the directory of the application server
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = l_dpath
TABLES
dir_list = l_i_dlist
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
If any problem occurs with the directory then display proper
error message
IF sy-subrc <> 0.
Display error message
MESSAGE e018 WITH 'Problem with directory entered'(008).
ENDIF. " sy-subrc <> 0
Regards,
Joy. -
Application server Directory create
Hi ,
How can i create the directory in application server.
Regards,
RajHi,
GUI_CREATE_DIRECTORY is only for creating folder in presentation server
Check this thread which is closed just now
folder on application server
Regards
Edited by: Rajvansh Ravi on Jan 21, 2009 6:12 AM -
Scan application server directory to read a file by pattern
Hi Experts,er
I am trying to search for a file which is on application server
File Name: payroll_1000_date_timestamp
Since i will not know the timestamp on the file i will have to search the file in the folder like this: payroll_1000_date_*
I have tried almost all below techniques but none of them work in background mode:
1.F.M EPS2_GET_DIRECTORY_LISTING
2.EPS_GET_DIRECTORY_LISTING
3.Perform DIRECTORY_CONTENTS_GET from F.M /SAPDMC/LSM_F4_SERVER_FILE
Would appreciate if someone can highlight on a way i can do this search.
Is there any function module or any utility which can run in background and give me all files present on app. server ? I can than filter it down
later.
Would appreciate your help.
Thanks
BhanuHi Bhanu,
did you try the following??
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = gv_folder "'\usr\sap\ECD\SYS\global\chase\inbound'
file_mask = 'payroll_1000_date_*'
TABLES
dir_list = lt_dir_list
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
IF sy-subrc = 0. -
Application server directory and file browser
Is there existing in SAP a program that can display directories and files that enable me to delete, move, upload, overwrite etc files on a unix server? So it will have similar functionality as e.g. MS Windows Explorer, but an ABAP program. If you have for instance a custom created version, I'd appreciate if you'd share. Thank you and best regards, Adrian
Hi you can make use of fm's
F4_DXFILENAME_TOPRECURSION - display directories and files
ARCHIVFILE_SERVER_TO_SERVER - move files, copy files etc.
EPS_DELETE_FILE - delete file
EPS_OPEN_INPUT_FILE - open file for input
EPS_OPEN_OUTPUT_FILE - open file for output
If you give the same name of a file which is already residing in the server then it gets overwritten.
Hope you can build a program using this fm's. -
Download data to specified directory in application server
HI experts,
i need to download data from internal table to specified application server directory which is already created. how i can check the directory is already availble in server and i need to specify the name of the file dynamically. after download how i can check the downloaded file in application server.
Edited by: Alvaro Tejada Galindo on Apr 14, 2008 5:27 PMHi,
If u wanna give file name dynamically, you can add it to the selection screen as parameter and let user enter the filename while executing.
To get file path, check FILE transaction.
To check the downloaded file in the server (guess u know the server name and path), Use AL11 transaction.
<REMOVED BY MODERATOR>
regards,
Ramya
Edited by: Alvaro Tejada Galindo on Apr 14, 2008 5:27 PM -
Picking a IDOC Flat File stored in SAP R/3 Application Server by SAP PI
Hi,
Can SAP PI pickup a IDOC Flat File stored in SAP R/3 Application Server Directory and send it back as an Inbound IDOC.
Scenario:
We have a data in the EXCEL Sheet, which will be used to a fill an IDOC and the IDOC will be just save in the SAP R/3 Application Server Directory, but can not be triggered due to its peculiar behavior. Afterwards, SAP PI should pole the SAP R/3 and pick up that IDOC Flat File from the R/3 Application Server and send it back to the SAP R/3 as an Inbound IDOC.
For Ref: IDOC does not have a Outbound Process Code, thus can not be triggered and send to SAP PI. It is always used as a Inbound IDOC in SAP R/3 system.
Regards,
SaurabhSAP PI should pole the SAP R/3 and pick up that IDOC Flat File from the R/3 Application Server
If SAP PI = 7.11 --> /people/william.li/blog/2009/04/01/how-to-use-user-module-for-conversion-of-idoc-messages-between-flat-and-xml-formats
send it back to the SAP R/3 as an Inbound IDOC
why to send some information again into R3 which it already has? cant some internal code in R3 read the info from excel and then update the IDOC directly? -
Application server file F4 help
Hi Gurus,
I am working for implementation proj in SAP ecc 6.0.
i just want to understand the purpose of the function module '/SAPDMC/LSM_F4_SERVER_FILE'.
Now i am working on a program which uses apacheta interface and checks for the duplicate invoices present in input file.
also I am not able to open the dataset from application server.
Give me the exact path to open a file from application server.
I also tried cg3y.Hi,
You can try with the FM 'EPS_GET_DIRECTORY_LISTING'. With this Fm module you will get you the list of files of a particular path in an internal table. Then you can populate this internal table in F4 help.
Hope this solves your problem. If any difficulty, come back to me about that.
Below are some other FM related to application server directory. Hope these Helps.
EPS_GET_DIRECTORY_LISTING
EPS_GET_DIRECTORY_PATH
EPS_GET_FILE_ATTRIBUTES
EPS_GET_FTP_SYSTEM_INFO
Regards,
Shailesh Jadhav
Maybe you are looking for
-
Can\'t install windows 8 on my hp touchsmart 600 pc
I have an HP touchsmart 600-1050 ru PC , serial number [Personal Information Removed], Product number : VS258AA-ACB running windows 7. I bought an upgrade for windows 8 on 27th October 2012 and up until now i can't have it run on my PC. Please tell
-
Upload videos to FB - Asha 311
How can i upload videos to facebook from my nokia asha 311? Moderator's note: We edited the post as it was moved to the most appropriate board.
-
How to run a application client in jboss?
Hi guys i'm new to EJB and may have some qns to ask. I have create ejb java files, compile and package it as jar. Next i also create the .jsp pages and package it as war. I package the war and jar together with the xml files for deployment. The file
-
mackeeper has detected a virus in the time capsule backup, it is not possible to delete the infected file. Do I mount time capsule in finder and then consign to junk the whole computer backup then create a fresh backup? Is that the only solution plea
-
Moving data between 64bit and 32 bit oracle servers
Is it possible to move the data bt 64 bit system (OS and oracle) to a 32 bit system using exp imp command? Thanks, Chau