SAP Program RN2DS_COLLECT_ALL_FILES - Device Data Interface: File Import, Use as Job

Purpose
This program is used to import ASCII files from device interfaces intothe SAP system with subsequent storage in table N2DSDEVICE_DATA for thetemporary storage of content, until these should be imported intocardiological documents.
It reads all file names from a directory and subsequently renames thesewith a fixed file names. The actual transfer program is started withthis file.
To delete the entries in table N2DSDEVICE_DATA the reportRN2DS_DELETE_DEVICE_DATA is used.

Prerequisites
On an application server of the R/3 system there must be a directory foreach different cardiological device type. This directory (Incoming) mustcontain the 'inbound_readme.txt' file. The R/3 system checks whetherthis file exists, without this file the program will be aborted forsecurity reasons.
The content could be as follows:
Note! This directory is intended for the exchange of data. All filesapart from these, are imported and are then deleted! This file must beleft unchanged, as otherwise no import will take place!
In addition to this directory, to other relative directories must becreated.
,,\work,,,,as the work directory. ,, Files which could not be correctlyprocessed are collected here.
,,\save ,,,,as the save directory for transferred files. This optionshould only be activated in the test phase. During productive use thisdirectory should remain empty.
In the Incoming directory there must therefore be two furtherdirectories and the 'inbound_readme.txt' file. In productiveoperation there may also be another file which is determined as thetransfer file in customizing.

Features
If a file cannot be moved, the system will try 10 times at intervals of5 seconds, (max. 50 seconds per file), the job is then canceled with anerror message. If there are defined error messages, e.g. Device full,the system will cancel immediately.

Selection
The following parameters must be entered for this report,,

  • Institution,,Key for a legally and organizationally independent unit in
  • the hospital system.
    • System ,,IS-H recognizes logical and technical system descriptions. In
    • this field it is ,,the logical name.,,
      • Save transferred files?,,If this parameter is selected, transferred
      • files ,,are saved at file level in the transfer (Incoming) \save fortransfer.
        • Type of transfer:

        • Via HCM - HCM technology is used. All configuration steps for HCM must
        • have been executed.
          • All files in directory - All files in the incoming directory for the
          • logical device name for import from the trable TXCOM to the symbolicdestination are processed.
            • Via SAPFTP without deletion - All files, contained in the FTP host
            • (table TN2SAPFTP) for the symbolic destination for import (end digit 2),are transferred and processed but not deleted on the FTP host.
              • Via SAPFTP with deletion - All files, contained in the FTP host (table
              • TN2SAPFTP) for the symbolic destination for import (end digit 2), aretransferred, deleted on the FTP host and processed
                • Test mode,,In test mode, all checks are executed, nothing is saved in
                • the R/3 ,,,,,,database.

                  Standard_variants
                  There are no supplied standard variants, as the first sort criterion isalways the customer-specific device interface identification, thelogical device name. However, you are prompted to only start this reportusing one variant. You should therefore branch to variant maintenancebefore the initial start. When assigning names for variants, you shouldnote that the standard variant for each device must always named afterthe logical device name (System field). Due to this identical name, itis possible, to interactively schedule a job by requesting device datafrom a document on an ad hoc basis, if the system does not contain anydata yet.

                  Output
                  All messages are logged in the job log (System - Utilities - JobOverview - Job Log), in case of success the number of transferred filesis displayed. If jobs were canceled, the reason should be traceable inthe job log. This is not the case if the report is started in thedialog, messages are then only displayed directly in the dialog.

                  Activities
                  Plan the execution of this job as a periodoc job with a separate variantfor each device to be transferred. Name the variant and the jobaccording to the logical file name.
                  Should irregularities occur during the data transfer, first call the joblog for the corresponding job.

                  Example
                  In the schedule job the device directory: e.g.:
                  \usr\sap\SID\work\cardio is monitored.
                  All files which are stored in this directory, e.g. with the option 'Allfiles in Incoming directory', are moved to
                  \usr\sap\SID\work\cardio\work.
                  For each of the moved files in \work the function moduleISH_N2_DS_PROCESS_FILE is called individually, which uses the BAdIimplementation with the logical device name as the filter value.Following the extraction of this file, its content is stored in tableN2DSDEVICE_DATA.