Interface Documentation BC-XBP
Upcoming SlideShare
Loading in...5
×
 

Interface Documentation BC-XBP

on

  • 651 views

 

Statistics

Views

Total Views
651
Views on SlideShare
651
Embed Views
0

Actions

Likes
0
Downloads
7
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Interface Documentation BC-XBP Interface Documentation BC-XBP Document Transcript

  • Connecting External Job Management Systems to the R/3 CCMS Job Scheduling System XBP External Interface for Background Processing External Interface for Background Processing Release 3.1
  • Copyright ©1996 including screen shots by SAP AG. All rights reserved. Neither this documentation nor any part of it may be copied or reproduced in any form or by any means or translated into another language, without the prior consent of SAP AG. SAP AG makes no warranties or representations with respect to the content hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose. SAP AG assumes no responsibility for any errors that may appear in this document. The information contained in this document is subject to change without notice. SAP AG reserves the right to make any such changes without obligation to notify any person of such revision or changes. SAP AG makes no commitment to keep the information contained herein up to date. Trademarks SAP and ABAP/4 are registered trademarks of SAP AG. All other products mentioned in this documentation are registered or unregistered trademarks of their respective companies. 2
  • Contents 1. INTRODUCTION 6 2. THE FUNCTION OF EXTERNAL INTERFACES 7 3. THE REST OF THIS DOCUMENT - AN OVERVIEW 8 3.1 A Note About This Document 8 4. A SHORT INTRODUCTION TO R/3 BACKGROUND PROCESSING 9 4.1 Motivation 9 4.2 Concept 9 4.2.1 Creating Jobs 10 4.2.2 Releasing a Job 11 4.2.3 Starting Jobs (Ready and Active) 12 4.2.4 Ending a Job (Terminated or Finished) 12 4.3 Architecture of the R/3 Job Scheduling System 13 4.3.1 Job Administration in the Database 13 4.3.2 The Job Scheduler 13 4.3.3 The Job Starter and the Job Runtime Environment 14 4.3.4 The Job Log 14 4.3.5 Job Output 15 5. THE EXTERNAL INTERFACE CONCEPT 16 5.1 The Range Of Interfaces 16 5.2 Naming Conventions 17 5.3 Technical Basics 18 5.3.1 XMI Monitor: External Access 18 5.3.2 RFC Remote Function Call 19 6. XBP - EXTERNAL JOB SCHEDULING INTERFACE (JOB-API) 21 6.1 What Is Required of the Interface 21 6.2 XBP Interface - Description 21 7. XBP REFERENCE MANUAL 24 7.1 Requirements For Using The XBP Interface 24 7.1.1 Logging On To The R/3 System With An External Job Management System 24 7.1.2 External Job Management System - Logging Off 26 7.2 Defining Jobs 27 7.2.1 Job Open 27 7.2.2 Assigning an ABAP/4 Program to a Job Step 28 7.2.3 Assigning an External Program to a Job Step 30 7.2.4 Close Job Definition 32 3
  • 7.2.5 Reading Job Definitions from the SAP R/3 System 33 7.2.6 Determine Number of Jobs With Particular Job Name 34 7.3 Starting a Job 35 7.3.1 Start Job Immediately 35 7.3.2 Start Job As Soon As Possible 37 7.4 Modifying Steps in a Job 38 7.4.1 Modifying a Job Step Containing an ABAP/4 Program 38 7.4.2 Modifying a Job Step Containing an External Program 41 7.5 Finding Job Monitor Data 43 7.5.1 Determining the Status of a Job 43 7.5.2 Read Job Log 45 7.5.3 Read the Spool List of a Job 46 7.5.4 Checking the Status of a Job 48 7.6 Controlling Jobs 49 7.6.1 Terminating Jobs 50 7.7 General Help Functions 51 7.7.1 Show All Defined Variants of an ABAP/4 Program 51 7.7.2 Determine Current Resources for Jobs in the R/3 System 53 7.7.3 Check Available Job Resources at a Particular Time on a Server 54 7.7.4 Check Available Job Resources at a Particular Time in the Whole R/3 System. 56 8. APPENDIX 57 8.1.1 .Reading Syslog Entries in the R/3 System (Part of the XMB Interface) 58 4
  • Release Information for XBP Version 0.1 - December 1996 This is the first publicly available version of the XBP documentation. It encompasses all of the anticipated function modules for the interface. This interface will first be delivered with R/3 Release 3.1G. 5
  • 1. Introduction This document deals with the connection of an external job management system to the R/3 System. By external job management, we mean software which allows jobs to be scheduled, run and monitored from outside the R/3 System. For this purpose, SAP has defined an open generic interface. This is called XBP, which stands for eXternal interface for job Background Processing. XBP is one of a range of open interfaces which SAP intends to make available in the future for system management tasks. R/3’s internal CCMS (Computing Center Management System), with this range of interfaces, offers support to software manufacturers by allowing integration with existing system administration tools. 6
  • 2. The Function of External Interfaces The motivation for the development of these external interfaces arose from the desire to let SAP installations - especially large ones - be overseen by other software vendors’ tools. R/3 System External Open System Administration Tool Interfaces Fig. 2.1: Location of external interfaces External interfaces allow you to integrate R/3 simply and seamlessly into both local administrative tools and business-wide system management infrastructures. This integration should not and cannot completely replace the use of CCMS. Complex and security-critical system control tasks will always need to be carried out by CCMS. Furthermore, CCMS basic functionality is expected and required by R/3 applications. To explain by example: even if you use an external scheduling tool for background jobs, the internal job system in R/3 is still required to carry out the background jobs generated by applications such as R/3 archiving or the Workbench. The aim of the integration is to allow the customer a homogenous information infrastructure. The aim of the interface is to facilitate the flow of information between the R/3 System and external tools. In summing up, we could say that external tools provide additional flexibility to complement the existing basic functionality of CCMS. 7
  • 3. The Rest of This Document - An Overview Chapter 4 of this document contains a global description of the R/3 job management system. This short introduction demonstrates the concept and the components behind the system, without going into too much detail or starting to discuss the interface. In chapter 5 there follows an overview of the whole range of external APIs planned by SAP. Chapter 6 contains the actual description of the XBP; the motivation behind it, its technical background and a functional overview. This is all intended as an introduction. A reference manual follows in chapter 7. This is provided to help with the implementation of external agents. 3.1 A Note About This Document We have assumed that the reader will already have a certain degree of knowledge of the R/3 System. You should already be familiar with terms like application server, dispatcher, scheduler and work process in relation to R/3 basis. Additionally, you need to know at least what a function module is. 8
  • 4. A Short Introduction to R/3 Background Processing Firstly, we need to explain why background processing has a place in a dialog-oriented standard application. What is a ‘job’ within the R/3 System, and how does the system carry it out? We intend to demonstrate the concept using an example. Afterwards, we will introduce the architecture of background processing as a system. 4.1 Motivation R/3 is, above all, an interactive system. In other words, the vast majority of tasks are carried out in dialog with the user. However, there are also good reasons for the inclusion of a background processing system in R/3: • Mass data processing pushes a real-time system like R/3 right to its limits. Response times measured in hours mean that interactive processing is just not a viable option. • Tasks sometimes need to be carried out at times when no competent user is available to carry out the dialog. • Periodically recurring jobs need to be carried out at exact times, or on Sundays or Public Holidays. • Existing job structures are to be inherited from other, maybe older systems. 4.2 Concept A single unit to be processed in background processing is called a job. Accordingly, you will also see the term ‘job scheduling’ crop up in this area. Generally speaking, a job accomplishes a task, in the sense of an application. For example, you can use a job to carry out a firm’s payroll run at the end of the month. Jobs are identified on the one hand by their name (Ex.: PAYROLL_RUN). However since these names are not unique if the same application job is repeated, jobs also have job numbers, which ensure that they have a unique identification. A job does not have to consist merely of one program call, but may contain several. These constituent parts of a job are known as steps. Thus a job may contain one or more of these steps. Each step calls either an ABAP/4 program or an external program. An external program can be either a shell script or an executable program written, for example, in C code. Whilst several jobs may be started one after the other in any order you choose, the steps within a job are always carried out in the sequence in which they have been defined. Jobs have a life cycle - they are created (scheduled), released, are ready, become active, and finally are finished or canceled. We talk of the statuses that a job can have. Figure 4.1 shows the chain of these statuses: 9
  • Finished Sched- Released Ready Active uled Canceled Fig. 4.1: Status chain for jobs. In the following sections, we follow the life cycle of a job systematically. Figure 4.2 shows an example of the activities which can cause a job to change status. A job, ‘scheduled’ by a program, is ‘released’ by a dialog. It then proceeds through the ‘ready’ and ‘active’ statuses with help from R/3 system programs. If everything has gone according to plan, the job status moves on to ‘finished’. A program error will lead to a final status of ‘canceled’. Work ABAP/4 Process Program Finished Sched- Released- Ready Active uled in dialog Job scheduler Job starter Canceled Program error Fig. 4.2: Status chain for jobs with possible causes of status change. You can see the current status of a particular job in the R/3 System using the job overview (Transaction SM37). 4.2.1 Creating Jobs You can regard a job as a list of steps plus administrative information - “Where and how is the job run?”. To create a job, you assign existing program for the steps, then add the administrative information. There are three ways of bringing this administrative information into the R/3 System; in a dialog, from an ABAP/4 program, or, in future, from an external program using XBP: 1. in a dialog (Transaction SM36, or Tools è Administration è Jobs è Define Job) Here you enter the job name, job class and, if necessary, a target machine. Next, you enter a list of steps, and a start time, if required. 2. new jobs are created from ABAP/4 programs using the JOB_OPEN, JOB_SUBMIT and JOB_CLOSE function modules. You have the same parameters and degree of freedom here as in the dialog. 3. XBP allows you to use the functionality described in (2) in conjunction with external programs and agents. In each of these cases, the job number is created by the system itself to ensure that the job has a unique identification. Figure 4.3 shows the specification of a newly created job, with its name, number, status and steps. 10
  • Jobname: PAYROLL_RUN Jobcount: 14201001 Status : scheduled Target host :- Start criteria : Step1 : GHLTBRUT Step2 : URLAUBAB ..... Log : Fig. 4.3: A created job from the system’s point of view (greatly simplified) If no target machine is specified for the job in the dialog or the ABAP/4 program, the system decides itself on which application server the job is to be carried out. This is the normal procedure recommended by SAP, because the system can then carry out its own load balancing. You should only specify the target machine if that server has particular resources which are necessary for the job processing. 4.2.2 Releasing a Job A job is released when you specify a start time for it. You can release a job as soon as you create it, by specifying the start time. In this case, the job does not appear as scheduled, but assumes released status straight away. Once released, a job is fully defined from the point of view of the user or the ABAP/4 program. However, this does not necessarily mean that it can be started straight away. Put simply, a job is started when its determined starting time is reached. In the different applications, there are different requirements regarding the setting of a suitable start time, and there are therefore several variants, known as start criteria. In the simplest of cases, the user enters a starting time (Ex..: PAYROLL_RUN on 1.31.97). Now comes the question of whether you want to specify all repetitions of the job at the same time (for example, execute monthly). Here things have already become complicated (2.31.97 doesn’t exist). There are many possibilities and exceptional cases. For this reason, we do not just have the start time, but a total of five start criteria: 1. Immediate A job is executed as quickly as possible. 2. Date/ time A job is started when its start date and time are reached. 3. Event A job is started when a particular event is triggered in the system or by a program at operating system level. E.g. when data for processing is imported to a server by file transfer. 4. Preceding job A job is started once a particular preceding job has run. 5. Change of operation A job starts once the R/3 System has switched into a mode particular operation mode. 6. Start on working day A job is started when a particular working day of the month is reached Ex. the last working day of a month. Once you have released a job by setting a start time, the Job scheduler in the R/3 System becomes responsible for the future progress of the job. For some of the above start criteria you can also specify that the job should recur. Thus you can ensure that a new job with the same name, but a different job number for 11
  • each repetition, is released, for example, each time a particular event occurs, or every day from today. In selecting start criteria, you can use various calendars, either pre-defined or user- defined. This allows you a still greater degree of freedom, by allowing you to specify deviations in the frequency of periodic jobs (E.g. carry out periodically, but not on Public Holidays) Jobname: PAYROLL_RUN Jobcount: 14201001 Status : released Target Host :- Start criteria : last workday of month Step1 : GHLTBRUT Step2 : URLAUBAB ..... Log : Fig. 4.4: A released job from the point of view of the system (greatly simplified). Figure 4.4 shows that as well as the status changing, the start criteria have been laid down in the job description. 4.2.3 Starting Jobs (Ready and Active) Within the system, the Job scheduler is responsible for the progress of released jobs. For each job, the scheduler monitors whether its start time has been reached or its start criteria met. This is done periodically - every 60 seconds as a rule (you can set this as a system parameter). As well as this, the job scheduler has to ensure that sufficient system resources are available for a job to be carried out. The most important system resources in this case are background work processes. These are work processes which are reserved for background processing. The Job scheduler ignores jobs whose start time has not been reached. Jobs which should have started, but for which no free work process was available, are checked constantly. When the job scheduler finds a free work process, it sets the job to ready and tells the background work process that work is waiting. , Jobname: PAYROLL_RUN Jobcount: 14201001 Status : active Target host :- Start criteria : last workday of month Step1 : GHLTBRUT Step2 : URLAUBAB ..... Log : JOBLGX142010X1234 Fig. 4.5: An active job from the point of view of the system (greatly simplified). A job becomes active when the background work process, which carries out its steps, runs the jobstarter prior to carrying out the first step. As figure 4.5 show, the job definition has now gained a link to a job log. 4.2.4 Ending a Job (Canceled or Finished) A job logs its steps in a job log, which is visible to the user. If everything runs according to plan and no errors occur, the job acquires ‘finished’ status. This can be seen both in the job log and the dialog in Transaction SM37. 12
  • If an ABAP/4 error or any other interruption occurs at runtime, an error message is recorded in the job log, and the job is terminated. Jobname: PAYROLL_RUN Jobcount: 14201001 Status : finished Target host :- Start criteria : last workday of month Step1 : GHLTBRUT Step2 : URLAUBAB ..... Log : JOBLGX142010X1234 Fig. 4.6: A finished job from the point of view of the system (greatly simplified). Figure 4.6 shows the final view of the job. The job status is ‘finished’. Further information can be seen in the log. 4.3 Architecture of the R/3 Job Scheduling System The essential components of the R/3 background processing are the database tables which contain the job administration data and steps, the job scheduler, job starter, the job log and the spool subsystem. Within this document we can only present a rough sketch of how these elements work together. The aim is, however, to provide a simple model of how the system works. 4.3.1 Job Administration in the Database All essential job administration information and the job steps themselves are stored in the database. This ensures the consistency and security of the relevant information. The most important of the database tables is the job data table. This contains entries necessary for job administration: job name, job number, target host, desired start time, job log name and much more. The step list for a job is not contained in this table. The step list table contains a number of ABAP/4 and operating system level programs (‘external programs’) for each job. Figures 4.3 - 4.6 show data from both tables in one view. An event table lists all events defined in R/3, along with the jobs that they trigger when the particular event occurs in the system. 4.3.2 The Job Scheduler In actual fact, the job scheduler consists of two schedulers - one for event based and one for time based jobs. According to the start criteria for a particular job, one or the other of these schedulers assumes responsibility for passing it on. For the sake of this overview, we will make no further distinction between the two schedulers. The job scheduler for time controlled jobs is started regularly on all the application servers in the R/3 System which carry out background processing and have background work processes for that purpose. You can set the interval at which it is started as a profile parameter for each application server. The event driven job scheduler is started on the application server on which an event is triggered. You can determine which application server looks after events by setting a profile parameter. When the scheduler begins its task, it selects jobs from the database (job administration data) which have reached their start date or whose triggering event has taken place. The scheduler also takes into account whether any background work processes are free, If it comes across free processes of the right type, it tries to send 13
  • as many jobs as possible to these processes, always bearing in mind the priority of the ‘ready’ jobs and maintaining a reserve of background work processes for important class A jobs. Jobs which cannot be processed are left untouched. Jobs, on the other hand, which are sent to the background work processes are marked as such in the database (‘ready’ status) and, after a short delay. are taken up by the chosen work process and processed completely (without interruption). The job scheduler is responsible for informing the work process about its next task, for creating new job contexts for recurring jobs with a new start time and job number, and storing these in the database. , Jobs Steps R/3 1. ABAPs 2. Database Dispatcher Job Scheduler Job Starter Application Server ... ....... WP0 Dialog-WP Batch-WP WPN Fig. 4.7: System architecture of R/3 background processing (simplified). 4.3.3 The Job Starter and the Job Runtime Environment The job starter is a compact program which is processed in the background work process and finds a step list in the database. The step list is then processed step by step. If an external program is involved, a UNIX or Windows NT command is sent to the operating system. If the step consists of an ABAP/4 program, this is carried out in the R/3 System. The user and the operating system-specific environment variables are essential runtime settings, which must accordingly be specified for each step. 4.3.4 The Job Log Generally speaking, the job log is not stored in the database. It is a TemSe object, and usually a file at operating system level. The TemSe objects are temporary and sequential R/3 objects, which can be stored system-wide in the database, but are normally kept directly in the file system. In any case, the name of the TemSe object - normally the filename - is stored in the job administration information. If a job log is requested for a job, the TemSe object is displayed. The user cannot tell from the dialog whether this is a database object or whether it has been saved in a different way. 14
  • 4.3.5 Job Output Most ABAP/4 or external programs generate output whilst they are running. Possible output includes error messages, messages about a program’s progress, or lists resulting from a report. These outputs and messages are not immediately visible, since the programs are not running in dialog, but in the background. To avoid this output being lost, it is saved so that it can be looked at later. Any messages classed as ‘harmless’ and output lists are looked after by the spool output management (TemSe). All error messages are recorded in the job log. The job log contains information on all job steps. The step list stores information on the location of the output of each job. The reason for this is that each step can create its own output. 15
  • 5. The External Interface Concept The XBP interface described in this document is part of an interface package for external system management tools which SAP intends to release in the near future. On the R/3 side, the interfaces will be constructed through a pool of function modules. External management systems will be able to call these using RFC (Remote Function Call). You can find example calls in the documentation on the interface itself. A short introduction to RFC forms part of the technical basics at the end of this chapter. In the following section, we are working on the assumption that the external system management tool is represented to the R/3 System by an agent. This agent is the communication partner of the function modules. 5.1 The Range Of Interfaces The range of interfaces, under the name XM (eXternal R/3 Management), consists at present of the following individual components: • XBP eXternal Interface for Background Processing • XBR eXternal Interface for Backup & Recovery (bislang: BRI bzw. Backint) • XDB eXternal Interface for Database Admininstration and Monitoring • XMB eXternal Interface for Monitoring Basics • XMI eXternal Monitor Interface • XOM eXternal Interface for Output Management • XSP eXternal Interface for Spooling It is possible that this list will be extended in the future. In the following table you can see the abbreviated name of the interface (and its current version), its implementation technique, the R/3 Release with which it will be delivered and a short description. The certification column shows whether and when a concrete interface can be certified. Only the abbreviations from the first column will be used in technical descriptions. Abbr.l Tech R/3 Short Description Certifi- nique cation Version Rel. XBP RFC 3.1G Job scheduling API in 0.1 Function modules for planning, releasing and future monitoring R/3 jobs. XBR CLI 3.0D Backup Intergration API (also known as BRI) poss. 2.0 script Backup and recovery functions for databases BC-BRI XDB RFC 4.x Database Admin API in planned Basic functions for database administration and future 16
  • monitoring XMB RFC 3.1G Basis API in 0.1 Basis functions for monitoring basis function modules future for scheduling, releasing monitoring R/3 jobs. XMI RFC 3.1G External access to CCMS can be logged and in monitored. future XOM RFC 4.0? Output Management in 0.1 CLI Controlling and return messages for output future management?? XSP RFC 4.x Spool API in planned Monitoring and controlling for the spool system?? future One thing which all of these RFC interfaces have in common is that their function modules call exactly the same function pools as the internal R/3 operations. Figure 5.1 shows this using the XBP. This does not, of course, apply to the (later described) XMI, since there is no internal equivalent. External Agent Access R/3 Internal Job Management XBP General Function Pool for Background Processing R/3 Fig. 5.1: The External Interface Principle, exemplified by XBP Internal and external management use the same basic functionality. It is planned to produce a document such as this one for each interface in the above list. There should be a description of the XMI functionality in all of these documents. 5.2 Naming Conventions It is aimed to have a standardized naming convention for function modules, and this is widely kept to. Thus function modules for the XM- interface family have the prefix SXMI, an identification for the actual interface and arising from the target object and the intended action. Syntactic structure for a function module name: SXMI_<SS>_<Object>_<Action> Example of the naming convention: SXMI_XBP_JOB_OPEN In the example, the actual interface is signified by XBP (eXternal interface for Background Processing). 17
  • The abbreviation for the interface is omitted with XMI, since this can be used for all interfaces. 5.3 Technical Basics The most important technical basics for the external APIs are XMI and RFC. Further technical details concern R/3 profile parameters and the replacement of scripts and executables at operating system level. Here, we do not want to go into these last two techniques, but rather to explore XMI and RFC. XMI is an interface which logs the activities of users and agent programs each time a function module is called. In particular, XMI logs the agent’s first access to the function module pool. At this point, the name of the external program is recorded and its version number checked. RFC (Remote Function Call) forms the communications platform for direct calls to the function modules which implement the interface on the R/3 side. 5.3.1 XMI Monitor: External Access Within R/3 all external CCMS interfaces use the same function modules. These function modules can also be collected into an interface themselves. The name XMI (eXternal Monitoring Interface) was established since the interface was intended to log external access. External Access Interface- XMB XBP Specific Layer General Functions Common Background Processing XMI - logging and more ..... Layer Fig. 5.2: XMI as a common layer for external interfaces. For developers who want to integrate external tools into CCMS, the XMI interface remains almost invisible, appearing only at the beginning and end of a CCMS session in the form of two functions: • SXMI_LOGON: Agent logs on to an external interface • SXMI_LOGOFF: External program logs off from an external interface You have the option of using a further function from the external tool • SXMI_LOGMSG_ENTER: Writes a message to the XMI log In the future there will be further function modules: • SXMI_VERSIONS_GET: Queries the current version of the interface • SXMI_LOG_SELECT: Reads the XMI message log • SXMI_MESSAGE_FORMATS_UPLOAD: Loads language-specific messages 18
  • The information which is logged and collected in the access log can be viewed using Transaction RZ15. The following is displayed: Name of the agent which tried to make contact with the R/3 System, and that of its supplier, the user name (if a user logged on) and any changes or attempted changes which were carried out (for example, reset alert). 5.3.2 RFC Remote Function Call Functions inside and outside of the R/3 System use Remote Function Call to communicate with one another. From a technical point of view, RFC is a library (in the C programming language) which is available on nearly all operating system platforms. How it works. RFC is a general concept, allowing communication between R/3 Systems or between an R/3 System and external programs. In the case of an external system management tool we are dealing with an example of the latter, in which the program adopts the rôle of a client in relation to the R/3 System. The service offered by the application server involves the delivery of internal system information or carrying out individual system management activities. RFC works in sessions. In other words, the user opens an RFC, carries out RFC tasks and then concludes the session. In opening the session, the R/3 logon procedure, with user ID and password, must be carried out. The user must be identifiable to and authorized by the R/3 System. In other words, users must exist within the R/3 System, which are then used by the external agent. Obviously, you need to set up authorizations for these users which correspond with the activities that they are to carry out. RFC recognizes synchronous, asynchronous and transactional calls. The following examples use synchronous calls. For further details on the other types of call, see the appropriate RFC documentation. The Most Important Functions The most important RFC functions at a glance: Name Short Description RfcOpen( ) A connection is made with an application server. The connection information is either specified directly or read from a file. RfcCallReceive( ) Synchronous call from an RFC client Activates a function module in an R/3 System. After processing, the client calling regains control. RfcCall( ) Calls a function module without waiting for it to end. RfcLastError( ) A function allowing you to analyze RFC errors. Detailed information is given in stdout format. RfcClose( ) RFC connection closed, session finished. ItCreate( ) Storage space needs to be created and released when tables are exchanged between a client program and an R/3 System. ItDelete( ) Further RFC Documentation 19
  • Other RFC functions and call forms are contained in the RFC tutorial. R/3 ABAP/4 Development Workbench, Remote Communications (SAP Documentation, Product Number = 50014371) This answers questions relating to parameter transfer and the configuration of an RFC connection (file), as well as giving the syntax of RFC functions with examples. Before implementation, you are strongly recommended to consult this document. It is also available online. Framework of a client RFC program in C In order not to be too theoretical about RFC we have included a practical example. The framework of a program which is linked to the RFC library as an RFC client using the XMB interface would look something like this: #include "saprfc.h" main() { rfc_handle = RfcOpen(&rfc_opt); function = "SXMI_LOGON"; ..... rfc_rc = RfcCallReceive( rfc_handle, function, exporting, importing, tables, &exception ); function = "SXMI_XMB_SYSLOG_READ"; ...... rfc_rc = RfcCallReceive( rfc_handle, function, exporting, importing, tables, &exception ); /* a lot more action */ function = "SXMI_LOGOFF"; ......... rfc_rc = RfcCallReceive( rfc_handle, function, exporting, importing, tables, &exception ); RfcClose(rfc_handle); } From this we can see the model for a session between an R/3 System and an external management tool. An RFC session contains one or more XMI sessions. Each XMI session contains a series of function calls to the individual interface function module. Open RFC session Authorization from R/3 Open XMI session for XBP Identification of XM Call XBP functions Identification of agent user Open XMI session for XMB Identification of XM Call XMB functions Identification of agent user Call XBP functions Identification of agent user Close XMI session Close RFC session RFC is being developed further Another small warning to finish with: the RFC interface is currently being developed further and improved. You should therefore always make sure that you have the current version of the RFC documentation. 20
  • 6. XBP - External Job Scheduling Interface (JOB-API) The external job scheduling interface is often referred to as the JOB-API. However, this can lead to misunderstanding, since there is also a JOB-API in ABAP/4 programming (see document: Programming the Background Processing System, R/3). To avoid the possibility of getting mixed up, we will try here to use the abbreviation XBP along with the name JOB-API whenever necessary. Only XBP-API can be used to connect agents. You cannot use the internal background processing API for this purpose. 6.1 What Is Required of the Interface In order to be able to work in the R/3 System, an external job scheduling system must be able to carry out the following functions within the R/3 System: • Define jobs • Work with jobs • Delete jobs • Start jobs (start immediately) • Terminate active jobs • Access information about jobs (status, log, ...) • Access information about resources in the R/3 job scheduling system (number and status of background work processes) Any critical changes to R/3 jobs (creation, editing, deletion etc) are recorded in the XMI log in the R/3 System. You can display entries in this log using Transaction RZ15. The above functions are contained in ABAP/4 RFC function modules, which you can call from the external job scheduling system: SAP External System Management Tool Synchronous XBP Function Module RFC Call Function SXMI_XBP_JOB... System Management - endfunction External Job Scheduling System R/3 Fig 6.1: How a synchronous RFC function call to XBP works. 6.2 XBP Interface - Description There follows a short overview of the function modules which make up XBP. Reference information about the modules is given in chapter 7. The interface can be divided roughly into the following tasks: 21
  • Defining jobs Function Modules Short Description SXMI_XBP_JOB_OPEN Create a job SXMI_XBP_JOB_ADD_ABAP_STEP Add an ABAP/4 step to an existing job SXMI_XBP_JOB_ADD_EXTPGM_STEP Add an external program to an existing job SXMI_XBP_JOB_CLOSE Finish job creation Working with jobs Function Modules Short Description SXMI_XBP_JOB_ABORT Terminate jobv Modifying jobs Function Modules Short Description SXMI_XBP_JOB_ABAP_STEP_MODIFY Modify an ABAP/4 step SXMI_XBP_JOB_EXTPGM_STEP_MODIFY Modify an external step Starting jobs Function Modules Short Description SXMI_XBP_JOB_START_ASAP Start as soon as possible SXMI_XBP_JOB_START_IMMEDIATELY Start immediately or as soon as possible Monitoring / Controlling the R/3 job scheduling system Function Modules Short Description SXMI_XBP_JOB_STATUS_CHECK Is the job status still correct, is the WP working? SXMI_XBP_JOB_COUNT How many jobs exist with a particular name SXMI_XBP_JOB_STATUS_GET Read job status SXMI_XBP_JOB_PROTOCOL_READ Read job log SXMI_XBP_JOB_SPOOLLIST_READ Read spool data SXMI_XBP_JOB_DEFINITION_GET Read attributes of a job Information about the Background System Function Modules Short Description SXMI_XBP_ CURRENT_RESOURCES_GET Read current background server and work processes 22
  • SXMI_XBP_ RESOURCES_ON_DATE_GET Background work processes at a particular time SXMI_XBP_SRV_RES_ON_DATE_GET Is three a background work process on server at a particular time? SXMI_XBP_VARIANT_INFO_GET Does the ABAP/4 program have variants? 23
  • 7. XBP Reference Manual This is the reference manual for the interface function modules. Please bear in mind that the very latest interface parameter types can only be obtained from your system (Transaction SE37, Function Module - interface). 7.1 Requirements For Using The XBP Interface The requirement for using the XBP interface is an existing XMI session. The technical requirements (RFC, R/3 Version) are contained in earlier chapters. 7.1.1 Logging On To The R/3 System With An External Job Management System Before you call a function module in the XBP interface for the first time, it is important that: • the external job management system logs onto the R/3 System first, using an R/3 user name and password. (C function RfcOpen). • the external job management system is authenticated by the CCMS external interface administration using the function module SXMI_LOGON: Function name SXMI_LOGON Short description Connecting to the external Managment Interfaces RFC-Interface function SXMI_LOGON exporting EXTCOMPANY like XMILOGRAW_EXTCOMPANY type RFC_CHAR length 16 EXTPRODUCT like XMILOGRAW_EXTPRODUCT type RFC_CHAR length 16 INTERFACE like TXMILOGRAWRAW_INTERFACE type RFC_CHAR length 3 VERSION like TXMILOGRAW_VERSION type RFC_CHAR length 10 importing SESSIONID like TXMILOGRAW_SESSIONID type RFC_CHAR length 12 tables exceptions ALREADY_LOGGED_ON CANT_LOG_ACTION INVALID_PARAMETERS LOGON_DENIED PROBLEM_DETECTED UNKNOWN_INTERFACE UNKNOWN_VERSION 24
  • Parameter (Input) • Degree of detail for logging (0 is standard, 4 is nearly a trace) • Name of supplier of external management tool • Product name of external management tool • Interface for logging on. • Version of the Interface in R/3 expected by the external tool. • Auditlevel specifies how in how much detail the session should be recorded in the XMI log Parameter (Output) SessionId is the ID of the RFC connection Exceptions • ALREADY_LOGGED_ON: This product is already logged onto the interface • CANT_LOG_ACTION: Activity was terminated because the R/3 XMI logging mechanism returned an error. • INVALID_PARAMETERS: EXTCOMPANY and EXTPRODUCT are different within a session. • LOGON_DENIED: Logon was denied because the R/3 user used by the external job managements session to log onto the R/3 System is not authorized to work with the external job management system. • PROBLEM_DETECTED: XMI problem which cannot be further specified • UNKNOWN_INTERFACE: The interface required by the external tool is not supported by the system. • UNKNOWN_VERSION: The version required by the external tool is not supported by the system. The logon will only be successful if you assign the following authorization values to the user for the R/3 authorization object S_XMI_PROD: • Name of the company which supplies the external job management system • Program name of the external job management system • Name of the interface which the user wants to work with 25
  • 7.1.2 External Job Management System - Logging Off Function name SXMI_LOGOFF Short description If you want to end the external job management system’s R/3 session, you first need to call the SXMI_LOGOFF function module. RFC-Interface function SXMI_LOGOFF exporting INTERFACE like TXMILOGRAW_INTERFACE default '*' type RFC_CHAR length 3 importing tables exceptions CANT_LOG_ACTION NOT_LOGGED_ON PROBLEM_DETECTED Parameter (Input) • Interface or ‘*’ Parameter (Output) none Exceptions • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: There is no connection with the R/3 System. • PROBLEM_DETECTED XMI problem which cannot be further specified Remarks Afterwards you must close the RFC connection using the C RFC function rfcClose. 26
  • 7.2 Defining Jobs You must observe the following procedure in defining R/3 jobs: • Open job (SXMI_XBP_JOB_OPEN) • assign (SXMI_XBP_JOB_ADD_ABAP_STEP / SXMI_XBP_JOB_ADD_EXTPGM_STEP) one or more job steps (ABAP/4 Programs or external Programs) to the job. • Close job and assign start time if required ( SXMI_XBP_JOB_CLOSE ). 7.2.1 Job Open Function name SXMI_XBP_JOB_OPEN Short description If you want to create a new job, you must first ‘open’ it. When you open a job, its name is recorded and a job number assigned to it. The job name and number are used as a unique key for all subsequent function calls. To open a job you need the following function module: SXMI_XBP_JOB_OPEN. RFC-Interface function SXMI_XBP_JOB_OPEN exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 importing JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING JOBNAME_MISSING PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • EXTERNAL_USER_NAME external user name (required) • JOBNAME Job name (required) Parameter (Output) JOBCOUNT Job count is the system-generated job number Exceptions • JOBNAME_MISSING : You have not entered a job name • PROBLEM_DETECTED: The R/3 job scheduling system has found an error. You can find an exact description in the syslog. • EXTERNAL_USER_NAME_MISSING: The name of the external user is missing. This is the name of a user in the external job scheduling system. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not yet logged on to the CCMS XMI interface. The activity cannot therefore be carried out. 27
  • 7.2.2 Assigning an ABAP/4 Program to a Job Step Function name SXMI_XBP_JOB_ADD_ABAP_STEP Short description An ABAP/4 program which you intend to run within a job can be assigned to a job step. Enter a valid variant name for the program if the ABAP/4 program works with variants. RFC-Interface function SXMI_XBP_JOB_ADD_ABAP_STEP exporting ABAP_PROGRAM_NAME like SYST_REPID type RFC_CHAR length 8 ABAP_VARIANT_NAME like RSVAR_VARIANT default SPACE type RFC_CHAR length 14 ARCHIVE_PARAMETERS structure TXJIARCPAR length 23 number of fields 3 EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 LANGUAGE like TBTCSTEP_LANGUAGE default SY-LANGU type RFC_CHAR length 1 PRINT_PARAMETERS structure TXJIPRIPAR length 22 number of fields 6 SAP_USER_NAME like TBTCSTEP_AUTHCKNAM default SY-UNAME type RFC_CHAR length 12 importing STEP_NUMBER like TBTCJOB_STEPCOUNT type RFC_INT length 4 tables exceptions ARCHIVE_INFO_NOT_FOUND CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING INVALID_ARCHIVE_PARAMS INVALID_PRINT_PARAMS JOBID_MISSING JOB_DOES_NOT_EXIST PROBLEM_DETECTED PROGRAM_NAME_MISSING NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Name of external user (required) • ABAP/4 Program name (required) • ABAP/4 Variant name (optional) • Name of the SAP user under whose authorization the program should run (optional, Default= name of R/3 user used by the external job management system to log onto the R/3 System). • Language for output of job log and lists (optional, default = R/3 system language). • Printing and archiving parameters (optional. Default = print/ archiving parameters of the R/3 user used by the external job management system to log onto the R/3 System). You can set the following values: 28
  • Printer name Delete spool request after printing Number of copies to print (default = ‘1’) Password to display spool list (default = no password) Archiving mode ‘1’ - Print (Default) ‘2’ - Archive ‘3’ - Print and archive ArchiveLink object type of SAP object ArchiveLink document type of archive object ArchiveLink Info Parameter (Output) Number of job steps Exceptions • JOBID_MISSING: You did not enter a job name/ job number. • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • PROGRAM_NAME_MISSING: You did not enter an ABAP/4 program name • PROBLEM_DETECTED: The R/3 job scheduling system has found an error. You can find a detailed description in the syslog. • EXTERNAL_USER_NAME_MISSING: The external user name is missing. This is the name of a user in the external job scheduling system. • INVALID_PRINT_PARAMETERS: Printer entry invalid. • INVALID_ARCHIVE_PARAMETERS: Archiving parameters invalid • CANT_FIND_ARCHIVE_INFO: Archiving information not given. • CANT_LOG_ACTION: Activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool is not logged onto the CCMS XMI interface. The activity can therefore not be carried out. 29
  • 7.2.3 Assigning an External Program to a Job Step . Function name SXMI_XBP_JOB_ADD_EXTPGM_STEP Short description You can assign a program to a job step which runs outside the R/3 System (ex. a C program). Enter the name of the program and that of the host on which the external program is to run RFC- Interface function SXMI_XBP_JOB_ADD_EXTPGM_STEP exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 EXT_PROGRAM_NAME like TBTCSTEP_PROGRAM type RFC_CHAR length 128 EXT_PROGRAM_PARAMETERS like TBTCSTEP_PARAMETER default SPACE type RFC_CHAR length 128 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 SAP_USER_NAME like TBTCSTEP_AUTHCKNAM default SY-UNAME type RFC_CHAR length 12 TARGET_HOST like TBTCSTEP_XPGTGTSYS type RFC_CHAR length 32 WAIT_FOR_TERMINATION like BTCH0000_CHAR1 default 'X' type RFC_CHAR length 1 importing STEP_NUMBER like TBTCJOB_STEPCOUNT type RFC_INT length 4 tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING JOBID_MISSING JOB_DOES_NOT_EXIST PROBLEM_DETECTED PROGRAM_NAME_MISSING TARGET_HOST_MISSING NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required)= • Name of external user (required) • Name of SAP user with which external job management system logs onto R/3 System. • Name of external program (required) • Parameters for external program (optional) • Flag to show whether job waits for external program to terminate (optional, default = ‘X’ i.e. job waits). • Name of host on which the external program is to run (required). Parameter (Output) Number of job steps Exceptions • JOBID_MISSING: You did not enter a job name / job number • JOB_DOES_NOT_EXIST: Job does not exist in R/3 System. 30
  • • PROGRAM_NAME_MISSING: You did not give the name of the external program • TARGET_HOST_MISSING: You did not specify the target host. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered a problem. You can find a detailed description in the syslog. • EXTERNAL_USER_NAME_MISSING: External user name is missing. This is the name of a user in the external job scheduling system. • CANT_LOG_ACTION: Activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged on to the CCMS XMI interface. The activity cannot therefore be carried out. 31
  • 7.2.4 Close Job Definition Function name SXMI_XBP_JOB_CLOSE Short description You close a job definition using the SXMI_XBP_JOB_CLOSE function module. RFC-Interface function SXMI_XBP_JOB_CLOSE exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 TARGET_HOST like TBTCJOB_BTCSYSTEM default SPACE type RFC_CHAR length 32 importing tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING JOBID_MISSING JOB_DOES_NOT_EXIST PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Name of external user (required) • Name of host server on which the job should run (optional) Parameter (Output) none Exceptions • JOBID_MISSING: You have not entered a job name/ job number. • JOB_DOES_NOT_EXIST: Job does not exist in R/3 System. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can see a detailed description in the syslog. • EXTERNAL_USER_NAME_MISSING: Name of external user is missing. This is the name of a user in the external job scheduling system. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging system returned an error. • NOT_LOGGED_ON: The external management tool has not logged on to the CCMS XMI interface. The activity can therefore not be carried out. 32
  • 7.2.5 Reading Job Definitions from the SAP R/3 System Function name SXMI_XBP_JOB_DEFINITION_GET Short description You use the SXMI_XBP_JOB_DEFINITION_GET function module to read all the data associated with a job (name, job class, steps, start date etc.). RFC-Interface WAS NOT GENERATED (modified)! Parameter (Input) • Job name (required) • Job count (required) • Name of external user Parameter (Output) • Job header data (name, job class...) • Table with job step data RFC Stub cannot at present be generated for inhomogenous structures (data in character and integer format). However, this functionality is currently in preparation. For further details consult the RFC documentation. Exceptions • JOBID_MISSING: You have not specified a job name/ count • JOB_DOES_NOT_EXIST: Job does not exist in R/3 System. • JOB_DOESNT_HAVE_STEPS: Job does not yet have any steps. This can occur if a job already exists in the database but no steps have been assigned to it. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 33
  • 7.2.6 Determine Number of Jobs With Particular Job Name Function name SXMI_XBP_JOB_COUNT Short description You can use the function module SXMI_XBP_JOB_COUNT to determine the number of jobs which are defined in the SAP R/3 System with a particular job name. RFC-Interface CANNOT YET BE GENERATED (modified)! Parameter (Input) • Job name (required) • Name of external user Parameter (Output) • Job header data (name, job class,...) for jobs found • Number of jobs found RFC Stub cannot at present be generated automatically for inhomogenous structures (data in character and integer format). This functionality is currently in preparation. For further details consult the RFC documentation. Exceptions • JOBNAME_MISSING: You have not specified a job name • NO_JOBS_FOUND: No jobs with the given name were found • PROBLEM_DETECTED: The R/3 job scheduling system has found an error. You can find a precise description in the syslog • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system • CANT_LOG_ACTION: Activity was terminated because the R/3 XMI logging mechanism returned an error • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 34
  • 7.3 Starting a Job You start a job using the XBP interface in the R/3 System with the start time type ‘start immediately’. Use the following function modules to do this: • Start job immediately (SXMI_XBP_JOB_START_IMMEDIATELY) • Start job as soon as possible (SXMI_XBP_JOB_ASAP). 7.3.1 Start Job Immediately Function name SXMI_XBP_JOB_START_IMMEDIATELY Short description This function attempts to start a job immediately. If the job cannot be started immediately because, for example, all background work processes are busy, the function reports this to its caller. The job is then started after a delay. RFC-Interface function SXMI_XBP_JOB_START_IMMEDIATELY exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 importing tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING JOBID_MISSING JOB_DOES_NOT_EXIST NO_IMMEDIATE_START_POSSIBLE NO_RELEASE_PRIVILEGE_GIVEN PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Job name ( required) • Job count (required) • Name of external user ( required) Parameter (Output) none Exceptions • JOBID_MISSING: You did not enter a job name/ job number • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • PROBLEM_DETECTED: The R/3 job scheduling system discovered an error. You can find a precise description in the syslog. • NO_IMMEDIATE_START_POSSIBLE: Job cannot be started immediately, since no background work processes are free. Note that the Job is not released in this case and is therefore not waiting to run inside the system. • NO_RELEASE_PRIVILEGE_GIVEN: The R/3 user with which the external job management system logged on to the R/3 System, is not authorized to release the job. • EXTERNAL_USER_NAME_MISSING: External user name is missing. This is the name of a user in the external job scheduling 35
  • system. • CANT_LOG_ACTION: Activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged on to the CCMS XMI interface. The activity cannot therefore be carried out. 36
  • 7.3.2 Start Job As Soon As Possible Unlike the SXMI_XBP_JOB_START_IMMEDIATELY function, no error is returned if the job cannot be started immediately. Function name SXMI_XBP_JOB_START_ASAP Short description You use this function to start a job as soon as possible. RFC-Interface function SXMI_XBP_JOB_START_ASAP exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 importing tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING JOBID_MISSING JOB_DOES_NOT_EXIST NO_RELEASE_PRIVILEGE_GIVEN PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Name of external user (required) Parameter (Output) none Exceptions • JOBID_MISSING: You did not enter a job name/ count • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • PROBLEM_DETECTED: The R/3 job scheduling system found an error. You can find a precise description in the syslog. • NO_RELEASE_PRIVILEGE_GIVEN: The R/3 user with which the external job management system logged onto the R/3 System is not authorized to release the job. • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system. • CANT_LOG_ACTION: Activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged on to the CCMS XMI interface. The activity cannot therefore be carried out. 37
  • 7.4 Modifying Steps in a Job There are two functions which you can use to modify job steps containing ABAP/4 or external programs, namely: • SXMI_BP_ABAP_STEP_MODIFY to modify a job step containing an ABAP/4 program and • SXMI_BP_EXTPGM_STEP_MODIFY to modify a job step containing an external program. 7.4.1 Modifying a Job Step Containing an ABAP/4 Program Function name SXMI_XBP_JOB_ABAP_STEP_MODIFY Short description modify a job step containing an ABAP/4 program RFC-Interface Call function SXMI_BP_JOB_ABAP_STEP_MODIFY exporting ABAP_PROGRAM_NAME like SYST_REPID type RFC_CHAR length 8 ABAP_VARIANT_NAME like RSVAR_VARIANT default SPACE type RFC_CHAR length 14 ARCHIVE_PARAMETERS structure TXJIARCPAR length 23 number of fields 3 EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 LANGUAGE like TBTCSTEP_LANGUAGE default SY-LANGU type RFC_CHAR length 1 PRINT_PARAMETERS structure TXJIPRIPAR length 22 number of fields 6 SAP_USER_NAME like TBTCSTEP_AUTHCKNAM default SY-UNAME type RFC_CHAR length 12 STEP_NUMBER like TBTCJOB_STEPCOUNT type RFC_INT length 4 importing tables exceptions ARCHIVE_INFO_NOT_FOUND CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING INVALID_ARCHIVE_PARAMS INVALID_PRINT_PARAMS INVALID_STEP_COUNT JOBID_MISSING JOB_DOES_NOT_EXIST PROBLEM_DETECTED PROGRAM_NAME_MISSING STEP_COUNT_MISSING NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Step number (required) 38
  • • ABAP/4 program name (required) • ABAP/4 variant name (optional) • Name of the SAP user under whose authorization the ABAP/4 program is to run (optional, default = SAP user name used by the external management system to log onto the R/3 System). • Name of external user (required) • Language in which lists and messages should be output (optional, default = language in which the external management system logged onto the R/3 System). • Printing and archive parameters (optional, default = printing and archive parameters of the R/3 user used by the external job scheduling system to log onto the R/3 System ). You can set the following values: Printer name Delete spool request following print output Number of copies to be printed (default =‘1’) Password to display spool list (default = none) Archiving mode ‘1’ - print (default) ‘2’ - archive ‘3’ - print and archive ArchiveLink object type of SAP object ArchiveLink document type of archive object ArchiveLink info Parameter (Output) none Exceptions • JOBID_MISSING: You did not enter a job name/ number. • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • STEP_COUNT_MISSING: You did not enter the number of the step to be modified. • INVALID_STEP_COUNT: Step number invalid, i.e. there is no step with the given number. • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system. • PROGRAM_NAME_MISSING: The ABAP/4 program name is missing. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 39
  • 40
  • 7.4.2 Modifying a Job Step Containing an External Program Function name SXMI_XBP_JOB_EXTPGM_STEP_MODIFY Short description to modify a job step containing an external program. RFC-Interface function SXMI_XBP_JOB_EXTPGM_STEP_MODIFY exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 EXT_PROGRAM_NAME like TBTCSTEP_PROGRAM type RFC_CHAR length 128 EXT_PROGRAM_PARAMETERS like TBTCSTEP_PARAMETER default SPACE type RFC_CHAR length 128 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 SAP_USER_NAME like TBTCSTEP_AUTHCKNAM default SY-UNAME type RFC_CHAR length 12 STEP_NUMBER like TBTCJOB_STEPCOUNT type RFC_INT length 4 TARGET_HOST like TBTCSTEP_XPGTGTSYS type RFC_CHAR length 32 WAIT_FOR_TERMINATION like BTCH0000_CHAR1 default 'X' type RFC_CHAR length 1 importing tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING INVALID_STEP_COUNT JOBID_MISSING JOB_DOES_NOT_EXIST PROBLEM_DETECTED PROGRAM_NAME_MISSING STEP_COUNT_MISSING TARGET_HOST_MISSING NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Step number (required) • Name of external user (required) • Name of the SAP user used by the external job management system to log onto the SAP System. • Name of the external program (required) • Parameters for the external program (optional) • Flag to show whether the job should wait until the external program has ended (optional, default = ‘X’, i.e. job will wait). • Host server on which the external program runs (required) Parameter (Output) none Exceptions • JOBID_MISSING: You did not enter a job name/ number. • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • STEP_COUNT_MISSING: You did not specify the number of the 41
  • step to be modified • INVALID_STEP_COUNT: The step number is invalid, i.e. there is no step with the given number. • PROGRAM_NAME_MISSING: The name of the external program is missing. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find precise information in the syslog. • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system. • CANT_LOG_ACTION: Activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 42
  • 7.5 Finding Job Monitor Data Using an external job management system you can also monitor SAP R/3 jobs and display job logs and spool lists. These can be done using the following function modules: • SXMI_XBP_JOB_STATUS_GET , to determine the status of a job • SXMI_XBP_JOB_PROTOCOL_READ , to read the job log of a job • SXMI_XBP_JOB_SPOOLLIST_READ , to read spool lists from a job • SXMI_XBP_JOB_STATUS_CHECK , to check the status of a job • SXMI_XBP_CURRENT_RESOURCES_GET , to determine the current background processing resources in the R/3 System. 7.5.1 Determining the Status of a Job Function name SXMI_XBP_JOB_STATUS_GET RFC-Interface function SXMI_XBP_JOB_STATUS_GET exporting EXTERNAL_USER_NAME like TXMILOG_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 importing STATUS like TBTCJOB_STATUS type RFC_CHAR length 1 tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING JOBID_MISSING JOB_DOES_NOT_EXIST PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Name of external user (required) Parameter (Output) Job status Possible values for the status of a job 'R' - active 'Y' - ready 'P' - scheduled 'S' - released 'A' - terminated 'F' - finished Exceptions • JOBID_MISSING: You did not specify a job name/ number • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. 43
  • • CANT_LOG_ACTION: Activity was terminated because the R/3 XMI logging mechanism returned an error. • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 44
  • 7.5.2 Read Job Log Function name SXMI_XBP_JOB_PROTOCOL_READ RFC-Interface WAS NOT GENERATED (modified)! Parameter (Input) • Job name (required) • Job count (required) • Name of the external user (required) Parameter (Output) Table containing the job log RFC Stub cannot at present be generated for inhomogenous structures (data in character and integer format). This functionality is currently in preparation. For further details consult the RFC documentation. Exceptions • JOBID_MISSING: You have not entered a job name/ count. • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system. • NO_PRIVILEGE_GIVEN: The SAP R/3 user used by the external management system to log onto the R/3 System, is not authorized to read the job log. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • NO_PROTOCOL_THERE_YET: A log does not yet exist for the specified job. • JOB_PROTOCOL_DOES_NOT_EXIST: The job log listed in the job header data no longer exists. It was probably deleted at operating system level. • JOB_PROTOCOL_IS_EMPTY: Job log is empty. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 45
  • 7.5.3 Read the Spool List of a Job Function name SXMI_XBP_JOB_SPOOLLIST_READ RFC-Interface function SXMI_XBP_JOB_SPOOLLIST_READ exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 STEP_NUMBER like TBTCJOB_STEPCOUNT type RFC_INT length 4 importing tables SPOOL_LIST structure TXMISPOROW length 255 number of fields 1 exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING INVALID_STEP_COUNT JOBID_MISSING JOB_DOESNT_HAVE_STEPS JOB_DOES_NOT_EXIST NO_ABAP_SPOOLLIST NO_PRIVILEGE_GIVEN PROBLEM_DETECTED SPOOL_LIST_IS_EMPTY STEP_COUNT_MISSING STEP_HAS_INVALID_SPOOLID STEP_HAS_NO_SPOOLLIST ..NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Name of external user (required) • Step number whose spool list you want to read (required) Parameter (Output) internal table containing spool list Exceptions • JOBID_MISSING: You have not entered a job name/ number • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • JOB_DOESNT_HAVE_STEPS: Job has no steps. • INVALID_STEP_COUNT: The job does not contain a step with the given number. • STEP_COUNT_MISSING: No step number was specified. • STEP_HAS_NO_SPOOLLIST: The specified step has no spool list. • STEP_HAS_INVALID_SPOOLID: The spool ID contained in the step is invalid. • NO_ABAP_SPOOLLIST: The spool request belonging to the step does not contain an ABAP/4 list. The spool request cannot be displayed. • SPOOL_LIST_IS_EMPTY: The spool request belonging to the step is empty. 46
  • • EXTERNAL_USER_NAME_MISSING: The name of the external user is missing. This is the name of a user in the external job scheduling system. • NO_PRIVILEGE_GIVEN: The user used by the external management system to log onto the R/3 System is not authorized to read the spool list. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 47
  • 7.5.4 Checking the Status of a Job Problems with the R/3 System (Database, network, termination of background work processes) can cause discrepancies between the actual status of a job and its recorded status in the database. Example A background work process, with an active job, is terminated manually. The job runtime system cannot set the job status in the database to ‘terminated’. The function module SXMI_XBP_JOB_STATUS_CHECK recognizes these cases and corrects the job status accordingly. Function name SXMI_XBP_JOB_STATUS_CHECK RFC-Interface function SXMI_XBP_JOB_STATUS_CHECK exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 importing ACTUAL_STATUS like TBTCJOB_STATUS type RFC_CHAR length 1 STATUS_ACCORDING_TO_DB like TBTCJOB_STATUS type RFC_CHAR length 1 tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING JOBID_MISSING JOB_DOES_NOT_EXIST NO_PRIVILEGE_GIVEN PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Name of external user Parameter (Output) • Job status according to the database • Actual job status • Possible values for job status: 'R' - active 'Y' - ready 'P' - scheduled 'S' - released 'A' - terminated 'F' - finished ‘X‘ - actual status cannot be determined Exceptions • JOBID_MISSING: You did not specify a job name/ number • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system. 48
  • • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • NO_PRIVILEGE_GIVEN: The SAP user used by the external job management system to log onto the R/3 System is not authorized to use this function. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 7.6 Controlling Jobs The only control function currently in use is one which you can use to terminate active jobs. 49
  • 7.6.1 Terminating Jobs You can terminate an active job using the function module SXMI_JOB_ABORT. Function name SXMI_XBP_JOB_ABORT RFC-Interface function SXMI_XBP_JOB_ABORT exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32 importing tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING JOBID_MISSING JOB_DOES_NOT_EXIST JOB_IS_NOT_ACTIVE NO_PRIVILEGE_GIVEN PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Job name (required) • Job count (required) • Name of external user (required) Parameter (Output) none Exceptions • JOBID_MISSING: You did not enter a job name / number. • JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System. • EXTERNAL_USER_NAME_MISSING: The name of the external user is missing. This is the name of a user in the external job scheduling system. • JOB_IS_NOT_ACTIVE: The job cannot be terminated since it is not active. • NO_PRIVILEGE_GIVEN: The SAP R/3 user used by the external job management system to log onto the R/3 System is not authorized to terminate the job. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 50
  • 7.7 General Help Functions Below are descriptions of the following functions which allow you to: • see all variants of a given ABAP/4 program (SXMI_XBP_VARIANT_INFO_GET). • see the resources currently available for jobs in the R/3 System (SXMI_XBP_ CURRENT_RESOURCES_GET). • determine whether resources are available for a job on a particular server at a particular time (SXMI_XBP_ SRV_RES_ON_DATE_GET). • determine whether resources are available for a job on any server in the R/3 System at a particular time (SXMI_XBP_RESOURCES_ON_DATE_GET). • read syslog entries in the R/3 System. 7.7.1 Show All Defined Variants of an ABAP/4 Program Function name SXMI_XBP_VARIANT_INFO_GET RFC-Interface function SXMI_XBP_VARIANT_INFO_GET exporting ABAP_PROGRAM_NAME like SYST_REPID type RFC_CHAR length 8 EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 importing tables ABAP_VARIANT_TABLE structure RSVARKEY length 22 number of fields 2 exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING NO_EXECUTE_PRIVILEGE_GIVEN NO_VARIANTS_DEFINED_YET PROBLEM_DETECTED PROGRAM_DOES_NOT_EXIST PROGRAM_HAS_NO_VARIANTS PROGRAM_NAME_MISSING PROGRAM_NOT_EXECUTABLE NOT_LOGGED_ON Parameter (Input) • ABAP/4 program name (required) • Name of the external user (required) Parameter (Output) Table containing all defined variants of the ABAP/4 program Exceptions • PROGRAM_DOES_NOT_EXIST: The specified ABAP/4 program does not exist in the R/3 System. • PROGRAM_HAS_NO_VARIANTS: The ABAP/4 program has no variants. • NO_VARIANTS_DEFINED_YET: You have not yet defined any variants. • PROGRAM_NOT_EXECUTABLE: The program is not executable. • NO_EXECUTE_PRIVILEGE_GIVEN: The SAP user used by the external job management system to log onto the R/3 System is 51
  • not authorized to execute the ABAP/4 program. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • EXTERNAL_USER_NAME_MISSING: The name of the external user is missing. This is the name of a user in the external job scheduling system • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 52
  • 7.7.2 Determine Current Resources for Jobs in the R/3 System Using the function module SXMI_XBP_ CURRENT_RESOURCES_GET you can retrieve the following values from the R/3 System: • Names of the servers which currently have background work processes • Number of background work processes on each server and their status (total number, free, working, class A background work processes). Function name SXMI_XBP_CURRENT_RESOURCES_GET RFC-Interface function SXMI_XBP_CURRENT_RESOURCES_GET exporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 importing tables RESOURCE_INFO structure BTCCURRES length 69 number of fields 5 exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING NO_RESOURCES_FOUND PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) Name of external user (required) Parameter (Output) Table, containing the following information in each line: • Server name • Host name • Total number of background work processes on the server • Number of free background work processes on the server • Number of working background work processes on the server • Number of reserved class A background work processes on the server Exceptions • PROBLEM_DETECTED: The R/3 job scheduling system has discovered an error. You can find a precise description in the syslog. • NO_RESOURCES_FOUND: There are no background processing resources in the R/3 System. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • EXTERNAL_USER_NAME_MISSING: The name of the external user is missing. This is the name of a user in the external job scheduling system. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity could therefore not be carried out. 53
  • 7.7.3 Check Available Job Resources at a Particular Time on a Server In the R/3 System, within the framework of switching operation modes on servers, you can assign different work process types at different times. For example, you might only have dialog processes during the day, but at night some of these switch to operating as background work processes. You can use the function module SXMI_XBP_SRV_RES_ON_DATE to determine whether background work processes are available at a particular time on a particular server. Function name SXMI_XBP_ SRV_RES_ON_DATE_GET RFC-Interface function SXMI_XBP_SRV_RES_ON_DATE_GET exporting DATE like SYST_DATUM type RFC_DATE length 8 EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 SERVER_NAME like TBTCJOB_EXECSERVER type RFC_CHAR length 20 TIME like SYST_UZEIT type RFC_TIME length 6 importing RESOURCE_INFO structure BTCDTTMRES length 66 number of fields 4 tables exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING INVALID_DATE_TIME INVALID_SERVER_NAME NO_RESOURCES_FOUND PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Name of the external user (required) • Server name • Date • Time Parameter (Output) • Host name • Number of background work processes • Number of reserved class A background work processes Exceptions • NO_RESOURCES_FOUND: There are no background work processes on the server at the given time and date. • PROBLEM_DETECTED: The R/3 job scheduling system has discovered a problem. You can find a precise description in the syslog. • INVALID_SERVER_NAME: The specified server name is invalid • INVALID_DATE_TIME: The specified date and/or time is invalid • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • EXTERNAL_USER_NAME_MISSING: The name of the external user is missing. This is the name of a user in an external job scheduling system. • NOT_LOGGED_ON: The external management tool has not 54
  • logged onto the CCMS XMI interface. The activity cannot therefore be carried out. Note The XMI log does not record any calls to this function, since it does not change or output any security-sensitive data. 55
  • 7.7.4 Check Available Job Resources at a Particular Time in the Whole R/3 System. You can use function module SXMI_XBP_RESOURCES_ON_DATE_GET to determine whether background work processes are available at a particular time on any server in the R/3 System. Function name SXMI_XBP_RESOURCES_ON_DATE_GET RFC-Interface Call function SXMI_XBP_RESOURCES_ON_DATE_GET exporting DATE like SYST_DATUM type RFC_DATE length 8 EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16 TIME like SYST_UZEIT type RFC_TIME length 6 importing tables RESOURCE_INFO_TBL structure BTCDTTMRES length 66 number of fields 4 exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING INVALID_DATE_TIME NO_RESOURCES_FOUND PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Name of the external user (required) • Date (required) • Time (required) Parameter (Output) Table containing the following values: • Server name • Host name • Number of background work processes • Number of reserved class A background work processes Exceptions • NO_RESOURCES_FOUND: There are no background work processes in the R/3 System at the given time and date. • INVALID_DATE_TIME: The specified time and/ or date is invalid. • PROBLEM_DETECTED: The job scheduling system has discovered an error. You can find a precise description in the syslog. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging system returned an error. • EXTERNAL_USER_NAME_MISSING: The name of the external user is missing. This is the name of a user in the external job scheduling system. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface. The activity cannot therefore be carried out. 56
  • 8. Appendix The following function module is a part of the XMB interface. As it is important for all of the interfaces to be able to find out whether an entry has been generated in the syslog, we have shown here that it is possible to read the R/3 syslog from outside. Please refer to the XMB interface documentation for further monitoring functions of external system management tools 57
  • 8.1.1 Reading Syslog Entries in the R/3 System (Part of the XMB Interface) You can use the function module SXMI_XMB_SYSLOG_READ to read entries from the R/3 System syslog. It is always a good idea to do this whenever the PROBLEM_DETECTED exception is triggered, since in almost all cases, the syslog contains a precise description of the error. Function name SXMI_XMB_SYSLOG_READ Short description You can use the function module SXMI_XMB_SYSLOG_READ to read entries from the R/3 System syslog. It is always a good idea to do this whenever the PROBLEM_DETECTED exception is triggered, since in almost all cases, the syslog contains a precise description of the error. RFC-Interface function SXMI_XMB_SYSLOG_READ exporting EXTERNAL_USER_NAME like TXMILOGeaq_EXTUSER type RFC_CHAR length 16 FROM_DATE like SYST_DATUM default SPACE type RFC_DATE length 8 FROM_TIME like SYST_UZEIT default SPACE type RFC_TIME length 6 SERVER_NAME like TBTCJOB_EXECSERVER default SPACE type RFC_CHAR length 20 TO_DATE like SYST_DATUM default SPACE type RFC_DATE length 8 TO_TIME like SYST_UZEIT default SPACE type RFC_TIME length 6 importing tables SYSLOG_TBL structure BTCSYSLOG length 255 number of fields 1 exceptions CANT_LOG_ACTION EXTERNAL_USER_NAME_MISSING INVALID_DATE_TIME INVALID_SERVER_NAME PROBLEM_DETECTED NOT_LOGGED_ON Parameter (Input) • Name of external user (required) • Name of the server whose syslog you want to read (optional, default = current server) • From date (optional) • From time (optional) • To date (optional) • To time (optional) Note If dates and times are not specified, the system reads the syslog entries during the last 10 minutes Parameter (Output) Table containing syslog entries Exceptions • INVALID_DATE_TIME: The specified date and/or time is invalid. 58
  • • INVALID_SERVER_NAME: The specified server name is invalid. • PROBLEM_DETECTED: The job scheduling system has discovered an error. You can find a precise description in the syslog. • CANT_LOG_ACTION: The activity was terminated because the R/3 XMI logging mechanism returned an error. • EXTERNAL_USER_NAME_MISSING: Name of the external user is missing. This is the name of a user in the external job scheduling system. • NOT_LOGGED_ON: The external management tool has not logged onto the CCMS XMI interface, The activity cannot therefore be carried out. 59