Get logical file name
Hi Gurus,
I know the physical path of a file. Can anyone tell me how do I view this file? I do not know the logical file name, hence cannot use AL11 to view the file.
Regards,
Rishi
Hi,
There are some function modules, Can you please check:
FILE_GET_NAME_USING_PATH : Generate a complete file name with file name and logical path
FILE_GET_NAME : Assign the Physical File Name Using a Logical File Name
FILE_GET_NAME_AND_LOGICAL_PATH: Assign physical file names and get logical path
Below link also helpfull.
[http://help.sap.com/saphelp_nw04/helpdata/EN/8d/3e4ec2462a11d189000000e8323d3a/frameset.htm]
Regrads,
Lokesh.
Edited by: Lokesh Tarey on Apr 20, 2010 12:53 PM
Similar Messages
-
Get Logical file name from Physical file name
Hi everybody,
Please how can i get Logical file name from Physical file name ?
Thanks & Regards
HassanHi,
What i want is to get Logical file name from Physical file name, and not the opposite (get Physical file name from Logical file name).
Thanks & Regards,
Hassan -
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 -
FM for getting the logical file name
Hi,
is there any FM for getting the logical file name.
Thanks
VikranthHi,
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 -
Logical file name or logical path name incorrectly defined
Dear All,
We are doing archival in our IDES for test purpose before we do it to our Production.
Steps Performed
Copied AM_ASSET archive object to ZAM_ASSET
Logical Path
Logical path ZAM_ASSET
Name Asset
Syntax group UNIX Unix compatible
Physical path /archive/test/<FILENAME>
Logical File Name
Logical file ZAMASSET
Name Asset
Physical file FI_<MONTH>_<DAY>.txt
Data format ASC
Applicat.area AM
Logical path ZAM_ASSET
But when we run the WRITE though SARA , in the job log we get the following
Logical file name or logical path name incorrectly defined
When generating a file name for an archive file that is to be created, the system determined that the logical file name FIAA_ARCHIVE_DATA_FILE or the logical path name ARCHIVE_GLOBAL_PATH was defined incorrectly.
But we have maintained a Logical name ZAMASSET , so we are unable to change the location of archived file and as well as the format.
So is there any setting we need to maintain apart from the logical file name and logical file path.
Suggestions are highly appreciated.
Thanks in anticipationhi,
follow this steps :
- transaction SARA
- enter authorization objects, eg SD_VBAK
- hit button CUSTOMIZING
- Archiving Object-Specific Customizing: execute Technical Setting
- field Logical File Name enter or select ARCHIVE_DATA_FILE
- leave CONTENT REPOSITORY as blank if you are not using 3rd party for storing (eg. IBM Tivoli)
- back to customizing
- from Basis Customizing, execute : Cross-Client File Names/Paths
- on Logical FIle Path Definition, highlight (select) ARCHIVE_GLOBAL_PATH on the right pane
- double click on the Assignment of Physical Paths to Logical Path on the left pane
- double click on OS used, eg. UNIX, define Physical Path where archive file (on WRITE process) will be stored
- save changes made
- double click Logical File Definition, Cross Client on the left pane
- double click ARCHIVE_DATA_FILE on the right pane
- make sure that logical path is already set to ARCHIVE_GLOBAL_PATH
- save changes made
this setting also can be done using transaction FILE
we have experienced on this case using SAP standard archiving (SARA, SARI) and everything is fine with this setting above.
hope it help you.
rgds,
Alfonsus Guritno -
Hello all,
I have a question about using a logical file name in an OHD (BI 7.0). Because we need to transport the OHD to a different server, we cannot use the File option in defining the OHD. We need to use the option, Logical File. In t-Code FILE, we cannot seem to create a physical path that the OHD recognizes.
This is the path in AL11 where we want the file to end up: /usr/sap/BIP/DVEBMGS17/work/GGLF010.CSV with a server of prdsap01. We are creating the OHD in a different system with a different server and path. How should the physical path (mapped to the logical path) be defined. I know we have to use <FILENAME> to represent the OHD output file (GGLF010). What variables do we use for the rest of the path? Do the variables have to be specifically defined or are they delivered by SAP?
Any help would be greatly appreciated!
SheilaI don't know if this is relevant to this issue, but seems related.
When using OHD I noticed that two files are produced, the data file and the header file, unfortunatly when writing to the application server the file names output are identical. Therefore the header file overwrites the data file - anyone else experience this???
It is not possible to do anything about this using FILE settings so as a workaround (becasue I couldn't find/ an OSS note) I modified the standard class to ensure the data and header files names were unique:
METHOD: DETERMINE_FILENAME of class CL_RSB_FILE_GENERAL
o_filename_ctrl = l_filename.
*{ INSERT
*SAP BUG RENAMING HEADER FILE ELSE DUPLICATE FILES WILL OCCUR!!!
REPLACE '.CSV' IN o_filename_ctrl with '_HDR.CSV'.
*} INSERT
clear n_requid_current.
endmethod.
This assumes that the file output has .CSV as a file extension. This worked and now I get both the header and the data file.
If anyone could let me know if you have experienced this and how you resolved it would be nice.
cheers,
Asep -
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.
ThanksCheck 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 -
I am getting data from a flat file and want to know how to create a logical file name instead of hard-coding the path.
Please helpHi,
you can create logical file name in transaction SF01..
Hope it helps ,
Ravi -
TCODE SARA and its variant in logical file name
Hi forum,
how can I create a logical file name (FILE tcode) with execution varian of SARA for archiving ?
Regards.
Ganimede Dignan.Hello Ganimede,
Apart from the very good note suggested by Naveen please check this as well;
http://help.sap.com/saphelp_nw2004s/helpdata/en/8d/3e4ec2462a11d189000000e8323d3a/content.htm
You ca get more information from SAP help- data archiving section.
Regards.
Ruchit.
Message was edited by:
Ruchit Khushu -
Regarding assignment of physical path to logical file name
Hi All,
We have created one logical file name and assigned physical path to it in FILE tcode.
IN PATH table also these details got updated with correct logical file name & physical path.
But in my program when i have used FILE_GET_NAME F.M to retrieve physical path from logical file.
Here this F.M is not returning anything.
What is the issue over here.
We are working in ECC 6.0
Can anybody resolve this issue!
Thanks,
Deep.do one thing i give my report so according to do this
*& Report ZMIO_MANU_VENDOR_EXTR
report zmio_manu_vendor_extr.
DATA BASE TABLES
tables: lfa1 ,eina, lfm1 .
STRUCTURES
*---structure for the vendor details.
data: begin of ws_lfa1 ,
lifnr type lfa1-lifnr,
name1 type lfa1-name1,
end of ws_lfa1 .
*---structure for the pur org details.
data: begin of ws_lfm1 ,
lifnr type lfm1-lifnr,
kalsk type lfm1-kalsk,
minbw type lfm1-minbw,
end of ws_lfm1 .
*---structure for the pur inf rec.
data: begin of ws_eina,
lifnr type eina-lifnr,
relif type eina-relif,
end of ws_eina .
*--structure for the output file
data: begin of ws_final,
lifnr(10) type c,
name1(35) type c,
kalsk(1) type c,
minbw(13) type c,
eoln(1) type c,
end of ws_final .
INTERNAL TABLES
*---internal table for vendor details
data:i_lfa1 like ws_lfa1 occurs 0.
*---internal table for pur org details
data:i_lfm1 like ws_lfm1 occurs 0.
*---internal table for pur inf details
data:i_eina like ws_eina occurs 0.
*---internal table for final file output
data:i_final like ws_final occurs 0.
*DATA : P_FLAG(1) TYPE C.
CONSTANTS
*-- Default file name
constants: c_filename_default(40) type c
value 'VOLSAP/MAXVRLIB/manu_retail_vendor',
c_kalsk(2) type c value '05'.
SELECTION SCREEN
selection-screen begin of block b1 with frame.
selection-screen: begin of block b2 with frame title text-001 .
select-options:s$lifnr for lfa1-lifnr .
parameters:p$relif as checkbox.
selection-screen end of block b2.
selection-screen: begin of block b3 with frame title text-002 .
parameters: p$file(128) obligatory default c_filename_default.
selection-screen end of block b3.
selection-screen end of block b1 .
START OF SELECTION
start-of-selection.
if not s$lifnr is initial.
perform get_vendor_data .
endif.
perform build_file .
perform display_file .
END OF SELECTION
end-of-selection .
*& Form GET_VENDOR_DATA
form get_vendor_data .
select lifnr
name1
from lfa1
into table i_lfa1
where lifnr in s$lifnr .
if not i_lfa1[] is initial.
sort i_lfa1 by lifnr .
select lifnr
kalsk
minbw
from lfm1
into table i_lfm1
for all entries in i_lfa1
where lifnr = i_lfa1-lifnr .
select lifnr
relif
from eina
into table i_eina
for all entries in i_lfa1
where lifnr = i_lfa1-lifnr
and relif = 'X'.
endif.
endform. " GET_VENDOR_DATA
*& Form BUILD_FILE
form build_file .
loop at i_lfa1 into ws_lfa1 .
ws_final-lifnr = ws_lfa1-lifnr .
ws_final-name1 = ws_lfa1-name1 .
read table i_lfm1 into ws_lfm1 with key lifnr = ws_lfa1-lifnr .
if ws_lfm1-kalsk = c_kalsk .
ws_final-kalsk = 'X'.
endif.
ws_final-minbw = ws_lfm1-minbw .
ws_final-eoln = 'X'.
if p$relif = 'X'.
CLEAR P_FLAG.
LOOP AT I_EINA INTO WS_EINA
WHERE LIFNR = WS_LFA1-LIFNR
AND RELIF = 'X'.
P_FLAG = 'X'.
EXIT.
ENDLOOP.
IF P_FLAG = 'X'.
APPEND WS_FINAL TO I_FINAL .
CLEAR WS_FINAL.
ENDIF
read table i_eina into ws_eina with key lifnr = ws_lfa1-lifnr
relif = 'X'.
if sy-subrc = 0.
append ws_final to i_final .
clear ws_final.
endif.
else.
append ws_final to i_final .
clear ws_final.
endif.
endloop .
endform. " BUILD_FILE
*& Form DISPLAY_FILE
form display_file .
data: l_lines type i.
describe table i_final lines l_lines.
if l_lines > 0.
perform open_file using p$file.
loop at i_final into ws_final.
transfer ws_final to p$file.
endloop.
close dataset p$file.
else.
write: / 'no data found'.
endif.
endform. " DISPLAY_FILE
*& Form open_file
Open an output file, customizing default name to include
vendor number and job completion timestamp.
form open_file using file_nm.
data: l_vendor like eina-lifnr,
l_timestamp(12) type c.
Get correct path/filename for the system we're running on
call function 'FILE_GET_NAME'
exporting
logical_filename = 'ZVOL'
parameter_1 = file_nm
importing
file_name = file_nm.
Open file for output
open dataset file_nm for output in text mode encoding default.
if sy-subrc ne 0.
message e368(00) with 'Error opening output file:' file_nm.
endif.
endform. "open_file
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.
Edited by: krupa jani on Aug 20, 2008 6:55 AM -
Logical File name of Transaction File
Hi All,
I am using FILE_NAME_GET function module to get the Physical file name based on logical file name.
But here i am not getting total file name, i maintained Physical File name as ZDM\INTB18\<PARAM_1>.
Transaction File is stored in application server and it's name is ZDM\INTB18\RMCB18_DATETIME.
Could you please anybody suggest how to get total file name.
Thanks,
Rami Reddy.Hi Rami,
Have you utilised the Parameter WITH_FILE_EXTENSION in the function ... e.g.
Example
logical file name: MONTHLY_SALES_FILE
physical file name: VALUES<PARAM_1>
logical path: SALES_DATA_PATH
physical path (Windows): C:\SALES\<FILENAME>
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
Rgds, Derrick -
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.
GauravI 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
a® -
Hi all,
I wanted to create the files names dynamically
I know we can use transaction file and define a logical name with variables and assign value sto the variables to get the physical name.
my requirement is to fetch different values for the variables as well. for example : let ssay I have to create two data files using a process chain . both should have same time stamp at the end of the file.
I 'm planning to store this timestamp in a table. so during run time I want FILEname1_timestamp and Filename2_timestamp.
wher etimestamp is the same value for both files. but the prefix is different.
please let me know a optimum way to create this in BI7.0I store this as a variable in PARAMVALUE table and us ethis in the logical file name of the File in transaction FILE.
-
Why does Logical file name in sys.master_files does not match SSMS Properties
SQL 2012 11.0.2100.60 (x64)
I have a sproc that does an ALTER to change the logical file name of a DB. Getting this error at a customer site "5041 MODIFY FILE failed. File 'Template_201401_Log' does not exist.' When I query the sys.Master_files the log name is'Template_201401_Log'.
but when i look in SSMS at the DBs -> properties -> files the logs logical file name is Store01_log. There is only a single log file.
Just found out that if I change the log file name in SSMS it then corrects it in the sys.Master_files. So it is now corrected. BUt what would cause it to be a mismatch between the sys.Master_files and the SSMS Properties?Hi,
Can you show us the query. What is template file ?
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP -
Logical file names in your application programs
hi all ,
how i used FILE_GET_NAME function module in my program ,to logical file name for platform-independent files.
thank you.Hi Pawan,
you can use as below:
DATA: gv_physicalpath TYPE path-pathextern.
CONSTANTS: gc_logicalpath TYPE filepath-pathintern
VALUE 'MMIM_PHYSICAL_INVENTORY_DOCUMENTS'.
* Get corresponding physical path for the logical path
PERFORM get_physical_path USING gc_logicalpath
CHANGING gv_physicalpath.
FORM get_physical_path USING p_gc_logicalpath
CHANGING p_gv_physicalpath.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = p_gc_logicalpath
operating_system = sy-opsys
IMPORTING
file_name = p_gv_physicalpath
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " get_physical_path
<b>Reward for helpful answers</b>
Satish
Maybe you are looking for
-
TS1702 How do I to move apps from one place to a different place?
I want to be able to move my app icons to different locations on my phone.How do I move them. At one time I could bring up my phone on the computer and move them around but this is a new computer and I can not do it.Can anyone please help?
-
How can I set up Kerberos for PerformancePoint Per User Access?
Hi, This is the setup I have: 3 Tier SharePoint farm with one WFE, one APP and one DB (contians Analysis Services and SQL Server 2012) servers. SharePoint 2013 Test\UAT (1 Server for Analysis services and Database Services) SharePoint Content Datab
-
Drag and drop items still in 1z0-869 ?
Hello, I wanna ask about drag and drop items still in 1z0-869 Exam " Mobile Application Developer" OR not
-
How to display the xml content into my datagrid
Hi Experts, i have created a webservice for sales quotation through DI-Server.iam able to add a new sales quotation through my coding & iam able to get the sales quotation based on the DOcEntry in an *XML file*. The xml fil
-
My internet keeps crashing on iPad 1
All apps are closed. But the internet keeps crashing every few minutes. It does not matter whether I am using Safari or Diigo browser. Any suggestions?