SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Application Server



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули
View previous topic :: View next topic  
Author Message
Lord
Профессионал
Профессионал



Joined: 10 Sep 2007
Posts: 168

PostPosted: Wed Sep 19, 2007 4:14 pm    Post subject: Application Server Reply with quote

RZL_READ_DIR_LOCAL - Read a directory on the Application Server
Code:

*- Declare a parameter in which completes the path to the server from which we want to know its contents
PARAMETERS:
p_file TYPE rlgrap-filename obligatory DEFAULT '/ data /'.

*- Variable to pass the path to the function
DATA: lv_name TYPE salfile-longname.

*-> Levanto the list of directories
lv_name = p_file.
CALL FUNCTION 'RZL_READ_DIR_LOCAL'
  Exporting
    name = lv_name
  TABLES
    file_tbl = it_filedir
  Exceptions
    argument_error = 1
    NOT_FOUND = 2
    OTHERS = 3.
IF sy-subrc <> 0.
  MESSAGE ID sy-sy-msgty msgid TYPE NUMBER sy-msgno
    WITH msgv1 sy-sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

* As a result in the internal table it_filedir get all the content, * whether subfolders or files from the server path by which we enter * parameter.


RZL_READ_DIR - If the server name is left blank, it reads a directory from local Application Server, otherwise it reads the directory of the remote server

RZL_READ_FILE - Read a file from an Application Server if no server name is given, or read file from remote server. Very useful to avoid authority checks that occur doing an OPEN DATASET. This function using a SAP C program to read the data.

RZL_SUBMIT - Submit a remote report.

SXPG_COMMAND_EXECUTE - Executes a command on remote system

RZL_WRITE_FILE_LOCAL - Saves table to the presentation server (not PC). Does not use OPEN DATASET, so it does not suffer from authority checks!

SXPG_CALL_SYSTEM - you can check the user's authorization for the specified command and run the command. The command runs on the host system on which the function module is executed. The function module is RFC capable. It can therefore be run on the host system at which a user happens to be active or on another designated host system at which an R/3 server is active.

Code:
DATA: l_params LIKE sxpgcolist-parameters,
      l_status LIKE extcmdexex-status,
      l_exitcode LIKE extcmdexex-exitcode,
      it_execprot LIKE btcxpm OCCURS 0 WITH HEADER LINE.

l_params = 'file1 file2'.

CALL FUNCTION 'SXPG_CALL_SYSTEM'
     EXPORTING
          commandname                = 'ZCOPY'
          additional_parameters      = l_params
     IMPORTING
          status                     = l_status
          exitcode                   = l_exitcode
     TABLES
          exec_protocol              = it_execprot
     EXCEPTIONS
          no_permission              = 1
          command_not_found          = 2
          parameters_too_long        = 3
          security_risk              = 4
          wrong_check_call_interface = 5
          program_start_error        = 6
          program_termination_error  = 7
          x_error                    = 8
          parameter_expected         = 9
          too_many_parameters        = 10
          illegal_command            = 11
          OTHERS                     = 12.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.