‎2007 Jun 04 8:45 AM
Please explain me the use and the purpose of the following function module.
1. CLOI_PUT_SIGN_IN_FRONT.
2. file_get_name.
thanks & regards,
phyrose.
‎2007 Jun 04 8:53 AM
1.It will place sign symbol in front of field value, as per standard sign symbol comes after the value
1000.00 - to -1000.00.
2,it will get the list of file names.
Regards
Peram
‎2007 Jun 04 8:53 AM
Hi.
Actually I can only explain the second one.
You use logical filenames to define filenames independently from the physical structure of the underlying system. So you can use the same program for different systems or change the final filename without changing the program.
The function module you mentioned is used to translate the logical filename into the final phyiscal filename.
For example you maintained a logical filename SALES_OVERVIEW in transaction FILE.
The function module will return the maintained physical path/filename like C:/Temp/SalesOverview.CSV.
Regards,
Timo.
‎2007 Jun 04 8:55 AM
Hi,
Purpose of FILE_GET_NAME.
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.
2.CLOI_PUT_SIGN_IN_FRONT
This FM accepts only the character type variable.It will not accept the field symbol that you have used.
Declare a variable of type char and assign your value to that variable and then pass this variable to the FM.
Use like this.
Data : l_data(10) Type c.
l_data = <fs>-value.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = l_data.
<b>*Reward points</b>
Regards
‎2007 Jun 04 8:58 AM
Hi,
FILE_GET_NAME:
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.
CLOI_PUT_SIGN_IN_FRONT
Just pu the trailing negative sign in front the variable.
For eg:
v = 123-, then after passing through the Fm it becomes.
-123.
Cheers,
Simha.
Reward all the helpful answers..