"
Supported by

Physical vs logical folders

If in your report called APP1 you need to save a file in a server folder (ex.: /export/app1/) and you don’t want it to be a selection screen parameter, how do you do it?

The simplest is to create a constant with the folder’s physical name: /export/app1.

But… what if tomorrow someone decides to change the folder location?

To avoid having to change your program in case this happen you can do this:

  1. create a logical folder in AL1 (ex.: DIR_APP1) pointing at the physical folder (ask your system administrators if you don’t have permissions);
  2. store the logical folder name in a program constant;
  3. use the code below to convert the logical folder into the physical folder.

DATA: physical_dir TYPE DIRNAME_AL11.

CALL 'C_SAPGPARAM' ID 'NAME' FIELD gc_logical_dir_app1
        ID 'VALUE' FIELD physical_dir.

Thank you Nuno Morais for the tip.

Greetings from Abapinho.

2 comentários a “Physical vs logical folders”

  1. Sérgio Fraga Diz:

    Boa dica Nunos!

    Também existe a transacção FILE
    Só usei uma vez e não domino mas é bastante interessante.

    Alguém já utilizou?

  2. Giovanni Diniz Diz:

    Outra forma de buscar o endereço físico é selecionando a tabela user_dir usando o campo aliass.

Deixe um comentário


About Abapinho
Abapinho runs on WordPress
Articles (RSS) e Comments (RSS).