How to read file WITHOUT full path using TEXT_IO?

We have a scenario like this:
-- We have a Telco application.
-- That has 3 types of installations. English and Spanish
-- We have 2 App Servers (Eng & Spa) for the 2 installation types.
-- But there is only ONE DB. I.e. users logging into Eng or Spa AS versions login to the same DB.
-- We have to maintain 2 login forms because of Eng and Spa, because the menu labels have to come in 2 langs.
-- I am trying to have one tree menu for this.
-- To do this I did this.
-- Put a text file in the Forms directory of the AS.
-- The file has just one line. ENGLISH or SPANISH.
-- I read this file and find out the language and then show labels according the language.
Problem is that when I used TEXT_IO and gave file name like this filename:=GET_FILE_NAME('Avabill_AS_Language.txt', File_Filter=>'Text Files (*.txt)|*.txt|');
I get a error saying file not found.
I found out that with TEXT_IO you need FULL PATH of the file. Thing is path of the installation depends of installation to installation. I cannot create a parameter in the DB since the DB is COMMON. I HAVE TO use a text file in the AS directory.
Is there any other way like reading the Default.env file or FormsWeb.cfg? Is there a parameter in any of these files which specifies the forms directory absolute path. I studied both file but could not find an entry.
Any workaround would be greatly appreciated.

Thanks BaiG for the quick response.
U r right about that GET_FILE_NAME.
I removed that and put the file name only and tried. Still get the same error.
FUNCTION Avabill_Deployment_Type RETURN VARCHAR2 IS
v_language VARCHAR2(100);
in_file Text_IO.File_Type;
BEGIN
in_file := Text_IO.Fopen( *'Avabill_AS_Language.txt'* , 'r');
Text_IO.Get_Line(in_file, v_language );
Text_IO.Fclose(in_file);
RETURN v_language;
EXCEPTION
WHEN OTHERS THEN
Text_IO.Fclose(in_file);
ALERT_MESSAGE(1,'FILE NOT FOUND: ' || SQLERRM);
RETURN 'Normal';
END;
I get this error:
*302000: non-ORACLE exception*
As for you query:
-- We have 2 app servers. One English and One Spanish.
-- So we have 2 sets of forms. One English with English labels in the forms and the other with Spanish Labels.
-- So we HAVE to have 2 menu forms as well, don't we? When the menu form is run how does it know whether the app server is English or Spanish.
-- There is no way to find out. We cannot use a DB variable since BOTH use the same DB (at the same time). Eng users will enter in English while Spanish users will enter in Spanish.
I don't see how we can have one menu form for this purpose. Can u elaborate your method further please?

Similar Messages

  • How can i zip without full path?

    I zip a file with this servlet, but when i unzip the file, it save my file with a full path... how can i do? thanks
    CODE
    import java.io.*;
    import java.util.zip.*;
    public class ZIPFILE
    public String DOPOSTPROCESS(String filename)
    FileOutputStream fileout = null;
    byte[] buf = new byte[1024];
    try
    File f1 = new File(filename);
    File f2 = new File(filename+".zip");
    String fileoutname=filename + ".zip";
    fileout = new FileOutputStream(fileoutname,false);
    ZipOutputStream out = new ZipOutputStream(fileout);
    // Compress the files
    FileInputStream in = new FileInputStream(filename);
    // Add ZIP entry to output stream.
    out.putNextEntry(new ZipEntry(filename));
    // Transfer bytes from the file to the ZIP file
    int len;
    while ((len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    // Complete the entry
    out.closeEntry();
    in.close();
    // Complete the ZIP file
    out.close();
    f1.delete();
    f2.renameTo(f1);
    catch (IOException e)
    try
    catch(Exception e1)
    return("Errore CR2CRLF "+e);
    return null;
    }

    If the path name consists of one or several directories and then by the file name, you could use only the file name portion for the insertion into the zip archive.

  • How can I paste the full path name into the find file dialog?

    I've copied a full path name using CMD-C.
    Now I click on a link in some web page (does not matter which one) which lets me upload a file.
    The standard apple file selector dialog pops up (sorry don't know the official apple name for this dialog), to let me navigate and select the file.
    How can I paste the file name?  Or how can I tell the dialog popup to navigate to the file whose full path name is in the clipboard?

    Here is an image showing the file browser dialog I'm referring to.

  • How do I see the full path in Yosemite's spotlight?

    How do I see the full path in Yosemite's spotlight? (cmd shows only partial path)
    Seeing the full path would make work much easier finding my articles which I have put in distinct catalogues.

    CazooMAC,
    Holding ( Command ) to show the path of a file that is displayed at the bottom of the preview pane in Spotlight is the only way to display the path in the Spotlight app its self.
    If you hold ( Command ) and double click the item you are looking to get a path of it will open that items containing folder in Finder. From there you can get the full path using a bunch of different methods. An Example would be using Finders Get Info option. The Keyboard shortcut is ( Command ) ( I ).
    There is another thread that covers the topic of getting a clean path in Finder. Or basically a path that one doesn't have to type out manually, without those little arrows in between folders. It can be found here: How to get a clean file path in OS X Yosemite?
    My Suggestion to get a clean path there is as follows:
    Another way you can get the path, and yes I'm aware its cumbersome, is you can open the "Go to Folder" window and drag your folder or file into it and it will give you the path. Free of modifiers and without opening another application.
    I find it works best if when you start there is no Finder windows open. If you leave one open you just have to open another one as it doesn't let you drag and drop from the one with the "Go to Folder" window in it.
    Finder has to be Active > Select Go ( Menubar ) > Go to Folder...
    Or you can use the keyboard shortcut ( Command ) ( Shift ) ( G )
    At this point I like to clear out the address field as if there is anything in there it will stay.
    Next Open a new Finder window.
    Examples on how to: Select File > New Window, or the keyboard shortcut ( Command ) ( N )
    Find the File or Folder your interested in then drag and drop it in the Address Field of the "Go to Folder" window and it will give you the path.
    If you would like to send Apple feedback about this you can do so here: https://www.apple.com/feedback/macosx.html
    Hope that helps,
    Weston

  • How do I get the full path and filename of the current document?

    I'm writing a format plug-in. How do I obtain the full path and filename of the current image (document) from within my plug-in? Any help would be greatly appreciated!

    I actually just figured this out. For anyone else who would like to know, check out the propetizer sample code in the photoshop sdk. It makes a "filter" plug-in that just spits out all the properties of the document you could ever want to know about. The function I used to get the full path and filename of the current document is PIGetDocumentName(). I hope this helps someone eventually...

  • [Urgent] How to read files from different directories?

    I am new to Java Programming, I would like to know how to read files from directories other than the current one? (example as follows)
    ProjectDirectory
    |--MainDirectory
    |--MainProgram.java
    |--SupplementDirectory
    |--SupplementProgram.java
    |--Pictures
    |--Image.gif
    What should I write in the MainProgram.java so that I can use the supplementProgram.java from MainProgram and read the Image.gif file from the MainProgram.java?
    Thanks

    Run through the I/O tutorial here. It should get you up to speed on this sort of thing...

  • Where can I download the Adobe Reader file without installing it?

    Where can I go to download the Adobe Reader file without installing it?

    You can use the Adobe FTP site to download any Reader version: ftp://ftp.adobe.com/pub/adobe/reader/

  • Is there a way to exclude files from source paths using patterns

    Hi
    Does anyone know of any way to exclude files from source paths using patters rather than individually selecting the files? UI doesn't allow to specify any pattern. But if you look at the jpr file there are other places where patterns are allowed. Can the same pattern be copied and applied to excluded files?
    Pat

    Drag the files, or press Option when pasting them; this accesses the Move To function.
    (124070)

  • Help!!! Can Anybody tell me how to read bookmarks of MS word using ABAP?

    It took me around 3 days , but there is still no solutions...
    Can Anybody tell me how to read bookmarks of MS word using ABAP ?
    Many thanks.

    Dear Nick  ,
    Thanks for your attention!
    I have MS word installed in the R3 server , and I uploaded my word doc with some self-defined bookmarks into SAP R3 system.
    Now I want to read these bookmarks using ABAP in this R3 system...
    Is it clear enough?
    Looking forward to your solution ...
    Thanks again..
    Best Regards,
    Leon.

  • Unable to read file. may be in use missing or corrupt

    I'm trying to transfer my music from Zen Micro to pc. Some music transfered but most didn't. When I try to transfer I get that message " Unable to read file, may be in use missing or corrupted. Did the disc cleanup for zen also. Any help would be great.

    Agapyla, two possible reasons you can't see the .idlk files. One, you're looking in the wrong place, or two, your OS doesn't consider .idlk files to be "system files."
    Option 1: In InCopy or InDesign, click inside the story you're locked out of, and open the Links panel. That story will be highlighted. Right-click on the highlighted story and choose Reveal in Finder (or Reveal in Explorer if you're on Windows).  That will bring you to the folder where the InCopy story (ICML) is. It is inside that same folder where you'll find the IDLK file.  A story's IDLK file is always at the same level as its ICML file. It might be at the top or bottom of the list of files in that folder if you're viewing them as a list sorted alphabetically. So scroll through.
    Option 2: See if there's a setting in your OS to view "invisible" files, or Google for a utility.  I think "system" and "invisible" are the same, but maybe not.  Personally I use my FTP program which lets you see your local hard drive on one side of the window and the remote server on the other side. The FTP program defaults to showing *all* files on both sides. So for me it's a quickie way to see the IDLK files. The IDLK files begin with characters that force the OS to not show them, like a period or a tilde.
    Honestly, if you're seeing a slash through a pencil icon, that file is locked, so there's an IDLK file somewhere. That's the only way ID or IC will show that icon. 
    In case of emergency: In InDesign (can't do this in InCopy), select the locked story and Unlink it in the Links panel from the Links panel menu. It breaks the link to the original ICML file an turns it back into a normal InDesign text frame. Then select the frame, and export it to InCopy format again *with a different filename* than before, but saves it to the same place as the other ICML stories for that layout.
    AM

  • I am looking for a way to automate index creation using Adobe Reader Pro without having to use the screen user interface, as the indexing has to be run by a batch process.

    I am looking for a way to automate index creation using Adobe Reader Pro without having to use the screen user interface, as the indexing has to be run by a batch process.

    [discussion moved to Creating, Editing & Exporting PDFs forum.]

  • TEXT_IO.FOPEN how to pick file without specifying the full directory path

    Hi,
    I am using Oracle application server 10gR2 on Linux with forms 10g application. I am building the DEV/TEST/UAT environment on same Linux machine with one OAS.
    I am using TEXT_IO.FOPEN ('/home/oracle/check.txt','r') to read a server side file and it is working fine.
    Now I want to pick this file dynamically i.e. without specifying the full path. I am using TEXT_IO.FOPEN ('check.txt','r') and I copied file in forms_path directory in linux and even in $path directory in linux but none of them are working.
    Pls help me sort out this problem.
    Thanks in advance

    Hi,
    I have to read files in my app directory using TEXT_IO how is that possible?? I cannot set workingDirectory as my Oracle home is in a different location and as has been mentioned by others when I run the form on web it cannot seem to find the file in the default forms directory where all the .fmx file
    Is there any other file setting that needs to be done??
    Please help
    Thanks & Regards
    Mangesh Deshpande

  • How to get full path using HTP.PRINT(' "input type ="file") ....

    Hello everybody,
    I am working on uploading file from page to another one using HTP package, but whenever I submit the form, it only takes the filename without the full path.
    for example :
    if i sent 'c:\dir\a.txt' , the other page receives file parameter as 'a.txt'
    the code is here
    PROCEDURE upload(appno in varchar2,wsct in varchar2) AS
    l_real_name VARCHAR2(1000);
    BEGIN
    HTP.htmlopen;
    HTP.headopen;
    HTP.title('Test Upload');
    HTP.headclose;
    HTP.bodyopen;
    HTP.header(1, 'Test Upload');
    HTP.print('<form action="https://ssltrng.uaeu.ac.ae/trng/document_api.upload1" method="get">');
    HTP.print(' File to upload: <input type="file" name="file" >
    HTP.print(' <input type="submit" value="Upload">');
    HTP.print('</form>');
    HTP.bodyclose;
    HTP.htmlclose;
    END upload;
    the other page see it as
    file is 'Water lilies.jpg'
    Thanks
    Edited by: dtabed on Mar 30, 2011 1:02 AM

    Do not understand the problem.
    The code you've posted is a PL/SQL web enabled procedure that produces a dynamic HTML page. This page contains a form. And a full URL reference to the CGI that will process the form's data.
    This is unusual - as it seems to be that the form is submitted across domains and web servers.. You usually refer to a local CGI procedure to deal with a form - no need for a fully qualified URL that includes web server and domain name.
    If the CGI procedure that receives the form is also a PL/SQL web enabled procedure, that the uploaded file will be placed in the documents table (as defined in the DAD alias) by mod_plsql, prior to the web enabled procedure being called. The documents table will contain the Mime type, file name, file contents and other details.

  • How to read file from server if I have a logical file path?

    Hi guys,
    I'm having a pretty "on the run" question,
    My program is currently reading a file from server using "open dataset" with file path like this (just example)
    /usr/interface/abc/bcd/testfile.dat
    Now I got a requirement to make it more consistent to read files, instead of reading that physical file name, I should read the files from a specific folder using logical path.
    So I go to T code "FILE" and created a logical path called ZABC_FILE_PATH, unix compatible, with physical path is (for example),
    /usr/interface/<sysid>/<client>/<filename>
    My question is, can I still use open dataset statement to read this? if yes, how do I do that? If no, there should be alternative way, please let me know what you think. Thanks,

    Thanks all, I figured it out.
    ONe thing is that typo double quote
    The other thing is the importing part, I need the full file path.
    CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
      EXPORTING
        CLIENT                           = SY-MANDT
        logical_path                     = 'ZABC_MY_LOGICAL_FILE_PATH'
    *   OPERATING_SYSTEM                 = SY-OPSYS
    *   PARAMETER_1                      = ' '
    *   PARAMETER_2                      = ' '
    *   PARAMETER_3                      = ' '
    *   USE_BUFFER                       = ' '
        file_name                        =  v_1
    *   USE_PRESENTATION_SERVER          = ' '
    *   ELEMINATE_BLANKS                 = 'X'
      IMPORTING
        FILE_NAME_WITH_PATH              = v_what_I_need
    * EXCEPTIONS
    *   PATH_NOT_FOUND                   = 1
    *   MISSING_PARAMETER                = 2
    *   OPERATING_SYSTEM_NOT_FOUND       = 3
    *   FILE_SYSTEM_NOT_FOUND            = 4
    *   OTHERS                           = 5
    I really appreciate your contributions, thanks again!

  • How do I obtain the full path string for my file?

    Many Mac applications are particularly bad at guessing what folder I want to grab a file from.  As a result, I waste a great deal of time fishing all through my directory tree in order to put and take my files in and from the right location.  It does seem to be better is some applications but still the nuisance is an issue.  Of course in Windows this can happen too except there I have a workaround to help out the foolish applications.  I can copy the full literal path to the clipboard from Explorer.  Then when the file access dialog comes up I can paste the full literal path ahead of the filename and snap to the correct folder.  On my mac, I have had mixed success approximating this strategy.  Sometimes, if the target folder isn't empty, I can use the Finder to browse to the target folder and open the Get Info dialog for a file and copy the full path from within that dialog.  This does not work though when the folder is empty and Mac does not support the create new text file on the fly feature.  Furthermore, I have noticed some strange behavior even when I do have the full path copied.  One such example is using TextEdit, pasting this full path has resulted in the application using the full path as a really long filename for the new file which still resides in the folder the application incorrectly assumed.
    There is a list box in most Mac file access dialogs with _some_ of the recent folders I accessed listed for quick selection but nine times out for ten the folder I just came from isn't among them.  That detail really surprises me.  Do regular Mac users have habits that prevent problems like this, or is there a better way to _bank_ a literal folder location I know I'll need to use soon and often, or do I just need to get used to fishing for folders during file access?

    Welcome to Apple Support Communities. Most of us are users here.
    Create folders and drag those 'frequently used' folders to the left-hand FAVORITES column/sidebar in Finder.
    Then just drag your files to the destination folders, or click on them to select them as destinations from your applications.
    When you no longer need these folders, right-click to remove them from the FAVORITES sidebar.
    They'll still be in the original location where they were created, just no longer visible in the sidebar.
    Another thing to note is that the full path of your current destination is shown at the bottom of the screen in Finder. In this case Macintosh HD, Users, (Home folder name), Desktop.

Maybe you are looking for