FM for getting the logical file name

Hi,
is there any FM for getting the logical file name.
Thanks
Vikranth

Hi,
CONSTANTS: c_mask          TYPE char9      VALUE ',.,..'.
      Pick up the file path from the application server
FORM f1001_browse_appl_file .
  DATA:  lcl_directory  TYPE char128.
  lcl_directory  = p_direct.
  CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
      directory        = lcl_directory
      filemask         = c_mask
    IMPORTING
      serverfile       = p_f2  " Parameter File
    EXCEPTIONS
      canceled_by_user = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
   MESSAGE e000(zmm) WITH text-039.
   flg_app = 'X'.
  ENDIF.
Then use  OPEN DATASET for data reading
Hope this Helps.
Manish
Message was edited by:
        Manish Kumar

Similar Messages

  • How to creat the logical file name.

    Hello All,
    I want to create Logical file name in my program, So Please guide me  in this issue.
    Thanks

    Check this out
    http://help.sap.com/saphelp_45b/helpdata/en/2a/fa02b7493111d182b70000e829fbfe/content.htm
    FU FILE_GET_NAME
    Text
    Assign the Physical File Name Using a Logical File Name
    Functionality
    R/3 applications run on various platforms with various file systems. This function module enables you to use platform-independent logical file names in your application programs.
    Based on definitions maintained in customizing tables for platform-independent file names, the function module converts a logical file name to the corresponding physical file name and path for the hardware platform concerned.
    For this conversion to work for different platforms, the definition of a logical file name must include a logical file path, which in turn is converted to different physical file paths, depending on the particular platform. The platform-specific file name returned by the function module is composed of the physical file path for the current platform and the physical file name associated with the logical file name. Placeholders in physical file and path names are substituted at runtime by the corresponding current values.
    Example
    logical file name: MONTHLY_SALES_FILE
    physical file name: VALUES<PARAM_1>
    logical path: SALES_DATA_PATH
    physical path (UNIX): /usr/<SYSID>/<FILENAME>
    physical path (Windows): C:\SALES\<FILENAME>
    Example 1
    Get file name for UNIX platform
    (current system: K11)
    CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
    LOGICAL_FILENAME = 'MONTHLY_SALES_FILE'
    IMPORTING
    FILE_NAME = FILE
    FILE_FORMAT = FORMAT.
    Result:
    FILE = /usr/K11/VALUES
    FORMAT = WK1
    Example 2
    Get file name for UNIX platform, passing a parameter
    (current system: K11)
    CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
    LOGICAL_FILENAME = 'MONTHLY_SALES_FILE'
    PARAMETER_1 = '_TST'
    IMPORTING
    FILE_NAME = FILE
    FILE_FORMAT = FORMAT.
    Result:
    FILE = /usr/K11/VALUES_TST
    FORMAT = WK1
    Example 3
    Get file name for WINDOWS platform, with file name extension
    CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
    LOGICAL_FILENAME = 'MONTHLY_SALES_FILE'
    WITH_FILE_EXTENSION = 'X'
    IMPORTING
    FILE_NAME = FILE
    FILE_FORMAT = FORMAT.
    Result:
    FILE = C:\SALES\VALUES.WK1
    FORMAT = WK1
    Notes
    All definitions needed for the platform-independent assignment of file names are maintained client-independently with transaction FILE. Logical file names (but not logical file paths) can also be defined specifically for the current client with transaction SF01. Transaction SF07 generates a list of current definitions.
    The following concepts are used in the platform-independent assignment of file names:
    Logical file name
    A descriptive name for a file which is associated with these values:
    physical file name
    file format
    logical file path.
    If no logical file path is specified, the function module returns the physical file name only; placeholders are substituted by current values.
    Physical file name
    The physical file name may contain placeholders.
    Logical file path
    A descriptive name for a path which is associated with these values:
    syntax groups (groups of operating systems)
    physical file paths.
    Physical file path
    The physical file path is defined for a particular syntax group. It must contain the reserved word <FILENAME> as a placeholder for the file name. It may also contain other placeholders.
    Operating system
    Presentation server and application server can run under different operating systems. The current value for the application server can be obtained from the system field SY-OPSYS, the value for the presentation server by calling function module WS_QUERY.
    Both operating systems must be defined and assigned to a syntax group.
    Syntax group
    Group of operating systems with a common syntax for file and path names (e.g. HP-UX and SINIX).
    Placeholder
    Reserved words, set in angle brackets, which can be included in physical file and path names (e.g. <DATE>, <FILENAME>). You can find information on possible reserved words in the online help (F1 help) for the fields physical file name and physical file path when maintaining platform-independent file names with transaction FILE.
    If the logical path associated with a logical file name does not specify a physical path for the current operating system (syntax group), the path stored in the profile parameter DIR_GLOBAL of the current system is used for generating a complete platform-specific file name.
    Parameters
    CLIENT
    LOGICAL_FILENAME
    OPERATING_SYSTEM
    PARAMETER_1
    PARAMETER_2
    PARAMETER_3
    USE_PRESENTATION_SERVER
    WITH_FILE_EXTENSION
    USE_BUFFER
    ELEMINATE_BLANKS
    EMERGENCY_FLAG
    FILE_FORMAT
    FILE_NAME
    Exceptions
    FILE_NOT_FOUND
    Function Group
    SFIL
    Thanks
    mahesh

  • Getting error logical file name not maintained adequtely

    Hi,
    when i execute a z report and press the download botton getting error logical file name not maintained adequtely,see long text.
    Below code i wriien. Please somebody help..
        DATA: lt_rows TYPE lvc_t_row.
        CASE e_ucomm.
          WHEN 'DOWNL'.
    Determine and construct OS specific file name                        *
            PERFORM get_file_name_for_os.
    in the  above perform , i wriien
    FORM build_file_name USING pf_os
                               pf_with_file_extension
                               pf_param_1
                               pf_format
                               pf_fname.
      DATA: lf_para1(20) TYPE c.
    pf_param_1 hold the materialnr with leading zeros not prefered in    *
    download file name                                                   *
      WRITE pf_param_1 TO lf_para1.
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
      CLIENT                        = SY-MANDT
          logical_filename              = 'Z_MATERIAL_BOM_FILE'
          operating_system              = pf_os
          parameter_1                   = lf_para1
      PARAMETER_2                   = ' '
      PARAMETER_3                   = ' '
      USE_PRESENTATION_SERVER       = ' '
          with_file_extension           = pf_with_file_extension
      USE_BUFFER                    = ' '
        IMPORTING
      EMERGENCY_FLAG                =
        file_format                   = pf_format
        file_name                     = pf_fname
    EXCEPTIONS
       file_not_found                = 1
       OTHERS                        = 2
    Error handling.
      CASE sy-subrc.
        WHEN '1'.
          MESSAGE e014(ba) WITH 'Z_MATERIAL_BOM_FILE'.                     "error message i am getting      LEAVE.
        WHEN '2'.
          MESSAGE e213(ky) WITH 'Z_MATERIAL_BOM_FILE'.
          LEAVE.
      ENDCASE.

    Hi.
    In file txn,
    click on "Logical File Name Definition, Cross-Client" from the left.
    Then click position and check for your logical file name.
    If you dont get it, it means you need to create it. You can click on New Entries to create.
    Thanks
    Mani

  • How to get the SQL file name in SQL*plus

    hi all,
         I have created two sql file at C drive as "c:\Createtable.sql" and "c:\Deletetable.sql"
    afterwards i open
    C:\>sqlplus
    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 30 11:37:10 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter user-name: scott/tiger
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> @C:\Createtable.sql'
    Table created.
    SQL> @'C:\Deletetable.sql'
    Table dropped.
    SQL>My problem is to get the name of the file as "c:\createtable.sql" and "C:\Deletetable.sql" in sql*plus enviornment.
    Thanks & Regards
    Singh

    Dear Damorgan,
         >>your version number to three decimal places
         My Oracle DB Version i have already stated in my previous post is 10.2.0.1.0
    Actually my problem is to get the sql files name we run in sqlplus enviornment with @ symbol. like
    i have created one sql file in c drive as
    "C:\Createtable.sql"
    afterwords i have connected to sqlplus as
    sql> conn scott/tiger
    sql>@c:\createtable.sql
    Now i want some query to get the name of the file which is run.
    In actual my problem is as
    i have suppose 10 or more SQL files in some folder ( sql1.sql, sql2.sql, sql3.sql ....).
    i created one file to call all the 10 sql files (main.sql)
    i have also one track_table which will keep track that which sql file is runned.
    I want some automated script which will insert the record in that track_table....... for that i need the name of sql file which is runned.
    Hope this will help you.
    Thanks & Regards
    Singh

  • How to get the Output File Name as One of the Field Value From Payload

    Hi All,
    I want to get the Output file name as one of the Field value from payload.
    Example:
    Source XML
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_TEST xmlns:ns0="http://sample.com">
    - <Header>
      <NAME>Bopanna</NAME>
      </Header>
      </ns0:MT_TEST>
    I want to get the Output file name as " Bopanna.xml"
    Please suggest me on this.
    Regards
    Bopanna

    Hi,
    There are couple of links already available for this. Just for info see the below details,
    The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
    //       Description: Function to create dynamic Filename
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    With this udf map it with the MessageType as
    (File Name field from Payload) > DynamicFileConfiguration>MTReceiver
    Thanks
    Swarup

  • Getting the Source File name Info into Target Message

    Hi all,
    I want to get the Source file name Info into Target message of one of the fields.
    i followed Michal BLOG /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Requirement :
    1) I am able to get the Target file name as same as the source file name when i check the ASMA in Sender & Receiver Adapter , with out any UDF...............this thing is OK
    2) I took One field extra in the target structure Like "FileName" & I mapped it Like
                              Constant(" " )--UDF-----FileName
    I Checked the Option ASMA in Both Sender & Receiver Adapters
    Here iam getting the Target File name as same as Source file name + Source File name Info in the Target Field " FileName".
    I Dont want to get the Target File name as same as Source file name. I want like Out.xml as Target file name.
    If i de-select the Option ASMA in Adapters means it is showing " null" value in the target field "FileName".
    Please Provide the Solution for this
    Regards
    Bopanna

    Hi All,
    Iam able to do this by checking the Option ASMA in only sender adapter itself
    Regards
    Bopanna

  • Error - Logical file is not part of database. Use RESTORE FILELISTONLY to list the logical file names

    I made a script to restore .bak or backup files. It works for some databases, but not for one. How do I make it work for any type of .bak file ? This is in sql server 2008. The error message is -
    Msg 3234, Level 16, State 1, Line 1
    Logical file 'Northwind_Data' is not part of database 'Northwind'.
    Use RESTORE FILELISTONLY to list the logical file names.
    Msg 3013, Level 16, State 1, Line 1
    RESTORE DATABASE is terminating abnormally.
    Script -
    IF DB_ID('Northwind') IS NULL
    BEGIN
    RESTORE DATABASE [Northwind]
    FILE = N'Northwind_Data'
    FROM
    DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak'
    WITH FILE = 1,
    MOVE N'Northwind_Data'
    TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind.mdf',
    MOVE N'Northwind_Log'
    TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind_0.LDF',
    NOUNLOAD, STATS = 10
    END

    Hello,
    The issue you are facing might be related to below link
    http://support.microsoft.com/kb/2487231/en-us
    As per link this is known issue.Can you please check service pack level of SQL Server 2008 .It should be SP3.Please apply SP3 and see if the error subsides.
    Also error suggests  logical file name 1 which you are giving is not part of the backup set from which you are trying to restore.You should first use below query to determine right file then proceed with restoration of the same.
    restore filelistonly from disk='C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak'
    if file ID is 3 may be your restore script would be like below
    F DB_ID('Northwind') IS NULL
    BEGIN
    RESTORE DATABASE [Northwind]
    FILE = N'Northwind_Data'
    FROM
    DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak'
    WITH FILE = 3,
    MOVE N'Northwind_Data'
    TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind.mdf',
    MOVE N'Northwind_Log'
    TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind_0.LDF',
    NOUNLOAD, STATS = 10
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Error: Enter either the physical file name or the logical file name

    Hi Expert,
    I have error: Enter either the physical file name or the logical file name, when upload BP with external data transfer.
    My Step:
    1. Define Sender Structure
    2. Define Transfer Rules
    3. Start Transfer
    When execute step 3, there's displaying error:  Enter either the physical file name or the logical file name
    Can you help my problem?
    Any document/link for upload BP with external data transfer.
    Thanks and Regards,

    Hi,
    See thread: [CO-PA External Data Transfer|CO-PA External Data Transfer]
    Regards
    Leon

  • Ecxpert Problem in getting the original file name submitted by FTP

    hai,
    when i use the scheduled FTP Application receive mode to receive files from the remote machine, i am not able to get the original file name, Ecxpert itself maintaining it's own file name,
    Even i query the tracking table also i am not able to find the original filename.
    If anybody know how i can able to get the original file name?
    thanks....

    I don't think there is an easy to capture this information. We ended up writing our own FTP tool so we could gather better data. The other problem we had seemed to be sporadic downloads from sites where setting Passive was required.

  • How to create the logical file name

    Hi All,
        I have requirement where i need to post the Inventory Management data. for this i need to execute std. program RM07MMBL which is having logical file name in the selection screen. but i have placed my input file in application server.
       Can any one tell how to create the Logical filename which refers the physical path. I also tried <b>t-code SF01 & Table - FILENAMEC</b>I and found that we need to add an entry in this table but i really dont know how we have to do since this table cannot be maintained in SM30 also..
      Help Me.
      Thanks in Advance!...
    Regards,
    Ramkumar

    Hi Ram,
    Try using FILE transaction code...
    Follow these steps to create:::
    Double click on Logical file Path Definition
    Click on New Entries,
    Give Logical file Path name as Z_LOGICAL PATH and save it
    now choose this path and double click on Assignemt of Physical path to Logical path
    double click on the OS name
    Give some description and give some Physical path name from AL11 transaction and save it
    Now Double click on Logical File Name Definition,
    Click on New Entries,
    Give some logical file name: Z_LOGICAL_FILENAME
    Physical file: test
    Data Format: BIN
    Logical Path: Z_LOGICAL PATH
    Hope this helps
    Regards,
    Phani
    Message was edited by:
            Sivapuram Phani Kumar

  • How to get the right file name in an attachment

    I have design a program to get the attach file from an attachment. But when I click the link to save the file, the default name of the file is 'attach' whenever I get different files. Who know what is the problem, please tell me the truth.
    Here are some codes of the program.
    download.jsp
    <%="test.doc"%>
    web.xml
    <servlet-mapping>
    <servlet-name>AttachmentServlet</servlet-name>
    <url-pattern>attachment</url-pattern>
    </servlet-mapping>
    AttachmentServlet.java
    public void doGet
    Message msg = folder.getMessage(msgNum);
    // the message I get is right and the name of the file in
    // the attach in this message is right too.(I have printed)
    Multipart multipart = (Multipart)msg.getContent();
    Part part = multipart.getBodyPart(partNum);
    ContentType ct = new ContentType(sct);
    response.setContentType(ct.getBaseType());
    InputStream is = part.getInputStream();
    int i;
    while ((i = is.read()) != -1) {
    out.write(i);
    out.flush();
    out.close();

    The trick that I used is to append the URL with the name of the file. So if your url is "http://domain.com/attach", use "http://domain.com/attach/filename.doc". IE and Netscape parse the URL to determine what the filename is, so by placing this text at the end, you essentially let the browsers know what the filename is. :)
    I have design a program to get the attach file from an
    attachment. But when I click the link to save the
    file, the default name of the file is 'attach'
    whenever I get different files. Who know what is the
    problem, please tell me the truth.
    Here are some codes of the program.<< snip >>

  • FM for get a PC File Name in a window

    Hi
    Does somebody can help me, i need to call a FM wich shows a window for enter a PC File Name (with F4 browse for windows).
    I do not refer to FM 'F4_FILENAME'  wich we use when we have a file_name field in screen and we use when user press F4 ; instead i need to call a window with the file_name field for the user enters the file name.
    Doe somebody knows some FM wich i can use ?
    Regards
    Frank

    Hi everybody
    I'm going to try to explain; i refer this:
    I have a report wich is generated of course after the user fills the selection screen with the data desaired.  In this report list i have a button wich make some process;  when the user press that button, i need appears a popu window asking for a file name.
    That is, i do not refer to FM wich calls the browse window for select a file name  (like F4_FILENAME), instead i refer to some FM wich calls a popup window asking for the file name for user can write the file name in the input field, and that input field has the F4 help for users can select the file name instead to write it.
    I hope i explained well.
    I search with 'filename' and 'file_name' in SE37 but there are a lot of FM's  and i really don't find the right FM, does somebody knows a FM wich i can use ?
    Thanks a lot.
    Regards
    Frank

  • In OSB file protocol, trying to get the archived file name in proxy service

    Hi,
      I have a requirement that i need to process the archived file of file protocol,  with java callout in proxy service.
    I am able to get the file name which is reading with 'tokenize($inbound/ctx:transport/ctx:request/tp:headers/file:fileName,"\\")[last()]' , but this file is getting archived to archive folder. I want to pass the archive file name as input to the Java callout.
    Please let me know if  this can achieve in OSB proxy or any other options.
    Note : I am reading a xlsx file in the file protocol

    If you're using pass by reference option in the file transport, I guess the archive filename can be obtained from $body/ctx:binary-content/@ref. Try it out.

  • To get the logical system names of all the child systems in a CUA envirnmnt

    Hi Gurus ,
    Is there any table where we can find the logical system names of all the child sytems in a CUA environment .
    This is for a requirement that i need to develop an automated process where we can reset the password of all the child system in a CUA environemt when requested by the user at once .
    I found some tables such as V_TBDLS , but they do not contain the exact information what i need .
    Thanks in advance ,
    Harshit Rungta

    Hi,
    You are in the right track. BD54 will show you the logical system name for all the existed systems in CUA.
    Else you can also go to your CUA system and execute t-code SALE --> Basic Setting --->Logical Systems  ---> Assign logical system to client -
    > Display details
    here you can see logical system names for all the clients assigned to CUA.
    Thanks,
    Deb

  • How to get the trace file name for current running application?

    Hi, I want to know if it is possible to get the file name directly for current running application instance which is launched by javaws.
    There is a property "deployment.user.logdir" tells the log directory, it would be great if a file name property
    is available. something like "instance.trace.file".
    Our application wants it because we would like our client send use the application log by clicking a "send error"
    button, the codes finds the trace file and compress it and send it by using a smtp server.
    In 1.5, we can do it by using a shell program.

    I found other asked it before, but I tried to set both properties, but neither works. my sun JRE version :java version "1.6.0_04"
    <property
    name="deployment.javaws.traceFileName"
    value="abcfefsfdsf"/>
    <property
    name="deployment.javapi.trace.filename"
    value="235235235"/>
    But it always write to one trace file with name lik javaws63645.trace

Maybe you are looking for

  • To subclip or not to subclip, that is the question?

    Hello All, As I continue to gain experience with FCP, one of the consistent challenges I run into is having created subclip of my master footage that is pretty close to what I want in my final production. The net result of that is when I go to add tr

  • Impact of Sales Write off amounts on Tax liability

    Hi Friends ,                    Did any of you had tis situation at your client ? I want to know the impact of tax liabilitry on sales write off amounts  , will it reduce the tax liability if sales write off amounts or in other words the bad debts ar

  • U310 touch new 120gb msata win 8.1

    I bought a 120 GB msata and I'm planning to clone the HD with win 8.1 to the new msata drive and use the hard disk for storage.  Can you give an outline of what I need to do?  I tried to move the win 8.1 to the new msata on another u310 (non-touch) a

  • Is Adobe's (.xdp) schema file a standard schema as in (.xsd)?

    Hello! I'm uploading the Adobe XML to Oracle and Oracle needs a standard (.xsd)schema in order to build an XMLDB; is there a tool to convert the Adobe (.xdp) to a W3C compliant schema format (.xsd)? Thanks very much for any insights!

  • Custom Fields In Reservation

    Hi All, I Want to add Custom field in MB21/MB22 at item level . I have searched and tried the BADI MB_RES_BAPI_CREATE1 but couldn't able to find in documentation also how to add the field. Can any one suggest me how to include the field in Item detai