Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Logical File

Former Member
0 Kudos

Hi all,

Can you please tell me what is meant by a logical file?

how we can create it and how it is useful??

Its very urgent plz help.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ramya,

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.

~~Guduri

7 REPLIES 7

Former Member
0 Kudos

Check with the transaction code FILE.. using this you can create logical file path and attached a physical path to logical path..

Former Member
0 Kudos

Hi Ramya,

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.

~~Guduri

0 Kudos

Hey Thanks a lot Guduri,

Can you plz tel me where we excatly create a logical path??

coz in transaction file we are linking the logical file to the logical path.

but where we actually create a logical path?

thanks

0 Kudos

Hi

go to file transaction

clik on new entries

declare as below

Logical path ZFLIGHT

Name LOGICAL NAME FOR IDOC

and then go to right side syntax and grop there define os

-


Syntax group WINDOWS NT Microsoft Windows NT

Physical path /USR/SAP/<FILENAME>

0 Kudos

Ramya,

Hi,

Here is the process to create Logical File Path.

1) Click on Logical File Path Definition. Give name "ZTEST" and some description.

Eg:

Logical file ZPATH_MAST

Name file path for BOM upload

Physical file MAST_01.txt

Data format ASC

Applicat.area MM

Logical path ZPATH_MAST

++++++++++++++++++++++++++++++++++++++++++++++++++

Logical path ZPATH_MAST

Name file path for BOM upload

2) Click on Assignment of Physical Path to Logical Path. and provide Syntax Group and physical path.

Syntax group WINDOWS NT Microsoft Windows NT

Physical path O:\PHSS Project Olympic\Personal\HEDN\CV00102\<FILENAME>

3) Click on Logical File Name Definition and give descrition, physical filename, Data format as ASC, Application area and logical path which you have created.

hope this helps you.

0 Kudos

Hi, That was very useful.

I tried creating a logical path and assigned to a logical file too.

now whn i try to run the function module 'FILE_GET_NAME', its givng me an output of the logical path. some 'c:\usr\...'

Now my doubt is, is that the logical path which we are defining is in application server?

Are we jus defining a path called logical path for the application server directory??

If i want to upload data into application server, then wil i be able 2 use this logical paths directly for the tht? and how??

0 Kudos

Yes.... exactly.. it will define the application server path what ever you mentioned..

then where ever it is necessary give this logica file path name... it will take care of the path....

check this below link it will give you the total idea of it

http://help.sap.com/saphelp_erp2005vp/helpdata/en/25/ab3a57df3b11d189fc0000e829fbbd/frameset.htm