Read content of a directory
Hi all,
I'm searching for a way on how to read the content of a directory on a local machine..
This has to be done in background.
Does someone has an idea ?
tia,
Björn
Hi Bjorn,
try to search on and use the open dataset - read dataset - close dataset.
Hope this helps.
Regards,
Vitz
Similar Messages
-
In my macbook pro 5,2 snow leopard (10.6.8), Finder taking long time to load contents of any directory. Please help?
I have already tried to spotlight re-indexing but it did not help. I am hardly able to work on it, almost for each directory I browse its keeps on spinning for 1min.Download iTunes from Apple's web site and install it. Don't use Software Update.
-
PI sender communication channel not reading files from NFS directory
Hello,
I have a sender communication channel configured to read file from NFS directory which is on ECC server. A program in ECC generates the file and puts it on the ECC server in the output directory. PI sender communication channel is supposed to pickup this file and process it. If I give the NFS path as the source directory, I am getting error: Configured source directory '//Server/DIR/OUT' does not exist. I tried putting '
Server\DIR\OUT' too but same error. Do I have to add the NFS path of ECC into PI as logical path?
Any suggestions?
Thanks,
SangitaHello Sangita,
Your ECC server is an external system, therefore you need to activate FTP service in that system and use the transport protocol FTP:
http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
You can use NFS protocol when you have a local directory in XI server.
Best Regards,
.Luis Bernal. -
FTP to Read content of Text/xml file
Hi,
I need a help for reading content of text/xml file through FTP. Below I just am explaining the scenario.
Our application server is in UNIX. Now we have to run a report program to access in to a FTP server which is in windows platform. Using FTP_CONNECT, FTP_COMMAND, FTP_DISCONNECT we are able to connect to FTP server and also able to copy files from FTP server to SAP application server. After copied in application server, we are able to read the content of the txt file in to internal table in ABAP program using OPEN DATASET. But our requirement is that we want to read the text or xml file content into internal table while accessing into FTP server from SAP application instead of after copying the file into application server.
So please help me to solve my problem.
-PkThank you Bala,
But can you help me what should I pass against FNAME and CHARACTER_MODE Import parameter? Should I pass the full path of the file with name or only I have to pass file name ? For example if my text file name in FTP Server is test.txt and the IP of the ftp server is 10.10.2.3 then should I pass the value against FNAME as '
10.10.2.3\xyz\text.txt' ? Here xyz is the name of the directory in C drive where test.txt is exist.
Please help me.
-pk -
How to delete a READ ONLY file from Directory
Hi Friends,
how to delete a READ ONLY file from Directory , file is in my system only.
Please help me .
note: its read only file.
Thank you.
Karthik.hI,
try with this statement.
delete dataset <datasetname>.
this will definitely work.
Regards,
Nagaraj -
How to find from the data dict if a user has read access on a directory
How to find "dynamically" if a user has READ access to a directory object.
I want to know if there is a data dictionary table that holds if a user/schema has read access to a directory object.
I know there is an dba_directories table and an all_directories table but they dont give information as to which user has read access granted to the directory.Not so difficult.
select 'YES'
from all_tab_privs A, all_directories B
where a.grantee = 'USERNAME'
and a.table_name = b.directory_name
and b.directory_path = 'PATH YOU ARE LOOKING FOR'
How to find "dynamically" if a user has READ access to a directory object.
I want to know if there is a data dictionary table that holds if a user/schema has read access to a directory object.
I know there is an dba_directories table and an all_directories table but they dont give information as to which user has read access granted to the directory. -
Error message on Itunes. Cannot read contents of Ipod....
I forgot to eject my sons Ipod touch before I unplugged it from the USB. Nowwhen I plug it in it tells me itunes cannot read contents of ipod must restore to factory settings.. Please help?! I've tried restarting my computer and Ipod. I've updated Itunes. I used a different cord and I went into settings and reset everything. I'm affraid to restore th Ipod because he has bought games that I don't want him to loose.... Any suggestions?
That happens when you do not eject the iPod and the iPod is syncing.or upddating.
Connect the iOS device to your computer and restore via iTunes. Place the iOS device in Recovery Mode if necessary to allow the restore.
If recovery mode does not work try DFU mode.
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
For how to restore:
iTunes: Restoring iOS software
To restore from backup see:
iOS: How to back up
If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
You can redownload iTunes purchases by:
Downloading past purchases from the App Store, iBookstore, and iTunes Store -
How do I install Reader 11 to the directory of my choice?
I have downloaded the Reader 11 for Windows installation file to my hard drive. Now, how do I install Reader 11 to the directory of my choice?
In Full UI mode you can use the "change destination folder" button to specify your chosen directory.
Here is the example
Else in command line you can provide INSTALLDIR="" parameter to install at custom location.
Hope this helps. -
ALV GRID Problem with reading contents
Hi there! I'm quite new with ABAP and I have some problems with the syntax of it. Maybe I should first describe my aim and then I'll show you my code.
1. I read contents from two database tables, called 'zbc_dan_registry' and 'zbc_dan_category'.
'zbc_dan_registry' has 2 columns: name, value.
zbc_dan_category' has 1 column: category.
Now I want to have an ALV Grid, that displays the contents of 'zbc_dan_registry' and one additional column with dropdown fields, where the user can select a category for each row. This is, what my code already does.
Now I want to save the contents of the whole table in a new table 'zbc_dan_registrz' (you see: 'registrz', not 'registry'!) with 3 columns:
name, category, value.
My problem is, how can I read the contents of the ALV Grid, with the user selected category for each row, and save them in an internal table? I've tried to adapt the code of "BCALV_EDIT_04", but I don't get it running.
Some detailled help would be great, you know, I'm really working hard to understand ABAP, but it's really hard for me. Thanks for your support and help!!
Here's my code so far:
*& Report ZBC400_DAN_TESTNO4
REPORT ZBC400_DAN_TESTNO4.
DATA: lt_registrz TYPE TABLE OF zbc_dan_regstrz WITH HEADER LINE,
lt_category TYPE TABLE OF zbc_dan_category WITH HEADER LINE,
ls_category TYPE zbc_dan_category, "Struktur Kategorie
ok_code LIKE sy-ucomm,
container_r TYPE REF TO cl_gui_custom_container,
grid_r TYPE REF TO cl_gui_alv_grid,
gc_custom_control_name TYPE scrfname VALUE 'CONTAINER_REG',
fieldcat_r TYPE lvc_t_fcat,
layout_r TYPE lvc_s_layo,
lt_ddval TYPE lvc_t_drop,
ls_ddval TYPE lvc_s_drop,
c TYPE i.
CLASS lcl_event_receiver DEFINITION DEFERRED.
DATA g_verifier TYPE REF TO lcl_event_receiver.
DATA: BEGIN OF gt_outtab OCCURS 0.
INCLUDE STRUCTURE zbc_dan_regstrz.
DATA: celltab TYPE lvc_t_styl.
DATA: END OF gt_outtab.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
TYPES: BEGIN OF lt_registrz_key. "Struktur mit den Schlüsseln der Tabelle 'Registry'
TYPES: name TYPE zbc_dan_name,
value TYPE zbc_dan_value,
category TYPE zbc_dan_cat.
TYPES: END OF lt_registrz_key.
TYPES: ls_registrz_keys TYPE STANDARD TABLE OF lt_registrz_key,
ls_registrz_table TYPE STANDARD TABLE OF zbc_dan_regstrz.
METHODS: get_inserted_rows EXPORTING inserted_rows TYPE ls_registrz_keys.
METHODS: refresh_delta_tables.
METHODS: handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
* METHODS: get_inserted_rows EXPORTING inserted_rows TYPE registrz_keys.
* METHODS: refresh_delta_tables.
PRIVATE SECTION.
DATA: inserted_rows TYPE ls_registrz_keys.
DATA: error_in_data TYPE c.
METHODS: get_cell_values IMPORTING row_id TYPE int4 pr_data_changed TYPE REF TO cl_alv_changed_data_protocol EXPORTING key TYPE lt_registrz_key.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
DATA: ls_good TYPE lvc_s_modi,
ls_new TYPE lvc_s_moce.
error_in_data = space.
IF error_in_data = 'X'.
CALL METHOD er_data_changed->display_protocol.
ENDIF.
ENDMETHOD.
METHOD get_cell_values.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'NAME'
IMPORTING e_value = key-name.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'VALUE'
IMPORTING e_value = key-value.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'CATEGORY'
IMPORTING e_value = key-category.
ENDMETHOD.
METHOD get_inserted_rows.
inserted_rows = me->inserted_rows.
ENDMETHOD.
METHOD refresh_delta_tables.
clear me->inserted_rows[].
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
SELECT client name value
INTO CORRESPONDING FIELDS OF TABLE lt_registrz FROM zbc_dan_regstry.
SELECT category INTO CORRESPONDING FIELDS OF TABLE lt_category FROM zbc_dan_category.
CALL SCREEN 0100.
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK'.
SET SCREEN 0.
MESSAGE ID 'BC400' TYPE 'S' NUMBER '057'.
WHEN 'SAVE'.
PERFORM save_data.
WHEN OTHERS.
ENDCASE.
ENDMODULE.
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
ENDMODULE.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'DYNPRO100'.
SET TITLEBAR 'D0100'.
ENDMODULE.
MODULE display_alv OUTPUT.
PERFORM display_alv.
ENDMODULE.
FORM display_alv.
IF grid_r IS INITIAL.
*----Creating custom container instance
CREATE OBJECT container_r
EXPORTING
container_name = gc_custom_control_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*----Creating ALV Grid instance
CREATE OBJECT grid_r
EXPORTING
i_parent = container_r
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
CREATE OBJECT g_verifier.
SET HANDLER g_verifier->handle_data_changed FOR grid_r.
*----Preparing field catalog.
PERFORM prepare_field_catalog CHANGING fieldcat_r.
*----Preparing layout structure
PERFORM prepare_layout CHANGING layout_r.
*----Here will be additional preparations
*--e.g. initial sorting criteria, initial filtering criteria, excluding
*--functions
CALL METHOD grid_r->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
is_layout = layout_r
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
CHANGING
it_outtab = lt_registrz[]
it_fieldcatalog = fieldcat_r
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ELSE.
CALL METHOD grid_r->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ENDIF.
CALL METHOD grid_r->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD grid_r->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
ENDFORM.
FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZBC_DAN_REGSTR2'
CHANGING
ct_fieldcat = pt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
LOOP AT pt_fieldcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN 'NAME'.
ls_fcat-coltext = 'Name'.
ls_fcat-outputlen = '40'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'VALUE'.
ls_fcat-coltext = 'Wert'.
ls_fcat-outputlen = '30'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'CATEGORY'.
LOOP AT lt_category into ls_category.
ls_ddval-handle = 1.
ls_ddval-value = ls_category-category.
* ls_ddval-style = cl_gui_alv_grid=>mc_style_enabled.
APPEND ls_ddval TO lt_ddval.
ENDLOOP.
CALL METHOD grid_r->set_drop_down_table
EXPORTING it_drop_down = lt_ddval.
ls_fcat-edit = 'X'.
ls_fcat-drdn_hndl = '1'.
ls_fcat-coltext = 'Kategorie'.
MODIFY pt_fieldcat FROM ls_fcat.
ENDCASE.
ENDLOOP.
ENDFORM.
FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
ps_layout-zebra = 'X'.
ps_layout-grid_title = 'Kategorie zur Registry hinzufügen'.
ps_layout-smalltitle = 'X'.
ENDFORM.
FORM save_data.
DATA: ls_ins_keys TYPE g_verifier->ls_registrz_keys,
ls_ins_key TYPE g_verifier->lt_registrz_key,
ls_registrz TYPE zbc_dan_regstrz,
ls_outtab LIKE LINE OF gt_outtab,
lt_instab TYPE TABLE OF zbc_dan_regstrz.
CALL METHOD g_verifier->get_inserted_rows IMPORTING inserted_rows = ls_ins_keys.
LOOP AT ls_ins_keys INTO ls_ins_key.
READ TABLE gt_outtab INTO ls_outtab
WITH KEY name = ls_ins_key-name
value = ls_ins_key-value
category = ls_ins_key-category.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_outtab TO ls_registrz.
APPEND ls_registrz TO lt_instab.
ENDIF.
ENDLOOP.
INSERT zbc_dan_regstrz FROM TABLE lt_instab.
CALL METHOD g_verifier->refresh_delta_tables.
ENDFORM.Hi Hans,
You raised the Question in the Webdynpro ABAP forum. Here its very diffcult to get the answer from this forum. Please close it here and raise the same question in ABAP General Forum there you will get faster and so many anwsers.
Please close the question here.
Warm Regards,
Vijay -
ITunes 11.1.3.8 won't read contents of any device
Using Win8, iTunes won't read contents of any device. using 11.1.13.8
Have seen many fixes for it.
Need help. Newer computer with new install. New iPhone and iPad Retna
Please help if you can.
ThanksWhat do you mean "iTunes won't read contents"?
What specifically is happening?
Was the ENTIRE iTunes folder copied from the old computer to the new computer? iDevices are not and have never been backup devices or a way to move content to a new computer. -
Reading all files on directory using "utl_file" package...
I need to read all files in directory via PL/SQL. I don't know
name files (are data dynamics create for automation system),
only I know your extensions.
Can I do this using the package "utl_file" or I need to create
program in another language (C, C++, for example)?
Any ideas...
Thanks.Hi,
you can't do that with the UTL_FILE package (it can't retrieve
file names).
A very simple solution would be, if you created on OS-level a
file which contains the filenames of directory and then read this
file using UTL_FILE. With the information on all file names you
can enter a loop which opens and reads all files again using
UTL_FILE.
A more mundane solution could be to use the features on the iFS.
Cheers
Gerald -
How to read a files in directory and its subdirectories
I wants to read all files in directory, its subdirectory and further till end the files in the subdirectory of subdirectories.
I have some idea the I can do this by using recursive function, using the functions isDirectory(), File.list() etc.
How much you can please help me. (via code of logic)import java.io.*;
import java.net.*;
public class MyCon
public static void main(String args[]) throws
IOException
File file=new File("c:/");
openDirectory(file,"");
System.in.read();
static void openDirectory(File file,String indent)
String[] string=file.list();
String path=file.getAbsolutePath();
for(int i=0;i<string.length;i++)
File temp=new File(path+"/"+string);
if(temp.isDirectory())
openDirectory(temp,indent+" ");
else
System.out.println(indent+temp.getName()); -
Read contents of file into outputstream
Can anyone suggest that what are the best methods to read contents of a file (better cater to both conditions: big file size and small file size) into outputstream and send through socket...
Thanks.Thanks for the answer. But I would like to ask the following question:
I have a VB application which generates a file. I have a Java application which read the contents of the file.
is it possible that VB side calls the read() (file) and send() (through socket to destination) methods in Java application once the file is generated? Actually my objective is VB is responsible for generating a file for Java application to read data from and then send the data (not file) to destination....If it is impossible to achieve, any alternative to achieve this?
Thanks
Edited by: whkhoo on Jun 15, 2008 8:45 PM -
Read content of email type MHT
Hello all,
I have a small problem to read content of incoming emails in SO , where OBJ_TYPE = 'MHT'.
Using FM SO_DOCUMENT_READ_API1 I get content of email in table OBJECT_CONTENT, and after
conversion I have text like this:
"Content-Type: multipart/related;###boundary=" =_Part_7_9758530.1276774400182"#### =_Part_7_9758530.1276774400182##Content-Transfer-Encoding: quoted-printable##Content-Typ
e-mailu jsou data z formul=E1=F8e vypln=ECn=E9ho u=9Eiv=##atelem na str=E1nk=E1ch www.cez.cz.####typ formul=E1=F8e: PLYN##verze formul=E1=F8e: DOM_EXT##kampa=F2: KAM2####E
: 5E5200ZZ02-90002061=20#### ##=_Part_7_9758530.1276774400182 ######################################################################################### # # # # #"
This is HTML code with tag , but I need to display (and save to DB) to customer only plain text....Can anybody help me to get a plain text of email ?
Thanks a lot for any idea...
Milan DobiasSolved, using this thread [how to decode Quoted-printable content to plain text;
Edited by: Milan Dobias on Jul 21, 2010 9:50 AM -
Read content of file which is ZIPed
I need to read contents of a file which is present in ZIP file.
The zip file is present on online server. I am able to get the Zip Input stream for the Zip file and also able to retrive the file names which are present but when I am trying to retrive the content of file is get a String which has only the file names of the zip. Please suggest what to do.
Following is my Code.
// aConn.getInputStream() Gives me access to Zip file present on online Server
ZipInputStream fileIn = new ZipInputStream(aConn.getInputStream());
anEntry = inputStream.getNextEntry();
if (anEntry != null) {
String filename = arEntry.getFilename();
byte[] b = new byte[2024];
fileIn.read(b);
sb.append(b.toString());
}Reading an input stream into an array of bytes and then calling toString() on that byte array isn't going to give you the contents of the input stream meaningfully. For one thing it might not even be textual data. And secondly that's not how you get textual data.
A better approach would probably be to get the number of bytes of the given entry from the ZipEntry.getSize method, create a byte array of that size, load only that many bytes, and then (if you're sure it's text data) send the byte array to a String constructor. Or you could use a java.io.ByteArrayOutputStream for that. Note that you'll need to know the character encoding for this.
Maybe you are looking for
-
When attempting to view the date track history for one employee, errors out
Hi All When I attempt to view the date track history for one employee, it gives errors. To get the details, the navigation is : 1. Search for employee xxxxxx 2. click on Assignment button 3. click on Date Track History. 4. Receive error APP-DT-52554.
-
Is it possible to display a date as (DD-MON-YYYY) in excel output using excel template in xml publisher where date should be displayed as date only not string.
-
I am trying to delete a large number of songs from my itunes library without having to do it one at a time. How can I do this. All of my songs have check marks by them. Help!
-
I have still empty Notes in iCloud
When I open iCloud on my PC, Notes are still empty not synchronized. On my iPhone and iPad is everything okay. What should I do?
-
Finding caller program in a RFC call
Hi experts, We are having lots of CALL_FUNCTION_NOT_FOUND short dumps in one of our systems. The errors are caused because other systems call a function that does not exist, so the dumps are created. What we would like to know is what program is doin