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

Application server directory space

Former Member
0 Likes
3,757

Hi All,

Request to confirm the function module / class / coding required to determine the currently available space

in a directory on the application server.

Regards

Kunal

6 REPLIES 6
Read only

arindam_m
Active Contributor
0 Likes
1,893

Hi,

You can use the function module ' SXPG_CALL_SYSTEM' to get back the available space using UNIX commands designed in SM69.

You can use the below command:


df -k <directory_path>

This would return the result in percentage.

The same stats would be returned by the FM mentioned earlier. Only thing would be the user ID should have the authorization to execute it.

Cheers,

Arindam

Read only

Former Member
0 Likes
1,893


Hi Arindam,

Thanks for your response.

I believe you have understood our req. correctly.

For an SAP directory , used space = ?, total space = ?

The External command 'ls' only returns the file names in a directory.

I am not sure on implementing the df-k suggested by you.

Is it a separate command or do i have to use it like this

'df -k' in a new command ? Did try this formation but could not get it to work.

Returns  an error

'Can't exec external program (No such file or directory)                                                                                                                                                                                                        External program terminated with exit code 1

'

Appreciate your help on this issue.

Regards

Kunal

Read only

0 Likes
1,893

Hi,

Exit code 1 means you do not have the permission to execute the Unix Command. Please as your basis team. Rest should work out after that.

Cheers,

Arindam

Read only

ThangaPrakash
Active Contributor
0 Likes
1,893

Hello Kunal,

Goto t.code ST06 ---> Detailed analysis menu --> Click on filesys under Snapshot - current data. You will find the list of directories with their used and free space and free space in %.

Hope this might help you.

Regards,

Thanga

Read only

Former Member
0 Likes
1,893

Hi Arindam,

The UNIX command df -k looks good. Below is post execution screen.

Also, can you advise if there is any other way since authorization may be issue in production system for us.

Hi Thanga,

The space displayed over here is only for main folders in directory and not sub folders.

Although will check in debug , how this is being done.

Thanks anyways.

Regards

Kunal

Read only

0 Likes
1,893

Hi,

As I see are you trying to do something in the root folder. You might need UNIX admin access which you most probably wont have. The application server path, favorably a sub folder that SAP users use and visible in AL11 would wok ok.

Cheers,

Arindam