What is a  Logical and Physical file path in sap?

what is a  Logical and Physical file path in sap?

Hi,
Physical file is what you see from the OS level.
Logical file is what ABAP code can call certain functions to read/write.
Transaction FILE would link them together. Typically the logical path ends with "<FILENAME>", and the logical file refers to the logical path.
To extract the physical path from the logical path name
DATA: lf_mandt TYPE sy-mandt,
        lf_opsys TYPE sy-opsys.
  lf_mandt = sy-mandt.
  lf_opsys = sy-opsys.
To extract the physical path from the logical path name
  CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      client           = lf_mandt
      logical_filename = p_unix
      operating_system = lf_opsys
    IMPORTING
      file_name        = gwa_input
    EXCEPTIONS
      file_not_found   = 1
      OTHERS           = 2.
  IF sy-subrc EQ 0.
  Concatenating the physical path and the input unix file name
    CONCATENATE gwa_input p_file INTO gf_file .
  ENDIF.
Reward if helpful.
Regards,
Ramya

Similar Messages

  • Logical and physical file paths

    Hi,
    can anyone elobrate me  on what are logical and physical file
    paths ?

    hi,
    Follow this link
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3deb358411d1829f0000e829fbfe/frameset.htm
    File format determination (Required / optional fields and field checks).
    Logical File Path configuration through transaction 'FILE'. A new physical file path should be created on operating system level or an existing one can be used if agreed. The Basis team member should create a new file path at operating system level, if required.
    Hope this helps, Do reward.

  • Diff between logical and physical file path

    Hi ,
    Could you please explain difference between logical and physical file path's and their importance in ABAP.
    Thanks and regards,
    shyla

    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.

  • 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.

  • Information about file Id, Logical file name and Physical file name

    Hi All,
    I am testing one program. Selection screen has 3 parameters, File Id, Logical File Name and Physical file name. In Physical File name, i am giving complete file name with path. But it is giving error. Please tell me, what is File id and what all information i need to enter for logical file name and physical file name.
    Thanks
    Puneet Aggarwal

    hi,
    try using this for filename.
    parameters : p_file like rlgrap-filename.
    Thanks,
    Gaurav

  • Logical file names and Physical file names

    Hi Guys...
         Can you let me know what is the difference between Logical file names and Physical file names?
    Regards,
    Rohit

    Using Logical Files in ABAP Programs http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95e635c111d1829f0000e829fbfe/content.htm
    Creating and Defining Logical Filenames
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3df8358411d1829f0000e829fbfe/content.htm

  • Logical & Physical File path

    Hi Gyes,
      In selection screen i will enter <b>logical file path</b>.After executing this program i want <b>physical file path for that particular logical file path</b>(input).Is there any function module is there.
    Thanks and regards,
      Suresh.

    hello,
    Use the function Module
    Call function  FILE_GET_NAME
    CLIENT                          200
    LOGICAL_FILENAME    <enter your logical file name>    
    OPERATING_SYSTEM                WINDOWS NT
    PARAMETER_1
    PARAMETER_2
    PARAMETER_3
    USE_PRESENTATION_SERVER
    WITH_FILE_EXTENSION
    USE_BUFFER
    ELEMINATE_BLANKS                X
    Reward points if helps.
    Thanks,
    Krishna

  • Assign Logical file name for the physical file path through Program

    Hi all,
    I am having a physical file which is getting generated dynamically. It is having the date and time stamp in its name which is added at runtime.
    Now I need to assign a logical file name for the physical file path through the program.
    Is there any FM or any other method to assign the same.
    Gaurav

    I think it is not possible. becuase the date & time added at runtime. so if you check the table  PATH you can find filename and their definitions

  • How to get physical file path from logical file path

    Hi
    there is a immediate requirement ,
    I have logical file path but I need to get physical file path from it.
    So is there any FM which providesthis functionality.
    Points will be rewarded.
    Thanks

    Can you please share the piece of code ?
    Which File APIs are you using ?
    For java file, you can get complete path by simple method call : getAbsolutePath() on file object.
    Regards,
    Ashwani Kr Sharma

  • Table or function module from for complete physical file path?

    Hi All,
    I know the Logical file and Logical path name, i can see the complete path also from logical path name i.e. the physical file address through transaction FILE, e.g. /USR/TMP/ , but i want to display this path in one of the report output,
    so please help me with the table or the function module which can give me the complete physical file path.
    I checked the the table ADMI_FILES but it contains the file name or the Logical path name but the complete physical file address e.g /USR/TMP?, like this is not available. More over i tried function module file_get_name, still the physical address is not correct one, it is giving same address for all logical paths.
    Kindly Guide me for this
    Regards,
    Nikesh Kumar

    try sth like this:
        CALL FUNCTION 'FILE_GET_NAME_AND_LOGICAL_PATH'
          EXPORTING
            LOGICAL_FILENAME = LDS_NAME
                IMPORTING
            FILE_NAME        = sfile
            LOGICAL_PATH     = pth
          EXCEPTIONS
            FILE_NOT_FOUND   = 01.
        IF SY-SUBRC NE 0.
          MESSAGE E300(BD) WITH LDS_NAME.                         " TODO MG
        ENDIF.
                                                                                    SELECT single PATHEXTERN FROM path INTO expth
               where pathintern = pth.
        replace '<FILENAME>' with space into expth.
        concatenate expth '/' sfile into sfile.
        open dataset sfile for output in text mode encoding default.
    A.

  • Reg:  where used list for the any logical (or) physical files

    Hi
    Is there any possible way to check the where used list for the any logical (or) physical files (Tcode: FILE)
    Please let me know.

    if the path is hard coded in the program...
    you can use : RPR_ABAP_SOURCE_SCAN to scan the system and find out where its hard coded....

  • Logical and physical clear in ASO

    Hi There,
    I found one statement for Logical and physical clear in essbase dbag
    The process for logically clearing data completes in a length of time that is proportional to
    the size of the data being cleared.
    The process for physically clearing data completes in a length of time proportional to the
    size of the input data, not to the size of the data being cleared
    What does size of the input data actually means? How it is different from data being cleared.
    Thanks.

    What is interesting with these statements is based on them, you would think a logical clear would be slower than a physical clear. In reality, it is vastly faster. I took a 30 minute physical clear down to about 40 seconds with a logical clear. Logical clers create offsetting entries from the main cube in a slice to produce a result whila a physical clear deletes the actual data. The one thing about logical clears is rather than have #missing for cleared intersections you get zeros

  • Diff  between logical and physical page ?

    hi
    what exactly difference between logical and physical pages?
    where to set page size in report designer?
    after seting paper size in report designer can i readjust in print dialogue box?
    which is will be effected?
    please explain

    A logical page can contain several physical pages. Assume you want to create a format which is larger then your printer is able to print, then you can define a logical size, which contains n pages horizontally and m pages vertically.
    To set the page size for your report have a look at the properties in the main section of your paper layout.
    Regards
    Rainer

  • Importing logical and physical model from Sybase power designer/Erwin

    Hello,
    We have several models created in Sybase Power designer, logical and as a well as physical. Is there a way to directly import models into Oracle designer?
    Thank you for your help.
    Syed

    Hi Syed,
    ERwin has a facility to export to Designer 2000. Of course you're probably not using Designer 6.0 or earlier so it's of little use.
    I have been looking at a couple of tools for importing from ERwin: Reischmann Informatik’s TOOLBUS Interface for Oracle Designer and ALLFusion ERwin; and Meta Integration Technology’s Meta Integration Model Bridge (MIMB). Neither product is free (nor inexpensive) but if you've got a number of models to convert then the tools seem cheap by comparison. Also, none of the products that I've looked at recreate the actual diagrams (not that I expected them to).
    I am leaning towards TOOLBUS as it provides more complete migration of Logical and Physical models (especially the linkages between the models) using Oracle Designer’s API rather than a DAT file as provided by MIMB.
    Hope this helps,
    Wayne Lehman
    Avanti Business Systems Inc.

  • Diff logical and physical doc

    Hello BW Experts,
    What is the difference between the logical and physical documents.
    Thanks,
    BWer

    hi BWer,
    take a look
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4e/668867df6a5c4591a4dc46631f5cc3/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6c/69bd22418d11d1896e0000e8322d00/frameset.htm
    hope this helps.

Maybe you are looking for