Application Development and Automation 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: 
Read only

Function FUNCTION FILE_GET_NAME and table FILENAMECI

Former Member
0 Likes
1,625

I have an ABAP program that calls FUNCTION 'FILE_GET_NAME' with only the logical_filename and operating_system parameters. ex:

 CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      logical_filename = 'Z_SAP_TO_GAINS'
      operating_system = 'NT'
    IMPORTING
      file_name        = g_output
    EXCEPTIONS
      file_not_found   = 1
      OTHERS           = 2. 

This gets the physical file name correctly when run / debugged in DEV/TST and PRD.

ex:

DEV :
serverT01\GAINS2\test\

TST :
serverT01\GAINS2\test\

PRD :
serverP01\GAINS01\

I can see that FILENAMECI has different entries for Physical file (FILEEXTERN) in DEV and TST than it does in PRD. I have read that transaction FILE can be used to maintain this Physical path, but it seems that best practice is to transport that from DEV. How then, is our file path in FILENAMECI different in PRD? Moreover, what is the best way to change this so that the function will retrieve the correct server name path when run in each environemnt. Apparently the parameters to replace nodes in the physical path name were not used when this was designed.

Is there a way to maintain the path without making ABAP changes to the application program?

Thanks for your help!

Jeremy

4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
1,122

Please look up the definition of logical file name Z_SAP_TO_GAINS in transaction FILE. It probably uses a logical path that translates to a physical path using some system variables like <SYSID> and maybe others. That's how the resolved physical path name can be different across systems without any special parameters being passed to FILE_GET_NAME.

Post the details here for further analysis if required.

Thomas

Read only

Former Member
0 Likes
1,122

Hi Thomas,

Thanks for your reply. Unfortunately, the parameter / substitution design doesn't appear to have been used in this case. In PRD, the transaction FILE reveals that the physical file path for the logical Z_SAP_TO_GAINS is :
STCPGNS01\TOGAINS\, while in DEV and TST it is
STCTGNS01\TOGAINS\ (one letter difference). So, it appears the original designer chose to make these static entries.

Wondering if there is a way to change these static entries (although I have noticed that I can't go into change mode in TST and PRD for rows returned through transaction FILE).

Thanks

Jeremy

Read only

0 Likes
1,122

Jeremy,

Don' t know if this is anymore relevant for you. Hope you have found solution. The way to change entries in test or production environment is to modify entry in Development box and then transport it to all other environments.

Read only

0 Likes
1,122

Hi Shailesh,

Thank you for the response. I understand, and have found, that the way to change the FILENAMECI entries in TST and PRD is to migrate them. Unfortunately, since the file paths need to be different in those environments, migrating a static file path from DEV all the way to PRD doesn't meet the need for DEV and TST once it is migrated. I can see how this would be great if the substitution design had been in place for this file path/name, but it was static and didn't allow for "variable substitution".

I did not have time with the project to rework this, so I did what the previous developer must have done and migrated it to PRD static for PRD and will rename FILENAMECI again afterwards, and re-migrate that file name as far as TST.

When time allows, after this project is closed, I'm committed to cleaning this mess up.

Thanks

Jeremy