Create logical file path and read it in main program

Hello Experts,
My requirement is, I have to read files from application server.
File path/ Directory is different in different system (systid). i have to read all files starting with (xyz*) from mentioned directory.
This path i must define in logical path.
Following are the steps i followed.
1)   In FILE (TCODE) i have created a logical path and assigned a physical path to it.
2)   I have created logical file ( I am not sure about this, as i dont have to create logical file, i just need to read file from above path starting with xyz*,  but FM FILE_GET_NAME requires logical file name so i have created it).
3) I will pass logical file name to FM FILE_GET_NAME and recieve physical file path(with file name which i can ignore).
these all steps i found on SDN. but its not working.
FM FILE_GET_NAME is always returning same file path ( Not even close to what i have defined ).
I can not read data from Table path as it will return physical path as it is, but i need it replaced with system id.
Any suggestion will be really helpful.
Thanks in Advance.
Regards,
Amar

Hi Amar,
one difficulty defining physical path name is to know the right Syntax group.
For example if you habe OS Linux, you need Syntax Group UNIX here. In Table OPSYSTEM you can see, which OS (OPSYS) needs which FILESYS (Syntax Group).
If you always get a wrong physical path, this may be caused ba a wrong choice of the Syntax Group. Only the correct one will lead to the correct path.
Regards,
Klaus

Similar Messages

  • Difference between logical file path and physical file path

    Hi,
    Can anyone tell me why logical file path is required and why physical file path is required? What exactly is the difference bet them?
    Thanks in advance.
    Regards,
    PS.

    Hi,
    The function module FILE_GET_NAME convert a logical path into its corresponding physical path.
    The advantage of using logical pathes within your applications is obivous:
    If you need to change the physical path you just adjust it within transaction FILE yet no changes are required to your application.
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/25/ab3a57df3b11d189fc0000e829fbbd/frameset.htm
    The file names that you use in ABAP statements for processing files are physical names. This means that they must be syntactically correct filenames for the operating system under which your R/3 System is running. Once you have created a file from an ABAP program with a particular name and path, you can find the same file using the same name and path at operating system level.
    Since the naming conventions for files and paths differ from operating system to operating system, ABAP programs are only portable from one operating system to another if you use the tools described below.
    To make programs portable, the R/3 System has a concept of logical filenames and paths. These are linked to physical files and paths. The links are created in special tables, which you can maintain according to your own requirements. In an ABAP program, you can then use the function module FILE_GET_NAME to generate a physical filename from a logical one.
    Maintaining platform-independent filenames is part of Customizing. For a full description, choose Tools ® Business Engineer ® Customizing, followed by
    Implement. projects ® SAP Reference IMG. On the next screen, choose Basis Components System Administration ® Platform-independent File Names.
    For a more detailed description of the function module FILE_GET_NAME, enter its name on the initial screen of the Function Builder and choose Goto Documentation. On the next screen, choose Function module doc.
    Another way of maintaining platform-independent filenames is to use the Transaction FILE. The following sections provide an overview of the transaction.
    To create a logical filename, choose Logical filename definition, client-independent from the Navigation group box in Transaction FILE, then choose New entries. You define logical filenames
    You can either define a logical filename and link it to a logical path (as displayed here), or you can enter the full physical filename in the Physical file field. In the latter case, the logical filename is only valid for one operating system. The rules for entering the complete physical filename are the same as for the definition of the physical path for the logical file. To display further information and a list of reserved words, choose Help.
    If you link a logical path to a logical file, the logical file is valid for all syntax groups that have been maintained for that logical path. The filename specified under Physical file replaces the reserved word  in the physical paths that are assigned to the logical path. To make the name independent of the operating system, use names that begin with a letter, contain up to 8 letters, and do not contain special characters.
    Save your changes.
    regards,
    Omkar.

  • LOGICAL FILE PATH AND LIGICAL FILE NAME

    1 I have one file(saritha.txt) on
         Presentation sever and I want to create logical file and logical file path to application server?
    please explain with example.

    Hi,
    u can create with the following one
    CONCATENATE '/' sysid 'abap/if/monthly/fi/' INTO directory.
    file name as combination of sys-uzeit and sy-udate.

  • Function module for logical file path and name

    Hello all,
    I am wondering is there any function module available to translate a logical file path to a physical file path and a logical file name to a physical file name? Thanks a lot!
    Regards,
    Anyi

    Please check the FM FILE_NAME_GET.
          CALL FUNCTION <b>'FILE_GET_NAME'</b>
             EXPORTING
               logical_filename = 'ZDELCHKREP'
               parameter_1 = it_cntry-cntry
             IMPORTING
               file_name        = l_file
             EXCEPTIONS
               file_not_found   = 08.
        CALL FUNCTION <b>'FILE_GET_NAME_USING_PATH'</b>       EXPORTING
             logical_path = 'ZDELCHKREP'
             file_name = l_file
           IMPORTING
             file_name_with_path = l_file.
    Message was edited by: Anurag Bankley
    Message was edited by: Anurag Bankley

  • How to create result file path and name in teststand

    Hi, 
    I would like to create specific path(folder) and file name to result files. For example ..\date\ArticleNr\DateTimeSerialNr.xml.  Thank you very much in adance.
    Kri. 

    Kri,
    You can use Configure >> Report Options, and then select the Report File Pathname tab to configure where your reports will end up, and what the file name will be. If you want to have these be different for each sequence, then add the ReportOptions Callback to each sequence and then modify the settings in the Parameters.ReportOptions container to what you want.
    This link may also be helpful as it talks about what you're are trying to do: Report File Name
    -Jack

  • Logical file path creation

    Hi All,
    In our project we have a requirement to fetch data in to .csv file on application from a report through an APD.
    I have the complete step by step procedure to create logical file path and logical file name, but i have some doubts as follow
    1. what is the adventage of using Logical file path and name, cant we use RSCRM BAPI file method?
    2. What are the different types of Syntax group... and most of the time why we select UNIX as a syntax group while creating logical file path???
    This will be a very helpful information for me..
    Please help me..
    Thank you,
    Jaimin

    RSCRM_BAPI - directly dumps a query as a .CSV in the app server - for an APD to work - you cannot specify the filename but then by specifyinf a logical file name - it can be run multiple times without any changes...
    Arun

  • Logical file path problem in lsmw

    Hi folks,
    I created logical file  path in FILE tcode. its created and assigned physical file path to logical file path.
    then i am assigning that logical file path into lsmw step (specify file step).
    under specify file i am assigning into import data and convert data.
    once read data step completed read data must be save under this physical file but data is not saving under this path.
    can any one help me out this..
    1.can any one help how to create physical file in file tcode
    2.how to assigne that physical file to lsmw step specify file

    Hi Srikanth,
    There is no need to create the logical file path using the FILE transaction.
    Under Specify file step, you need to give your local file path in LEGACY DATA Section.
    Please check the below link in using the LSMW step by step.
    http://wiki.sdn.sap.com/wiki/display/ABAP/LSMWStepsin+Detail
    Hope this helps.
    Regards,
    Satish Kanteti

  • Chnaging logical file path - Migrated from As/400 to wintel

    Hi,
    How do i change the default file path of logical file .
    I need to change path of a logical file in MI34 tcode from  C:\usr\sap\DEV\SYS\global  to out new Virtually created directory.
    Recetly We moved from OS/400 to WINTEL environment
    I wenin to FILE transaction but still it it looking at
    C:\usr\sap\DEV\SYS\global??? How do i over write it?
    Regards
    Prasad

    Hi Vara,
    to change the default logical file path , you need to change in Program. since this is standard program, you need to copy into 'Z' program and change. This is one option.
    Better to do is, change the physical path of the Logical file path in FILE transaction. may be this will work.
    All the Best.

  • On Logical File Path

    Hi all,
       My program reads an input file given thru Logical File Path and the Physical File name .
    The program works perfectly in Dev system, but in Quality system,it returns a sy-subrc 8 while opening the file ( open dataset ...)
    I have assigned the logical path to physical Path correctly and have transported it .
    I can see the combination entry ( Logical path, physical path ) in table PATH in both the system implying that the logical path is transported correctly .
      I don't understand why then, open dataset stmt returns sy-subrc 8, while it is 0 in Dev system .
    I don't have access to Transaction FILE in Quality .
    Could it be any reason ?
    Thanks,

    i think u have to check the properties of the file.
    if it is read only then u cannot ascess the file so we get sy-subrc as 8.
    so u have to set the properties of the file to write also..
    i think this will help
    Bye

  • In LSMW while executing the specify file step logical file name and path.

    Hi ,
    In LSMW , while executing the specify file step, logical file name and path is mandatory field to entry, but in some of other LSMW objects, these fields are not mandatory one, i want to know is it possible for me to do hide the logical file name and path field in specify file step.
    thanks
    Md nisar

    Hi,
    For some Transactions while executing the Specify file step Logical File and Logical Path are mandatory.
    In this case Converted file will be stored in the application server. According to the specified Logical File and Logical path.
    Hope this will help you....
    Regards,
    Tirumala Reddy

  • Using AppleScript/Automator to get file path and create AFP hyperlink

    Hi All,
    A colleague has asked for a service (contextual menu item in Finder) to get a selected item's remote (afp://) file path and copy it to the clipboard...  Pretty sure I've got that part down. 
    What I need advice on is how to make the resulting pasted file path into a serviceable hyperlink.  AFP keeps telling me there was an error connection to the server....  Does the copied path have to include mounting commands and user credentials for this to work??
    Thanks,
    Nathan

    Hi Richard - here's the script:
    tell application "Finder"
              set sel to the selection as text
              set TempTID to AppleScript's text item delimiters
              set AppleScript's text item delimiters to space
              set sel to text items of sel
              set AppleScript's text item delimiters to "%20"
              set sel to sel as string
              set AppleScript's text item delimiters to TempTID
    set the clipboard to "file://" & POSIX path of sel
    end tell

  • LSMW - Logical File Path not pointing to Physical Path

    Hi All,
    I'm trying to upload some MIGO goods movement transactions through LSMW.  I'm to step 7, specifying files, and am getting the error "No logical file path has been specified.  I saw another thread which helped me, but I am still stuck after reading it. 
    Re: Error in Creation of Purchase Requisition through LSMW
    I have gone into transaction FILE and created the logical file name MM_GOODS_MOVEMENT, and set the physical file as the .lsmw.conv converted data file as the above thread says.  I also tried using the logical path LOCAL_TEMPORARY_FILES for the converted data, but I get the error telling me that the path does not point to a physical directory.  I then tried creating my own file path, and setting the path to my desktop where the source file is, and the same error occurred.
    Does anyone know why it is not recognizing the physical path maintained in the logical path?
    Thanks,
    J

    Thanks for both replies,
    I have full authorization across all transactions in the sandbox system I am working in, so that is not an issue.  I filled the logical path field in the MM_GOODS_MOVEMENT logical file with LOCAL_TEMPORARY_FILES, as well as trying my own created file path, and I recieved the same error for each.  Here is how the config is currently:
    Logical File Path Definition:  MM_GOODS_MOVEMENT
    Syntax Group: WINDOWS NT
    Physical path: C:\Documents and Settings\jchanski\Desktop\<FILENAME>
    or,
    Logical File Path Definition:  LOCAL_TEMPORARY_FILES
    Syntax Group: WINDOWS NT
    Physical path: C:\temp\<FILENAME>
    Logical File Name Definition: MM_GOODS_MOVEMENT
    Physical file: MM_MM_MIGO_INVUPLOAD.lsmw.conv
    Data format: ASC
    Applicat.area: MM
    Logical path: LOCAL_TEMPORARY_FILES or MM_GOODS_MOVEMENT
    Do you see any error with this Brajvir?  Thanks!

  • Regarding logical file path specification

    How logical file path can be specified and when and why it can be used?

    Hi Naveen,
    Logical File Path can be created using transaction FILE and it is used when you have the requirement to upload your data to the application server.

  • Creation of logical file path

    hi, i am very new to this field and i need this urgently.. please help..
    i am not able to create a physical file from a logical file say for eg "zlogic".. i have been given a certain "Pathintern" for the physical file.. e.g. Pathintern = zobj.. the syntax group is 'unix' but, what do i fill in the physical path..  and i also have used the function module file_get_name but i dont know the changes to be made in the function module.. please help..

    Sorsingh,
    try this search result (are you new to the search field?).
    [SAP: creation of logical file path|http://www.google.co.jp/search?hl=en&q=SAP%3Acreationoflogicalfile+path&btnG=Search&aq=f&oq=]
    Let us know which part of the online help you can not understand.
    Regards,
    Clemens

  • Logical file paths invisible

    Hello All,
    Can any 1 share their views on why excialty Logical file paths & Logical file names are used.
    From last 2 days we are facing an issue on our PRD system.
    In our case Logical file paths & Logical file names are used for interfacing external Application programs.
    The files are processed & sent either Inbound or Outbound.
    Apparently, The Logical file paths(2 of them) which was visible earlier is now invisible. The reason for this is unknown. But the Interface functions still work well.
    Is there a reason why its invisible suddenly? Can it be made visible again or do we need to create new ones?
    Tx-code FILE  is used for "Logical file path definition"
    Please suggest,
    Regards,
    Ravi

    Hi,
    >Can any 1 share their views on why excactly Logical file paths & Logical file names are used.
    Logical paths and files are very useful for 2 reasons.
    You can write abap programs independant from the OS, you can even have different OS in the same system. For example the CI server onh Unix and the app servers on Windows.
    On windows, it is also very useful to have paths independant of the environment (DEV, QAS, PRD) because you can use variables.
    Example you can use this kind of syntax :
    <P=SAPMSHOST>\SAP_IN\<SYSID>_<CLIENT>\DIR1\DIR2\<FILENAME>
    For the "invisible paths", I have absolutely no idea because all my logical paths have never disapeared until someone deleted them.
    Regards,
    Olivier

Maybe you are looking for