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: 

Alternative fm for RZL_READ_DIR_LOCAL

Former Member
0 Kudos

Note 1595074 added a new authorization checks to fm RZL_READ_DIR_LOCAL, so I can't use it anymore.

I'm looking for a new standard function module or method (released by SAP) to retrieve file from application server.

System function (<CALL cfunc >) statement is for internal use only, it cannot be used in application programs.

thanks

GN

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Soumya, Hi Kesav... I have both problem (authorization checks and not released)

Solution proposed by Soumya (perform DIRECTORY_CONTENTS_GET... ) has not been approved from my boss

I really find it strange that there does not seem to be an official solution for this

Thanks to all... any other suggestion?

14 REPLIES 14

former_member226519
Active Contributor
0 Kudos

simplest way: copy the fm to Z name space and remove the lines you don't want.

0 Kudos

Unfortunately the requirements are to use a standard function module or method (released by SAP)...

Former Member
0 Kudos

Please try FM SUBST_GET_FILE_LIST

Former Member
0 Kudos

Hi,

Use UPLOAD_FILES standard Function Module to upload file to Internal Table from Application and/or Presentation Server.

This FM works for both.

Also to get list of files and directories for a folder in Presentation server, use method DIRECTORY_LIST_FILES of class CL_GUI_FRONTEND_SERVICES.

<begging removed by moderator>

Edited by: GaganBulani on Jan 18, 2012 8:48 AM

Edited by: Thomas Zloch on Jan 18, 2012

Former Member
0 Kudos

Thanks, but...

1) FM SUBST_GET_FILE_LIST is Not Released

2) FM UPLOAD_FILES reads the input file from the presentation or application server... I have to retrieve file-name from directory on application server

3) CL_GUI_FRONTEND_SERVICES->DIRECTORY_LIST_FILES return a lists files in a given directory only for presentation server

Any other suggestion?

Thanks!

0 Kudos

FM SUBST_GET_FILE_LIST is Not Released

So you mean to say that RZL_READ_DIR_LOCAL is released ?

Kesav

0 Kudos

thats why he is not using it

0 Kudos

Hi Soumya,

He is not using it because it has some authorization checks, not that its not released

Kesav

Former Member
0 Kudos

call the below perform

perform DIRECTORY_CONTENTS_GET in program /SAPDMC/SAPLLSMW_AUX_020
         tables PT_FILE" STRUCTURE GS_FILE
                            USING    P_DIRECTORY
                                     P_FILEMASK
                            CHANGING P_OK.

Former Member
0 Kudos

Hi Soumya, Hi Kesav... I have both problem (authorization checks and not released)

Solution proposed by Soumya (perform DIRECTORY_CONTENTS_GET... ) has not been approved from my boss

I really find it strange that there does not seem to be an official solution for this

Thanks to all... any other suggestion?

0 Kudos

Perhaps an offical way is to define an OS command like "'ls -al /transfer/sap' (if you use Unix, otherwise use DIR oder WRKLNK depending from your OS) in the SM49 and call this with the FM 'SXPG_COMMAND_EXECUTE'

Retrieve the result from the parameter EXEC_PROTOCOL

However, i did not tried it...

0 Kudos

@Gabriele Nota , tell you boss that he doesnot know how to code.. can you ask why it was disapproved?

and to above post: best of luck passing this though Gabriele's boss 😛

Lukas_Weigelt
Active Contributor
0 Kudos

Perhaps an offical way is to define an OS command like "'ls -al /transfer/sap' (if you use Unix, otherwise use DIR oder WRKLNK depending from your OS) in the SM49 and call this with the FM 'SXPG_COMMAND_EXECUTE'

Retrieve the result from the parameter EXEC_PROTOCOL

However, i did not tried it...

This is possible but requires permissions in your R3-Profile which would enable you to theoretically run ANY command on the underlaying Operating System. I.e. Backdoor for 'evil hackers'

simplest way: copy the fm to Z name space and remove the lines you don't want.

I agree with Volker. This puny little FM has like 100 lines of code....

can you ask why it was disapproved?

I suppose because he's the manager and he says so. Or he read something in a "business article" written by "experts" which inspires customers not to develope on their own because things might explode....

Good grief!

Former Member
0 Kudos

Solution with OS command finally approved

Thanks to all