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: 

TCode FILE: generate a different path depending on the environment

tafkap95
Participant
0 Kudos
676

Hi,

I would like through the FILE transaction to generate a file whose path would be different depending on the environment in which I find myself.

Let’s imagine my different environments:
- D01: path will be \\eccdev.power.lan\Interface
- Q01: path will be \\s3qasecc.power.lan\Run
- P01: path will be \\r3prdecc3.azure.poi\paynet

I've used the FILE transaction several times with success but never encountered this problem. How would you do that?

Thanks for your help.

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos
580

In path dependant on system, I usually used <SYSID> or <INSTANCE> in the path/file name. In your case, that's not enough.

So consider using variables or Exit FM

  • <P=name> Name of a profile parameter(see Report RSPARAM for valid values)
  • <V=name> Name of a variable(stored in variable table)
  • <F=name> Return value of a function moduleNaming convention for this function module:FILENAME_EXIT_name
  • <Y=name>Return value of a function moduleNaming convention for this function module:Y_FILENAME_EXIT_name
  • <Z=name>Return value of a function moduleNaming convention for this function module:Z_FILENAME_EXIT_name

Patrice
Participant
580

Hi,

You will get a list of all the available parameters by clicking the 'F1' button while in the 'Physical path' field. You can also refer to this article for more details:

How to Define Logical and Physical File and Path Names for Archiving

Note that if you use this logical path in an ABAP program, the programmer can build the path dynamically.

I hope this helps.

Patrice Poirier

Sandra_Rossi
Active Contributor
580

If it's to be different in each ABAP system, there's not really a need to transport the logical path, can't you just define it manually in each system once for all?

tafkap95
Participant
0 Kudos
580

Finally I went through an Exit FM <Z=name> in which I determine my path according to the OS and the name of the SAP system via a configuration table. Why did I choose this solution? Because with a former client, the operating system was not the same on the different environments: the dev was under Windows, the PRD under Linux...

As Sandra Rossi suggested I can't modify environments other than DEV because "Changes to repository or cross-client customizing are not permitted", and having this authorization is complicated.

Thanks for your help.