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

Create logical file path and read it in main program

former_member925838
Participant
0 Likes
10,627

Hello Experts,

My requirement is, I have to read files from application server.

File path/ Directory is different in different system (systid). i have to read all files starting with (xyz*) from mentioned directory.

This path i must define in logical path.

Following are the steps i followed.

1)   In FILE (TCODE) i have created a logical path and assigned a physical path to it.

2)   I have created logical file ( I am not sure about this, as i dont have to create logical file, i just need to read file from above path starting with xyz*,  but FM FILE_GET_NAME requires logical file name so i have created it).

3) I will pass logical file name to FM FILE_GET_NAME and recieve physical file path(with file name which i can ignore).


these all steps i found on SDN. but its not working.

FM FILE_GET_NAME is always returning same file path ( Not even close to what i have defined ).

I can not read data from Table path as it will return physical path as it is, but i need it replaced with system id.

Any suggestion will be really helpful.

Thanks in Advance.

Regards,

Amar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,654

Hi Amar,

one difficulty defining physical path name is to know the right Syntax group.

For example if you habe OS Linux, you need Syntax Group UNIX here. In Table OPSYSTEM you can see, which OS (OPSYS) needs which FILESYS (Syntax Group).

If you always get a wrong physical path, this may be caused ba a wrong choice of the Syntax Group. Only the correct one will lead to the correct path.

Regards,

Klaus

Hello Experts,

My requirement is, I have to read files from application server.

File path/ Directory is different in different system (systid). i have to read all files starting with (xyz*) from mentioned directory.

This path i must define in logical path.

Following are the steps i followed.

1)   In FILE (TCODE) i have created a logical path and assigned a physical path to it.

2)   I have created logical file ( I am not sure about this, as i dont have to create logical file, i just need to read file from above path starting with xyz*,  but FM FILE_GET_NAME requires logical file name so i have created it).

3) I will pass logical file name to FM FILE_GET_NAME and recieve physical file path(with file name which i can ignore).


these all steps i found on SDN. but its not working.

FM FILE_GET_NAME is always returning same file path ( Not even close to what i have defined ).

I can not read data from Table path as it will return physical path as it is, but i need it replaced with system id.

Any suggestion will be really helpful.

Thanks in Advance.

Regards,

Amar

4 REPLIES 4
Read only

kiran_k8
Active Contributor
0 Likes
3,654

Amar,

I think we can even define the parameter to take the SYSID dynamically rather harcoding it in FILE or in the program

Logical Path       -  Z_INTERFACE_INB

Physical Path     -  usr/sap/<SYSID>/interfaces/inbound/IF_ABC/<FILENAME> ( In FILE tcode )

sysid will automatically take the SYSID thus avoiding hardcoding.

K.Kiran.

Read only

Former Member
0 Likes
3,655

Hi Amar,

one difficulty defining physical path name is to know the right Syntax group.

For example if you habe OS Linux, you need Syntax Group UNIX here. In Table OPSYSTEM you can see, which OS (OPSYS) needs which FILESYS (Syntax Group).

If you always get a wrong physical path, this may be caused ba a wrong choice of the Syntax Group. Only the correct one will lead to the correct path.

Regards,

Klaus

Read only

0 Likes
3,654

Hi Klaus,

Thanks for your valuable reply. you are absolutely correct, We had UNIX operating system and Syntax group was AIX. It worked perfectly when i changed this.

Thanks again for your reply.

Regards,

Amar

Read only

danish_makhdum
Explorer
0 Likes
3,654

Hi Amar,

There is a cluster named 'FILENAME'.

You can go to SM30 and maintain it as per your configuration.

It will ask you some details like below:

You can get in touch with your BASIS team and they should be able to provide these details.

Please reward if helpful!

Thanks,

Danish Makhdum.

More step by step details can be found in the following link: https://wiki.scn.sap.com/wiki/display/Basis/How+to+Define+Logical+and+Physical+File+and+Path+Names+f...