How to check file if opened in local PC?
Dear exports:
I have met one problem in deal local excel file.
By user request , we need check if the file which we will use later is oepned .
I have find the help in the web , but seems not suit me require .
Some functions FM EPS_OPEN_INPUT_FILE or FM's RZL_READ_FILE_LOCAL of FILE_OPEN are recommended in the web ,
but it seems not suitable in local file check.
Hope some can advise me one solution to check if the excel file is opened before program execute.
Thanks a lot .
Hi,
You can check with FM GUI_UPLOAD. If you upload file using GUI_UPLOAD FM it raise error.
Un comment the Excetion which will give you exact error.
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17 .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
If file allready open it will give access_denied error i.e. sy-subrc value 13.
But I think it will work only after ecc6.0 properly.
You can also used the class CL_GUI_FRONTEND_SERVICES for same purpose.
Similar Messages
-
How to check File size of a Text file.
How to check File size of a Text file.
please explain me.
I am new in LabVIEW. and dont have much idea on this...;
Prashant Soni
LabVIEW Engineer
Solved!
Go to Solution.Hi Prashant,
and here's what you get when using the LV help...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
How to check the current open period
Hello ABAP Gurus,
Could you help on how to check the current open period...
Sample would be
current date = may 1, 2009 but period for may is not yet open
so open would be april period
Thanks in advance....
Edited by: nanz ruiz on May 27, 2009 3:34 AMHi,
Check the fieldas FRYE2,FRPE2,TOYE2,TOPE2 of table T001B for a given varient.
Regards
Vishnu Gupta -
How to check file name in APP server
Hi,
Iam writing some files to APP server .Iam unable to check those files by using AL11. How to check those files in APP server?Hi,
You can use this FM EPS_GET_DIRECTORY_LISTING.
Also please try this FM /SAPDMC/LSM_F4_SERVER_FILE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_apath.
* Open the Browse Dialog Box on the Application Server
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
IMPORTING
serverfile = p_apath
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc <> 0.
* No need to check for sy-subrc
ENDIF.
Regards,
Ferry Lianto -
How to find file is open or not in java
hai;
i want to know that , the particular file is opened on eariler or not,
can you help me how to find out , the file is earlier opened or not
thanks regardsdavvidmaria wrote:
hai;
i want to know that , the particular file is opened on eariler or not,
can you help me how to find out , the file is earlier opened or not
thanks regardsWhat do you mean by opened on earlier or not?
If you want to check to see if a certain file is open you could probably use the file class and check to see if you can write to the file check out the api
[http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html] -
How to check/update an open purchase order ?
Dear Experts,
Is there any Transaction to check the open purchase order?
Since our company has recently started working with SAP, my supervisor asked me to make a full report of it.
Thus, I would kindly like to ask
how we can check the open purchase order?
how to check/see purcahse orders that are not shipped yet?
how to see purchase orders that are currently overdue?
I will really appreciate if you can give me a detail overview of an purchase order(even more than the questions mentioned above).
Thankyou in advance.
Wishes,
JeevanHi Jeevan,
Check ME2L or ME2N with Scope of list as BEST or ALV and Selection paramters - WE101 or WE103
Thanks & Regards,
Ramagiri -
How to write file in user's local desktop
Hi,
Using the WriteFile action, i can write the file in inetpub/wwwroot in server.
Is there any way to write the file in user's local drive folder?
Although now i am writing the file to server and allowing the user to access it through URL but I suspect that there could be user concurrent issue or file contamination issue.
Constraint - The file should open with the default name.
If i try to open a local copy to the user (thru SaveasCSV() or URL) and allow the user to save the copy then the default name appear as Illumniator.
Regards,
AnilI think your current approach of saving to the web location and providing the user access via URL is the best approach. From a security standpoint I can't see that writing directly to a user's desktop/laptop would be a good idea.
If you are worried about naming or concurrency issues, then create sub folders that match their user name, or devise a naming convention that allows the objects to be unique between users and purpose. -
How to check file is exists in specified path in content server or not
i m using JDevloper 11.1.1.6.0
I want to upload file using RIDC functions,but before uploading it i have to check wheather it is already present on specified path in content server or not.
How i check it.I tried to write a (simpler) version of my own code:
public static Results CheckInToFolder(File f) {
// create the binder
DataBinder checkinDoc = idcClient.createBinder();
// populate the binder with the parameters
checkinDoc.putLocal("IdcService", "CHECKIN_UNIVERSAL");
checkinDoc.putLocal("dDocTitle",
"Document checked in through RIDC at " +
new Date());
checkinDoc.putLocal("dDocType", "Document");
checkinDoc.putLocal("dDocAccount", "");
checkinDoc.putLocal("dSecurityGroup", "Public");
checkinDoc.putLocal("dCollectionID", "909964822906001607");
// add a file
// execute the request
try {
checkinDoc.addFile("primaryFile", f);
} catch (IOException e) {
myExecutable.logEvent("File" + f.getName() + " not found.");
return null;
ServiceResponse checkinResponse;
try {
checkinResponse = idcClient.sendRequest(userContext, checkinDoc);
myExecutable.logEvent("Check-in successful. Size:" + f.length() + " bytes");
catch (oracle.stellent.ridc.protocol.ServiceException e) {
myExecutable.logEvent("ServiceException");
e.printStackTrace();
return null;
catch (IdcClientException e) {
myExecutable.logEvent("Check-in failed.");
e.printStackTrace();
return null;
DataBinder checkinData;
try {
checkinData = checkinResponse.getResponseAsBinder();
Results res =
new Results(checkinData.getLocal("dID"), checkinData.getLocal("dDocName"));
myExecutable.logEvent("Successfully got response - dID is " +
res.getDID() + ", dDocName is " +
res.getDDocName());
return res;
catch (oracle.stellent.ridc.protocol.ServiceException e) {
myExecutable.logEvent("ServiceException2");
//e.printStackTrace();
return null;
catch (IdcClientException e) {
myExecutable.logEvent("Unable to get response.");
e.printStackTrace();
return null;
}What I'm getting is this:
Mon Aug 13 14:51:29 CEST 2012 0ms: Started
Mon Aug 13 14:51:29 CEST 2012 57ms: Connection to idc://192.168.44.129:4444 successfully established.
Mon Aug 13 14:51:29 CEST 2012 102ms: Check-in successful. Size:702 bytes
Mon Aug 13 14:51:29 CEST 2012 5ms: ServiceException2
Mon Aug 13 14:51:29 CEST 2012 0ms: Finished
This means:
a) it does, indeed, return the exception (oracle.stellent.ridc.protocol.ServiceException)
b) you could use this mechanism for your code
c) it is, indeed, primaryFile.name what's being checked
I will also take a look at the other service to perform the check prior to check-in service call. -
How to set file to open with the latest entry?
My "sent" file always opened at the latest entry showing the last email I'd sent but, for some unknown reason, it now loads at the top of the file showing the earliest entry. How do I get it to go back to showing the latest entries, the bottom of the file, rather than the top of the file?
Click on the header labeled DATE to sort on that column. Click the same header a second time to reverse the sort.
-
How to check file name in local c drive and run exe file
Hi All,
I'm newbie user in action script. How can i check sepecific
file name in local c:\ drive and if file doesn't exist in local
drive download from server and run and if exist go to frame ..... .
Please help to me.
Thanks,Dear Marghoob Suleman
Thank you very much for your kind help.
Thanks in advance -
How to read file header/open filein binary mode
i am using FileConnenction API to read from a file. how can i open a file in binary mode so that i can read file header. In other words i want to open a file in binary mode.
You can always try looking at the [Header Signatures|http://www.techpathways.com/uploads/headersig.txt]. But it would probably be easier to adjust your application so it doesn't have to guess.
~ -
How to check file format in application server?
Hi guys,
i have an inbound zip file(which contains PDF files) in the application server .I need to check if the file is in base 64 format or in hexadecimal format.Can any one help me out with the suggestions or with probable solution.
Regards
SnehasishThanks for your reply.i am able to get the the zip file data in xstring with following code .
.now what should be logic to determine that the data in xstring is in base 64 or in hexadecimal format?
data: lv_zip type xstring.
OPEN DATASET lc_file FOR INPUT IN binary MODE.
IF sy-subrc = 0.
read dataset lc_file into lv_zip.
endif.
CLOSE DATASET lc_file.
Regards
Snehasish -
How to check files in the directory using JSP?.
Hi,
How can i check the file is directory or file and readable or writable and file size and type of file(Ex. jpg, txt, doc., etc). i want to list the specific type of file in the particular directroy.. please help me..
Regards
CHinnaWith the File class, using the methods isFile(), isDirectory(), canRead(), canWrite(), length() and getName()
With File.listFiles() you can get a directory listing. If you want to limit the amount of files returned, you can pass your own FileFilter to it.
http://java.sun.com/javase/6/docs/api/java/io/File.html -
Message KO020 - How to check all the open down payments and request.
Hi Comunity,
I need to check wich are all the open down payments in the system and then clear them, to close an order in KO02 or KO88. Please let me know if there is a way to verify the open down payments por vendors, for customers, for AUC, or pending payments request that could be causing the error message ko020.
Thanks a lot.
Vero.Hi
1) Use below parameters of structure SSFCTRLOP
NO_OPEN, NO_CLOSE: These two flags prevent the print request from being closed after accepting the output of the Smart Form and allows you to include all other form output into this print request. The value should be like the following:
1st call:
NO_OPEN = SPACE.
NO_CLOSE = 'X'.
nth call:
NO_OPEN = 'X'.
NO_CLOSE = 'X'.
last call:
NO_OPEN = 'X'.
NO_CLOSE = SPACE
2.SSFCOMPOP: Structure for the output option.
TDNEWID: A flag indicating whether a new request is created.
4) Define one data wa_print_control referencing the structure SSFCTRLOP, and define another data variable wa_output_option referencing the structure SSFCOMPOP in the top include file of this report.
5) Clear the above two work areas before the print loop happens on the internal table that contains the selected invoice headers.
6) Initialize these two work areas with the values which would not change during the print loop as the following code fragment:
wa_print_control-no_dialog = ' '. u201DShow print setting dialog
wa_print_control-preview = 'X'. u201DEnable print preview
wa_output_option-TDNEWID = 'X'. u201CNew spool request.
7) In the loop at the internal table which holds the selected invoice headers, set blank value to of the field wa_print_control-NO_OPEN and set u2018Xu2019 to the field wa_print_control-NO_CLOSE for the first loop at the AT FIRST event because it will be the first call to the function module of the smartform. The code is bellow:
print_control-no_open = ' '.
print_control-no_close = 'X'.
8) Set blank value to the field wa_print_control-NO_CLOSE to close the spool request for the last loop at the AT LAST event.
wa_print_control-NO_CLOSE = u2018 u2018
9) Call the function module generated by the Form Design by passing the print control work area and output area. -
How to check file exist in applet?
I would like to check the existance of a file from an applet. How can I achieve that? I'd tried many attempts but still fail to get an answer. Please kindly help.
Below are my file structures:-
folder/applet/myApplet.java
folder/appletView.jsp
folder/image/image1.gif
I would like to check if image1.gif exist. if yes, then load and display it in applet, but I having problem on the how to specify the file location.Assuming image1 is in the same folder as the applet:
InputStream is;
byte[] buf = new byte[1024];
URLConnection urlc = null;
try {
URL a = new URL(this.getCodeBase(),"image1.gif");
urlc = a.openConnection();
is = urlc.getInputStream();
int len = 0;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
while ((len = is.read(buf)) > 0) {
bos.write(buf, 0, len);
// close the inputstream
is.close();
} catch (IOException e) {
try {
// image1.gif probably does not exist
// now failing to read the inputstream does not mean the server did not send
// any data, here is how you can read that data, this is needed for the same
// reason mentioned above.
((HttpURLConnection) urlc).getResponseCode();
InputStream es = ((HttpURLConnection) urlc).getErrorStream();
int ret = 0;
// read the response body
while ((ret = es.read(buf)) > 0) {
// close the errorstream
es.close();
} catch (IOException ex) {
// deal with the exception
}
Maybe you are looking for
-
How to call a Stored Function with OUT parameter of %rowType from Java
Hi everyone, I'm getting crazy trying to make this work. I have a function (not developed by me) in Oracle 10g declared in this way: type tab_RLSSP is table of TB_RLSSP_STOSTPRPAR_CL%ROWTYPE index by binary_integer; FUNCTION DBF_PERL_LISTA_PRATICHE (
-
Download error 15. Please help.
I am running a Macbook Pro, Vers 10.7.5 Every time I try to download a CC App, it stops with an error at 42%. Exit code: 15 - 0 fatal error(s), 2 error(s) ERROR: ASU has quit unexpectedly. ERROR: Media DB Error : 18 I have looked at many similar dis
-
I have a desktop Mac OS 10.2.8, which is the latest Firefox to download?
I have a desktop Mac OS 10.2.8, which is the latest Firefox to download? It's Jaguar, the latest I can load on my Mac. I only use it to get/send Yahoo mail. What is the latest version I can use, and where can I get it. Right now am running Mozilla Fi
-
Please can someone tell me where to find my redemption code Please can someone tell me where to find my redemption code
-
Help needed diagnosing log-in, crashing problems
Hi. Mac Pro (early 2008) 14GB RAM, 10.10.2 Symptoms: - intermittent failing to log in to Guest account (seems to require password) - intermittent failing to log out of normal user account (just hangs) - intermittent app crashes, including simultaneou