01-17-2012 2:35 PM
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
01-18-2012 4:24 PM
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?
01-17-2012 2:49 PM
simplest way: copy the fm to Z name space and remove the lines you don't want.
01-17-2012 3:10 PM
Unfortunately the requirements are to use a standard function module or method (released by SAP)...
01-18-2012 5:51 AM
01-18-2012 7:38 AM
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
01-18-2012 11:11 AM
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!
01-18-2012 11:15 AM
FM SUBST_GET_FILE_LIST is Not Released
So you mean to say that RZL_READ_DIR_LOCAL is released ?
Kesav
01-18-2012 11:21 AM
01-18-2012 11:28 AM
Hi Soumya,
He is not using it because it has some authorization checks, not that its not released
Kesav
01-18-2012 11:15 AM
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.
01-18-2012 4:24 PM
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?
01-18-2012 4:34 PM
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...
01-18-2012 4:46 PM
@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 😛
01-18-2012 5:00 PM
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!
02-12-2012 7:43 PM