Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

need help for FILE_get_name

1) For my senario I have to use the function module FILE_GET_NAME. Before using this function module do I configure any thing in 'FILE' transaction. If it is required please let me know the procedure to use this function module

Tags:
replied

Hello Nani,

You need to change any settings in 'FILE' transaction. This transaction is used to set up Logical file paths. ( In general it will be set already for your system).

You can use the following code.

DATA: LC_LOGICAL_FILENAME_EXPSRC LIKE RCGIEDIAL-IEFILE

VALUE 'EHS_IMP_SOURCES'.

DATA: L_EMERGENCY_FLAG TYPE C.

DATA: L_FILE_FORMAT LIKE FILENAME-FILEFORMAT.

data : X_RCGIEDIAL LIKE RCGIEDIAL occurs 0 with HEADER LINE.

  • read the default pathname on application server

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

  • CLIENT = SY-MANDT

LOGICAL_FILENAME = LC_LOGICAL_FILENAME_EXPSRC

OPERATING_SYSTEM = SY-OPSYS

  • parameter_1 = ' '

  • PARAMETER_2 = ' '

  • USE_PRESENTATION_SERVER = ' '

  • WITH_FILE_EXTENSION = ' '

  • USE_BUFFER = ' '

IMPORTING

EMERGENCY_FLAG = L_EMERGENCY_FLAG

FILE_FORMAT = L_FILE_FORMAT

FILE_NAME = X_RCGIEDIAL-IEFILE

EXCEPTIONS

FILE_NOT_FOUND = 1

OTHERS = 2.

write :/ 'file format', L_FILE_FORMAT,

/ 'file name', X_RCGIEDIAL-IEFILE.

Thanks,

Jyothi

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question