How to split path and filename (file is on application server)

Searching this forum I found a couple of FM's that apparently only worked for PC files.  Is there a parser function for files w/ the Unix naming convention?

You could parse it yourself...
DATA: filepath TYPE char255 VALUE '/usr/<sys_id>/sap/tmp/filename.txt'.
DATA: path TYPE char255.
DATA: file TYPE char255.
DEFINE macro_reverse_string.
  call function 'STRING_REVERSE'
    exporting
      string  = &1
      lang    = sy-langu
    importing
      rstring = &1.
END-OF-DEFINITION.
macro_reverse_string filepath.
SPLIT filepath AT '/' INTO file path.
macro_reverse_string filepath.
macro_reverse_string file.
shift path right by 1 places. path(1) = '/'.
macro_reverse_string path.
WRITE:/ filepath.
WRITE:/ path.
WRITE:/ file.
Regards,
Rich Heilman

Similar Messages

  • File dialog box: how get full path and filename (firefox 3.0 problem)

    Hi,
    I have a smilar problem then discussed in this thread: file dialog box: how get  full path and filename
    Now this solution doesn't seem to work in firefox 3.0,I only get the filename but not the full path.
    I have tried to solve this problem by adding *"netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");"* in a javacript function but that doesn't do the trick
    Although when i tested it local it does work.
    Any idees how to solve this?
    Best Regards
    Stijn

    Actually, that is strange and scarry. With 20% of the browser market share they decide to behave like Microsoft did in the past - they want to decide what users need and what they do not need. With 3.0 I have a real problem with some of my applications. They are all tested in IE6, IE7, FF2.0 and they all work the same way (they even work with Opera and Safari). Now, I will for sure not go there and make it work for 3.0, just because 2 out of 200 users use FF3.0. Up to now I have always recomended FF as the best browser. 3.0 causes my opinion to change completely. Competition is always good but it is a question if it is good if we have 20 different browsers out there with equal market shares.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • File dialog box: how get  full path and filename

    Hello All
    i have a problem to save the full path and filename with file dialog box.
    I want to save full path and filename in the database for creating a link to a file.
    I use a file-dialogbox to choose a file.
    I see in the textfiled something like this
    \FULLPATH\filename.ppt
    but when i save the textvalue in the database or look at the seesionvalue I see
    this:
    F2087258868/filename.ppt
    but I need the full path to create a link. How I can get?
    I use version 2.2.1..
    Thanks
    Putcho

    Hi Putcho,
    You can create some javascript that puts it into a hidden item.
    In HTML Form Element Attributes: onChange="$x('P15_X').value=$x('P15_FILE').value;" Then create another process that stores the value of the hidden item in your own table...
    I quickly made an example with a normal text item, so you see it copies itself to the other box: http://apex.shellprompt.net/pls/apex/f?p=286:15
    Hope that helps,
    Dimitri
    http://dgielis.blogspot.com

  • How to pull all the txt files from an application server to oracle server

    hi
    i got some 30 txt files on java application server. i have two questions
    1) can java guys will be able to move those files to some oracle directory that will be used by create external table command.
    2) can oracle do that using a stored procedure ..but then for it i think i have to create ftppkg and ftpbdy and call and connect each time...
    which one is better and why?
    regards
    raj

    Hi,
    You can create procedure to move file from application server to oracle server.
    Code for list all files in directory
    ops$tkyte@8i> GRANT JAVAUSERPRIV to ops$tkyte
      2  /
    Grant succeeded.
    That grant must be given to the owner of the procedure..  Allows them to read
    directories.
    ops$tkyte@8i> create global temporary table DIR_LIST
      2  ( filename varchar2(255) )
      3  on commit delete rows
      4  /
    Table created.
    ops$tkyte@8i> create or replace
      2     and compile java source named "DirList"
      3  as
      4  import java.io.*;
      5  import java.sql.*;
      6 
      7  public class DirList
      8  {
      9  public static void getList(String directory)
    10                     throws SQLException
    11  {
    12      File path = new File( directory );
    13      String[] list = path.list();
    14      String element;
    15 
    16      for(int i = 0; i < list.length; i++)
    17      {
    18          element = list;
    19 #sql { INSERT INTO DIR_LIST (FILENAME)
    20 VALUES (:element) };
    21 }
    22 }
    23
    24 }
    25 /
    Java created.
    ops$tkyte@8i>
    ops$tkyte@8i> create or replace
    2 procedure get_dir_list( p_directory in varchar2 )
    3 as language java
    4 name 'DirList.getList( java.lang.String )';
    5 /
    Procedure created.
    ops$tkyte@8i>
    ops$tkyte@8i> exec get_dir_list( '/tmp' );
    PL/SQL procedure successfully completed.
    ops$tkyte@8i> select * from dir_list where rownum < 5;
    FILENAME
    data.dat
    .rpc_door
    .pcmcia
    ps_data
    http://asktom.oracle.com/pls/asktom/f?p=100:11:3597961203953876::::P11_QUESTION_ID:439619916584

  • How to use jsp and xhtml files in an application

    This is web.xml file,
    <web-app>
    <context-param>
         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
         <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
    <param-name>facelets.DEVELOPMENT</param-name>
    <param-value>true</param-value>
    </context-param>
    <servlet>
         <servlet-name>Faces Servlet</servlet-name>
         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
         <servlet-name>Faces Servlet</servlet-name>
         <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    </web-app>
    If i configure like this, i am not able to work with jsp file.
    So, how to configure web.xml file to work with both jsp and xhtml file.
    Thanks,
    Vinutha.

    Hi Sam,
    To Use properties file you need to keep the properties file in a location and in the code you need to mention the path from where it should read in the runtime.
    Fuego.Io.PropertiesFile propfile;
    propfile.load(fileName : "<Path: C:/sample.properties>"); //Path: Place the properties file in the respective directory/drive and mention the path
    String val = propfile.get(key : "One"); //One - is the key against which the value should be mentioned in the properties file like <One = 1>. It should return 1
    logMessage("Value: " + val);
    To use the Enum in your project first create a Module in your catalogue component and then right click on module create New Enumeration say ProcessStatus
    Uncheck the Is Sequential if you want to keep key/value as pair. Click on add +* and mention the Name and Value say ABORTED as Name and Value as Aborted. To use it in your project conditional path write the condion as somevariable == String(ProcessStatus.ABORTED)
    Hope this will help you.
    Bibhu

  • How to find path of a file in WebDynPro Application

    Hello,
    I have created a WebDynPro application. In this application i have created an XML file under
    src->packages->resources. The resources folder i created myself.
    I have also deployed the file on a remote server. This servername & portNumber can change too.
    Now i want to get the handle of my XML file (which is present in the same jar) so that i can user it and populate it.
    <b>The following code doesnt work:</b>
    <i>File file =new File("WebDynProProjectName/resources/filename.xml");</i>
    Regards,
    Aayush

    Hi
      By default it puts it under resources folder. If you want to create your own path then
    1. Create the XML file (eg. output.xml) to some location in the server (eg: c:\Test\files)
    2. Create a HTTP alias(eg. Test) in the Visual Adminsitrator pointing to the file location (eg: c:\Test\files).
    3. Set the linkToURL reference property to http://<<servername>>:50000/Test/<<XML file name>>
    For creating the HTTP alias refer to the blog "Creating an HTTP Alias in WAS"
    /people/renjith.andrews/blog/2005/03/31/creating-an-http-alias-in-was
    Hope this solves your problem.
    regards
    Ravi

  • Function Module to find the Path of the file in the Application Server

    Hi All,
            Any function module available to find the path of the file stored in the application server. Please let me know.
    Thanks.

    Check this code:
      DATA: dl_file TYPE ibipparms-path.    " File name
      CONSTANTS: c_dir       TYPE  rlgrap-filename.
    * F4 filename for Application server
        CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
          EXPORTING
            directory        = c_dir
            filemask         = ' '
          IMPORTING
            serverfile       = dl_file
          EXCEPTIONS
            canceled_by_user = 1
            OTHERS           = 2.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Error while getting the file name'(006).
          EXIT.
        ELSE.
          p_file =  dl_file.
        ENDIF.
    Thanks & Regards,
    Siri.
    Message was edited by:
            Srilatha T

  • How to upload header and corresponding item details to application server?

    Hi all,
      How to upload control data , header data and the corresponding data in the application server based on the company code.
    If the user selects multiple company codes like US, GE,IN....3 files need to placed in the application server with the corresponding header and item details. The control data is unique per file.
    Thanks,
    Charan

    For Header and Item data you create separate structure as below...
    Header
    |----Link
    |----
    |----
    !-----Item
                |-----link
                |-------
    (Note the hierarchy- Header str>LINK--> Its fields->ITEM str > LINK under ITEM str->ITEM's fields under ITEM's fields.)
    Header part will have all header fields. Item will come under Header and all ITEM's fields will come under Item.
    Both HEADER and ITEM will have field LINK -- Char 003 which will allow all ITEMs for a HEADER to fall under proper Header data..
    Header and Item Structure will have different files as per the sequence of the fileds..
    Map the fields properly..
    It will work...
    If its helpful to you don't forget to reward the pts..
    Edited by: sumesh on May 19, 2008 4:28 PM

  • How to set Forms and Reports on an Oracle Application Server

    Hi All,
    Can anyone tell me how can i implement my all forms and reports on an Application Server. Please tell me in details cause i don't have enough knowledge abt AS.
    Thanks in Advance
    Arif

    Hi Arif,
    You can install AS Forms and Reports Standalone if you do not need infrastructure services like OID and SSO
    It is available for download from OTN search for Standalone on AS 10g R2 download page, then deploy your Forms and Reports there.
    I hope this helps.
    Thanks,
    Ahmed

  • How can I upload a pdf file into the application server?

    Hi,
    I have the otf data, which i have converted into pdf using the funcation module "Convert_otf". Is it possible to upload the pdf file in application server?

    Dear Srishti,
    Use OPEN DATASET in BINARY MODE.
    following link will help you.
    http://scn.sap.com/thread/1480434
    thanks,
    vidyasagar

  • How do i vpn and browse files on a network server through ipad?

    I'm having trouble finding an app that allows me to access my work network server public drive to view files. I assume I can use VPN, but can't seem to find a reliable file browser.  Suggestions?

    Two things you will need to do...
    1. Setup webdav shares via Server.app => Filsharing => <share> => Share with iOS Devices (WebDav) checkbox
    2. Acquire an app on your iPad that browses WebDav shares (Numbers, Keynote, Pages or any of the many apps available on the AppStore).

  • ABAP query processing in bgrnd and saving file to prsntn/application server

    Hello Gurus
    I have question regarding to ABAP query execution. Currently I try to find out if ABAP query can be executed in background and store the result into UNIX directory or in the presentation server(desktop). What I found is that the report need to be executed using option Private File and the data by default will be stored at directory /sap/outbound/.
    However what I found next is that the maximum fields should be 64 fields. If the query result has more than 64 fields, the error will occurs WRITE_TO_OFFSET_TOOLARGE.
    My question is:
    1. Can we set the directory in unix folder to someplace else than /sap/outbound/ ?
    2. Can we set in order to have the report stored without limitation 64 fields?
    Thanks in advance

    HI
    Yes you can set the directory in unix folder to someplace as you need to get confirmation for the path from your Functional Analyst.
    Thanks

  • How to deploy OHW Demo ear file in Jboss application Server.

    Hi All,
    I am quite new to the Oracle Help. I need to integrate Oracle Help in my j2ee application . I am using Jboss/tomcat aplication server for my development environment .
    Can any body guide me How I can go ahead ??
    and also pls tell me what is the difference between Java Help and Oracle Help

    I do not have any experience with Help or JBoss, but see if the links here can help - http://www.oracle.com/technetwork/topics/index-083946.html
    HTH
    Srini

  • How do I copy and paste files from a windows remote server to my mac?

    How can i copy and paste files from a remote server (windows) to my mac? i have installed cord to connect to the server but now i can´t cpy the files to my mac!

    Hi Sara.  Tanks for responding.  If I cannot figure this out (I  was up
    until 2am last night), I want to cancel my subscription.
    Here are two files you can check on/help me with.  When I try again,  it
    comes up 'an error has occurred when trying to access the service.'
    Please advise.
    Pat Tomassi
    In a message dated 11/1/2014 12:55:23 A.M. Eastern Daylight Time, 
    [email protected] writes:
    How  do I copy and paste text from a converted Word document?
    created by Sara.Forsberg (https://forums.adobe.com/people/Sara.Forsberg) 
    in Adobe Acrobat.com Services - View the full  discussion
    (https://forums.adobe.com/message/6888908#6888908)

  • Urgent :- Unable to deploy EAR file in Oracle application server

    Hello folks,
    I am trying to deploy an application containing jsps and servlets
    packaged into EAR using ant. However when am trying to do so by using
    the Deploy EAR option in the Enterprise manager, it throws the
    following error -
    "Invalid J2EE application file specified - Jar file:
    /var/tmp/jar47241.tmp is missing its standard xml descriptor located at
    META-INF/ejb-jar.xml"
    I suspect that something could be wrong with regards to the way the ear
    file has been created.
    Please if someone could pin point the problem and help me understand
    the the above error message , it will be of great help to me and I d
    really appreciate this.
    Many Thanks,
    Ramn.

    Hello,
    I try to deploy an ear file (contains jar and war files) in Oracle Application server in linux, but the time is so long. The same file I deploy in a OAS in windows and the deploy time was 2 minutes, but in linux I leave the hole night and the session close and the deploy in unable.
    I don't know if I need configure an especial option in the OAS in Linux, how I can load my ear file.
    The OAS in windows was installed with oc4j options only, but the OAS in linux was full installation
    Please help me....
    Thanks.

Maybe you are looking for

  • Unable to load properties file from filesystem

    Hi, I have a client swing-applicatiion packaged in a jar-file. The application uses some resource files, including a xxxx.properties file to set defaults for the application. All resource files are included in the jar file and everything works as exp

  • Creation of Contact Person for a vendor in SUS, MM SUS scenario

    Hi All,   We are working on EBP for bidding with SRM 5.0 and ECC6.0 as the backend. When we do BBPGETVD for the vendor root we have to create a contact person for the vendor to logon. Our clients requirement is that all the data in the R/3 has to com

  • My iPhone 4 randomly shut down and won't turn back on.

    My iPhone randomly shut down whenever I got a phone call twice in maybe 5 minutes. Now it wont turn on no matter how many times I plug it in or use the home and lock button. Is there anything I can do? After the first time it just turned back on but

  • GT80 Titan Touchpad Problems

    Greetings, There have been a number of posts here and in other forums about the dual-function Synaptics touchpad of the GT80 Titans. It can function as a traditional pointing device or it can function as a numpad. It's a brilliant idea but it has a f

  • MRD Error on Mac

    Sometimes I connect fine. Others I cannot. Sometimes I AM connected and in the middle of work, then it freezes and the error message comes. Here is the error message I am getting: "Unable to connect to remote PC. Please verify Remote Desktop is enabl