interface documentation bc-xbp

59
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

Upload: databaseguys

Post on 08-May-2015

411 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Interface Documentation BC-XBP

Connecting External Job ManagementSystems to the R/3 CCMS Job

Scheduling SystemXBP External Interface for Background Processing

External Interface forBackground Processing

Release 3 .1

Page 2: Interface Documentation BC-XBP

2

Copyright1996 including screen shots by SAP AG. All rights reserved.

Neither this documentation nor any part of it may be copied or reproduced in any formor by any means or translated into another language, without the prior consent of SAPAG.

SAP AG makes no warranties or representations with respect to the content hereof andspecifically disclaims any implied warranties of merchantability or fitness for anyparticular purpose. SAP AG assumes no responsibility for any errors that may appearin this document. The information contained in this document is subject to changewithout notice. SAP AG reserves the right to make any such changes withoutobligation to notify any person of such revision or changes. SAP AG makes nocommitment to keep the information contained herein up to date.

TrademarksSAP and ABAP/4 are registered trademarks of SAP AG.

All other products mentioned in this documentation are registered or unregisteredtrademarks of their respective companies.

Page 3: Interface Documentation BC-XBP

3

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 94.2.1 Creating Jobs 104.2.2 Releasing a Job 114.2.3 Starting Jobs (Ready and Active) 124.2.4 Ending a Job (Terminated or Finished) 12

4.3 Architecture of the R/3 Job Scheduling System 134.3.1 Job Administration in the Database 134.3.2 The Job Scheduler 134.3.3 The Job Starter and the Job Runtime Environment 144.3.4 The Job Log 144.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 185.3.1 XMI Monitor: External Access 185.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 247.1.1 Logging On To The R/3 System With An External Job Management System 247.1.2 External Job Management System - Logging Off 26

7.2 Defining Jobs 277.2.1 Job Open 277.2.2 Assigning an ABAP/4 Program to a Job Step 287.2.3 Assigning an External Program to a Job Step 307.2.4 Close Job Definition 32

Page 4: Interface Documentation BC-XBP

4

7.2.5 Reading Job Definitions from the SAP R/3 System 337.2.6 Determine Number of Jobs With Particular Job Name 34

7.3 Starting a Job 357.3.1 Start Job Immediately 357.3.2 Start Job As Soon As Possible 37

7.4 Modifying Steps in a Job 387.4.1 Modifying a Job Step Containing an ABAP/4 Program 387.4.2 Modifying a Job Step Containing an External Program 41

7.5 Finding Job Monitor Data 437.5.1 Determining the Status of a Job 437.5.2 Read Job Log 457.5.3 Read the Spool List of a Job 467.5.4 Checking the Status of a Job 48

7.6 Controlling Jobs 497.6.1 Terminating Jobs 50

7.7 General Help Functions 517.7.1 Show All Defined Variants of an ABAP/4 Program 517.7.2 Determine Current Resources for Jobs in the R/3 System 537.7.3 Check Available Job Resources at a Particular Time on a Server 547.7.4 Check Available Job Resources at a Particular Time in the Whole R/3 System. 56

8. APPENDIX 578.1.1 .Reading Syslog Entries in the R/3 System (Part of the XMB Interface) 58

Page 5: Interface Documentation BC-XBP

5

Release Information for XBP Version 0.1 -December 1996This is the first publicly available version of the XBP documentation. Itencompasses all of the anticipated function modules for the interface. Thisinterface will first be delivered with R/3 Release 3.1G.

Page 6: Interface Documentation BC-XBP

6

1. IntroductionThis document deals with the connection of an external job management system to theR/3 System. By external job management, we mean software which allows jobs to bescheduled, run and monitored from outside the R/3 System.

For this purpose, SAP has defined an open generic interface. This is called XBP, whichstands for eXternal interface for job Background Processing. XBP is one of a range ofopen interfaces which SAP intends to make available in the future for systemmanagement tasks. R/3’s internal CCMS (Computing Center Management System),with this range of interfaces, offers support to software manufacturers by allowingintegration with existing system administration tools.

Page 7: Interface Documentation BC-XBP

7

2. The Function of External InterfacesThe motivation for the development of these external interfaces arose from the desireto let SAP installations - especially large ones - be overseen by other softwarevendors’ tools.

ExternalSystem Administration Tool

R/3 System

OpenInterfaces

Fig. 2.1: Location of external interfaces

External interfaces allow you to integrate R/3 simply and seamlessly into both localadministrative tools and business-wide system management infrastructures. Thisintegration should not and cannot completely replace the use of CCMS. Complex andsecurity-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 backgroundjobs, the internal job system in R/3 is still required to carry out the background jobsgenerated by applications such as R/3 archiving or the Workbench.

The aim of the integration is to allow the customer a homogenous informationinfrastructure. The aim of the interface is to facilitate the flow of information betweenthe R/3 System and external tools.

In summing up, we could say that external tools provide additional flexibility tocomplement the existing basic functionality of CCMS.

Page 8: Interface Documentation BC-XBP

8

3. The Rest of This Document - An OverviewChapter 4 of this document contains a global description of the R/3 job managementsystem. This short introduction demonstrates the concept and the components behindthe 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 bySAP.

Chapter 6 contains the actual description of the XBP; the motivation behind it, itstechnical background and a functional overview. This is all intended as anintroduction. A reference manual follows in chapter 7. This is provided to help with theimplementation of external agents.

3.1 A Note About This DocumentWe have assumed that the reader will already have a certain degree of knowledge ofthe R/3 System.

You should already be familiar with terms like application server, dispatcher, schedulerand work process in relation to R/3 basis. Additionally, you need to know at least whata function module is.

Page 9: Interface Documentation BC-XBP

9

4. A Short Introduction to R/3 BackgroundProcessing

Firstly, we need to explain why background processing has a place in a dialog-orientedstandard application. What is a ‘job’ within the R/3 System, and how does the systemcarry it out?

We intend to demonstrate the concept using an example. Afterwards, we will introducethe architecture of background processing as a system.

4.1 MotivationR/3 is, above all, an interactive system. In other words, the vast majority of tasks arecarried out in dialog with the user. However, there are also good reasons for theinclusion 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 aviable option.

• Tasks sometimes need to be carried out at times when no competent user isavailable to carry out the dialog.

• Periodically recurring jobs need to be carried out at exact times, or on Sundays orPublic Holidays.

• Existing job structures are to be inherited from other, maybe older systems.

4.2 ConceptA 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. Forexample, 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). Howeversince these names are not unique if the same application job is repeated, jobs alsohave 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 ormore of these steps. Each step calls either an ABAP/4 program or an externalprogram. An external program can be either a shell script or an executable programwritten, for example, in C code.

Whilst several jobs may be started one after the other in any order you choose, thesteps within a job are always carried out in the sequence in which they have beendefined.

Jobs have a life cycle - they are created (scheduled), released, are ready, becomeactive, and finally are finished or canceled. We talk of the statuses that a job canhave. Figure 4.1 shows the chain of these statuses:

Page 10: Interface Documentation BC-XBP

10

Sched- Released Ready Active uled

Finished

Canceled

Fig. 4.1: Status chain for jobs.

In the following sections, we follow the life cycle of a job systematically. Figure 4.2shows 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 goneaccording to plan, the job status moves on to ‘finished’. A program error will lead to afinal status of ‘canceled’.

Sched- Released- Ready Active uled

Finished

Canceled

ABAP/4Program

in dialog Job scheduler Job starter

WorkProcess

Programerror

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 joboverview (Transaction SM37).

4.2.1 Creating JobsYou can regard a job as a list of steps plus administrative information - “Where andhow is the job run?”. To create a job, you assign existing program for the steps, thenadd the administrative information.

There are three ways of bringing this administrative information into the R/3 System; ina 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_SUBMITand JOB_CLOSE function modules. You have the same parameters and degree offreedom here as in the dialog.

3. XBP allows you to use the functionality described in (2) in conjunction with externalprograms and agents.

In each of these cases, the job number is created by the system itself to ensure thatthe job has a unique identification. Figure 4.3 shows the specification of a newlycreated job, with its name, number, status and steps.

Page 11: Interface Documentation BC-XBP

11

Jobname: PAYROLL_RUNJobcount: 14201001Status : scheduledTarget host : -Start criteria :Step1 : GHLTBRUTStep2 : 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, thesystem decides itself on which application server the job is to be carried out. This isthe normal procedure recommended by SAP, because the system can then carry outits own load balancing. You should only specify the target machine if that server hasparticular resources which are necessary for the job processing.

4.2.2 Releasing a JobA job is released when you specify a start time for it. You can release a job as soon asyou create it, by specifying the start time. In this case, the job does not appear asscheduled, but assumes released status straight away. Once released, a job is fullydefined from the point of view of the user or the ABAP/4 program. However, this doesnot necessarily mean that it can be started straight away.

Put simply, a job is started when its determined starting time is reached. In thedifferent applications, there are different requirements regarding the setting of asuitable 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 on1.31.97).

Now comes the question of whether you want to specify all repetitions of the job at thesame time (for example, execute monthly). Here things have already becomecomplicated (2.31.97 doesn’t exist). There are many possibilities and exceptionalcases.

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 arereached.

3. Event A job is started when a particular event is triggered inthe system or by a program at operating system level.E.g. when data for processing is imported to a serverby file transfer.

4. Preceding job A job is started once a particular preceding job hasrun.

5. Change of operationmode

A job starts once the R/3 System has switched into aparticular operation mode.

6. Start on working day A job is started when a particular working day of themonth 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/3System 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

Page 12: Interface Documentation BC-XBP

12

each repetition, is released, for example, each time a particular event occurs, or everyday 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 specifydeviations in the frequency of periodic jobs (E.g. carry out periodically, but not onPublic Holidays)

Jobname: PAYROLL_RUNJobcount: 14201001Status : releasedTarget Host : -Start criteria : last workday of monthStep1 : GHLTBRUTStep2 : 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 laiddown 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 itsstart criteria met. This is done periodically - every 60 seconds as a rule (you can setthis as a system parameter).

As well as this, the job scheduler has to ensure that sufficient system resources areavailable for a job to be carried out. The most important system resources in this caseare background work processes. These are work processes which are reserved forbackground processing.

The Job scheduler ignores jobs whose start time has not been reached. Jobs whichshould have started, but for which no free work process was available, are checkedconstantly. When the job scheduler finds a free work process, it sets the job to readyand tells the background work process that work is waiting.

,Jobname: PAYROLL_RUNJobcount: 14201001Status : activeTarget host : -Start criteria : last workday of monthStep1 : GHLTBRUTStep2 : 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 jobdefinition 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 runsaccording to plan and no errors occur, the job acquires ‘finished’ status. This can beseen both in the job log and the dialog in Transaction SM37.

Page 13: Interface Documentation BC-XBP

13

If an ABAP/4 error or any other interruption occurs at runtime, an error message isrecorded in the job log, and the job is terminated.

Jobname: PAYROLL_RUNJobcount: 14201001Status : finishedTarget host : -Start criteria : last workday of monthStep1 : GHLTBRUTStep2 : 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’. Furtherinformation can be seen in the log.

4.3 Architecture of the R/3 Job Scheduling SystemThe essential components of the R/3 background processing are the database tableswhich contain the job administration data and steps, the job scheduler, job starter, thejob log and the spool subsystem.

Within this document we can only present a rough sketch of how these elements worktogether. The aim is, however, to provide a simple model of how the system works.

4.3.1 Job Administration in the DatabaseAll essential job administration information and the job steps themselves are stored inthe 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 entriesnecessary 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 oneview.

An event table lists all events defined in R/3, along with the jobs that they trigger whenthe particular event occurs in the system.

4.3.2 The Job SchedulerIn actual fact, the job scheduler consists of two schedulers - one for event based andone for time based jobs. According to the start criteria for a particular job, one or theother of these schedulers assumes responsibility for passing it on. For the sake of thisoverview, we will make no further distinction between the two schedulers.

The job scheduler for time controlled jobs is started regularly on all the applicationservers in the R/3 System which carry out background processing and havebackground work processes for that purpose. You can set the interval at which it isstarted as a profile parameter for each application server. The event driven jobscheduler is started on the application server on which an event is triggered. You candetermine which application server looks after events by setting a profile parameter.

When the scheduler begins its task, it selects jobs from the database (jobadministration data) which have reached their start date or whose triggering event hastaken place. The scheduler also takes into account whether any background workprocesses are free, If it comes across free processes of the right type, it tries to send

Page 14: Interface Documentation BC-XBP

14

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 importantclass A jobs. Jobs which cannot be processed are left untouched. Jobs, on the otherhand, which are sent to the background work processes are marked as such in thedatabase (‘ready’ status) and, after a short delay. are taken up by the chosen workprocess and processed completely (without interruption).

The job scheduler is responsible for informing the work process about its next task, forcreating new job contexts for recurring jobs with a new start time and job number, andstoring these in the database.

,R/3Database

Dispatcher

ApplicationServer

Job Scheduler Job Starter

... .......

WP0 Dialog-WP Batch-WP WPN

ABAPsJobs Steps

1.2.

Fig. 4.7: System architecture of R/3 background processing (simplified).

4.3.3 The Job Starter and the Job Runtime EnvironmentThe job starter is a compact program which is processed in the background workprocess and finds a step list in the database. The step list is then processed step bystep. If an external program is involved, a UNIX or Windows NT command is sent tothe operating system. If the step consists of an ABAP/4 program, this is carried out inthe R/3 System.

The user and the operating system-specific environment variables are essentialruntime settings, which must accordingly be specified for each step.

4.3.4 The Job LogGenerally speaking, the job log is not stored in the database. It is a TemSe object, andusually a file at operating system level. The TemSe objects are temporary andsequential R/3 objects, which can be stored system-wide in the database, but arenormally 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 tellfrom the dialog whether this is a database object or whether it has been saved in adifferent way.

Page 15: Interface Documentation BC-XBP

15

4.3.5 Job OutputMost ABAP/4 or external programs generate output whilst they are running. Possibleoutput includes error messages, messages about a program’s progress, or listsresulting from a report.

These outputs and messages are not immediately visible, since the programs are notrunning in dialog, but in the background. To avoid this output being lost, it is saved sothat it can be looked at later. Any messages classed as ‘harmless’ and output lists arelooked after by the spool output management (TemSe). All error messages arerecorded 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 reasonfor this is that each step can create its own output.

Page 16: Interface Documentation BC-XBP

16

5. The External Interface ConceptThe XBP interface described in this document is part of an interface package forexternal 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 FunctionCall). You can find example calls in the documentation on the interface itself. A shortintroduction 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 systemmanagement tool is represented to the R/3 System by an agent. This agent is thecommunication partner of the function modules.

5.1 The Range Of InterfacesThe range of interfaces, under the name XM (eXternal R/3 Management), consists atpresent 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 itscurrent version), its implementation technique, the R/3 Release with which it will bedelivered and a short description. The certification column shows whether and when aconcrete interface can be certified. Only the abbreviations from the first column will beused in technical descriptions.

Abbr.l

Version

Technique

R/3

Rel.

Short Description Certifi-cation

XBP

0.1

RFC 3.1G Job scheduling API

Function modules for planning, releasing andmonitoring R/3 jobs.

in

future

XBR

2.0

CLI

script

3.0D Backup Intergration API (also known as BRI)

Backup and recovery functions for databases

poss.

BC-BRI

XDB

planned

RFC 4.x Database Admin API

Basic functions for database administration and

in

future

Page 17: Interface Documentation BC-XBP

17

monitoring

XMB

0.1

RFC 3.1G Basis API

Basis functions for monitoring basis function modulesfor scheduling, releasing monitoring R/3 jobs.

in

future

XMI RFC 3.1G External access to CCMS can be logged andmonitored.

in

future

XOM

0.1

RFC

CLI

4.0? Output Management

Controlling and return messages for outputmanagement??

in

future

XSP

planned

RFC 4.x Spool API

Monitoring and controlling for the spool system??

in

future

One thing which all of these RFC interfaces have in common is that their functionmodules call exactly the same function pools as the internal R/3 operations. Figure 5.1shows this using the XBP. This does not, of course, apply to the (later described) XMI,since there is no internal equivalent.

General Function Pool forBackground Processing

XBP

R/3

ExternalAccess R/3 Internal

Job Management

Agent

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 abovelist. There should be a description of the XMI functionality in all of these documents.

5.2 Naming ConventionsIt is aimed to have a standardized naming convention for function modules, and this iswidely kept to. Thus function modules for the XM- interface family have the prefixSXMI, an identification for the actual interface and arising from the target object andthe 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 forBackground Processing).

Page 18: Interface Documentation BC-XBP

18

The abbreviation for the interface is omitted with XMI, since this can be used for allinterfaces.

5.3 Technical BasicsThe most important technical basics for the external APIs are XMI and RFC. Furthertechnical details concern R/3 profile parameters and the replacement of scripts andexecutables at operating system level. Here, we do not want to go into these last twotechniques, but rather to explore XMI and RFC.

XMI is an interface which logs the activities of users and agent programs each time afunction module is called. In particular, XMI logs the agent’s first access to the functionmodule pool. At this point, the name of the external program is recorded and itsversion number checked.

RFC (Remote Function Call) forms the communications platform for direct calls to thefunction modules which implement the interface on the R/3 side.

5.3.1 XMI Monitor: External AccessWithin R/3 all external CCMS interfaces use the same function modules. Thesefunction modules can also be collected into an interface themselves. The name XMI(eXternal Monitoring Interface) was established since the interface was intended to logexternal access.

XMI - logging and more CommonLayer

Interface-SpecificLayer

XMB XBP

ExternalAccess

General FunctionsBackground Processing .....

Fig. 5.2: XMI as a common layer for external interfaces.

For developers who want to integrate external tools into CCMS, the XMI interfaceremains almost invisible, appearing only at the beginning and end of a CCMS sessionin 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

Page 19: Interface Documentation BC-XBP

19

The information which is logged and collected in the access log can be viewed usingTransaction RZ15.

The following is displayed: Name of the agent which tried to make contact with the R/3System, and that of its supplier, the user name (if a user logged on) and any changesor attempted changes which were carried out (for example, reset alert).

5.3.2 RFC Remote Function CallFunctions inside and outside of the R/3 System use Remote Function Call tocommunicate with one another. From a technical point of view, RFC is a library (in theC 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 betweenan R/3 System and external programs.

In the case of an external system management tool we are dealing with an example ofthe 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 systeminformation or carrying out individual system management activities.

RFC works in sessions. In other words, the user opens an RFC, carries out RFC tasksand then concludes the session. In opening the session, the R/3 logon procedure, withuser ID and password, must be carried out. The user must be identifiable to andauthorized 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 upauthorizations for these users which correspond with the activities that they are to carryout.

RFC recognizes synchronous, asynchronous and transactional calls. The followingexamples use synchronous calls. For further details on the other types of call, see theappropriate 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 connectioninformation 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, theclient 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 isgiven in stdout format.

RfcClose( ) RFC connection closed, session finished.

ItCreate( )

ItDelete( )

Storage space needs to be created and released when tables areexchanged between a client program and an R/3 System.

Further RFC Documentation

Page 20: Interface Documentation BC-XBP

20

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 RFCconnection (file), as well as giving the syntax of RFC functions with examples.

Before implementation, you are strongly recommended to consult this document. It isalso 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 usingthe 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 externalmanagement tool. An RFC session contains one or more XMI sessions. Each XMIsession 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 developedfurther and improved. You should therefore always make sure that you have thecurrent version of the RFC documentation.

Page 21: Interface Documentation BC-XBP

21

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/4programming (see document: Programming the Background Processing System, R/3).To avoid the possibility of getting mixed up, we will try here to use the abbreviationXBP along with the name JOB-API whenever necessary. Only XBP-API can be used toconnect agents. You cannot use the internal background processing API for thispurpose.

6.1 What Is Required of the InterfaceIn order to be able to work in the R/3 System, an external job scheduling system mustbe 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 andstatus of background work processes)

Any critical changes to R/3 jobs (creation, editing, deletion etc) are recorded in the XMIlog 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 cancall from the external job scheduling system:

ExternalSystem Management Tool

SystemManagement

-External

Job SchedulingSystem

SAP

XBP Function Module Function SXMI_XBP_JOB...

endfunction

R/3

SynchronousRFC Call

Fig 6.1: How a synchronous RFC function call to XBP works.

6.2 XBP Interface - DescriptionThere 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:

Page 22: Interface Documentation BC-XBP

22

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 existingjob

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 aspossible

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 WPworking?

SXMI_XBP_JOB_COUNT How many jobs exist with a particularname

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 andwork processes

Page 23: Interface Documentation BC-XBP

23

SXMI_XBP_ RESOURCES_ON_DATE_GET Background work processes at aparticular time

SXMI_XBP_SRV_RES_ON_DATE_GET Is three a background work process onserver at a particular time?

SXMI_XBP_VARIANT_INFO_GET Does the ABAP/4 program havevariants?

Page 24: Interface Documentation BC-XBP

24

7. XBP Reference ManualThis is the reference manual for the interface function modules. Please bear in mindthat 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 InterfaceThe requirement for using the XBP interface is an existing XMI session. The technicalrequirements (RFC, R/3 Version) are contained in earlier chapters.

7.1.1 Logging On To The R/3 System With An External JobManagement System

Before you call a function module in the XBP interface for the first time, it is importantthat:

• the external job management system logs onto the R/3 System first, using an R/3user name and password. (C function RfcOpen).

• the external job management system is authenticated by the CCMS externalinterface 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 typeRFC_CHAR length 16

EXTPRODUCT like XMILOGRAW_EXTPRODUCTtype RFC_CHAR length 16

INTERFACE like TXMILOGRAWRAW_INTERFACEtype RFC_CHAR length 3

VERSION like TXMILOGRAW_VERSION typeRFC_CHAR length 10

importing

SESSIONID like TXMILOGRAW_SESSIONIDtype RFC_CHAR length 12

tables

exceptions

ALREADY_LOGGED_ON

CANT_LOG_ACTION

INVALID_PARAMETERS

LOGON_DENIED

PROBLEM_DETECTED

UNKNOWN_INTERFACE

UNKNOWN_VERSION

Page 25: Interface Documentation BC-XBP

25

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 berecorded in the XMI log

Parameter (Output) SessionId is the ID of the RFC connection

Exceptions • ALREADY_LOGGED_ON: This product is already logged onto theinterface

• CANT_LOG_ACTION: Activity was terminated because the R/3XMI logging mechanism returned an error.

• INVALID_PARAMETERS: EXTCOMPANY and EXTPRODUCTare different within a session.

• LOGON_DENIED: Logon was denied because the R/3 user usedby the external job managements session to log onto the R/3System is not authorized to work with the external jobmanagement system.

• PROBLEM_DETECTED: XMI problem which cannot be furtherspecified

• UNKNOWN_INTERFACE: The interface required by the externaltool is not supported by the system.

• UNKNOWN_VERSION: The version required by the external toolis not supported by the system.

The logon will only be successful if you assign the following authorization values to theuser 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

Page 26: Interface Documentation BC-XBP

26

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/3session, 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 theR/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 furtherspecified

Remarks Afterwards you must close the RFC connection using the C RFCfunction rfcClose.

Page 27: Interface Documentation BC-XBP

27

7.2 Defining JobsYou 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/4Programs 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 youopen a job, its name is recorded and a job number assigned to it. Thejob name and number are used as a unique key for all subsequentfunction calls.

To open a job you need the following function module:SXMI_XBP_JOB_OPEN.

RFC-Interface function SXMI_XBP_JOB_OPENexporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length16 JOBNAME like TBTCJOB_JOBNAME type RFC_CHAR length 32importing JOBCOUNT like TBTCJOB_JOBCOUNT type RFC_CHAR length 8tablesexceptions 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 hasfound an error. You can find an exact description in the syslog.

• EXTERNAL_USER_NAME_MISSING: The name of the externaluser is missing. This is the name of a user in the external jobscheduling system.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has not yetlogged on to the CCMS XMI interface. The activity cannottherefore be carried out.

Page 28: Interface Documentation BC-XBP

28

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 beassigned to a job step. Enter a valid variant name for the program ifthe ABAP/4 program works with variants.

RFC-Interface function SXMI_XBP_JOB_ADD_ABAP_STEPexporting 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 12importing STEP_NUMBER like TBTCJOB_STEPCOUNT type RFC_INT length 4tablesexceptions 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 programshould run (optional, Default= name of R/3 user used by theexternal job management system to log onto the R/3 System).

• Language for output of job log and lists (optional, default = R/3system language).

• Printing and archiving parameters (optional. Default = print/archiving parameters of the R/3 user used by the external jobmanagement system to log onto the R/3 System). You can set thefollowing values:

Page 29: Interface Documentation BC-XBP

29

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/4program name

• PROBLEM_DETECTED: The R/3 job scheduling system hasfound an error. You can find a detailed description in the syslog.

• EXTERNAL_USER_NAME_MISSING: The external user name ismissing. This is the name of a user in the external job schedulingsystem.

• 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/3XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool is not loggedonto the CCMS XMI interface. The activity can therefore not becarried out.

Page 30: Interface Documentation BC-XBP

30

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/3System (ex. a C program). Enter the name of the program and that ofthe host on which the external program is to run

RFC- Interface function SXMI_XBP_JOB_ADD_EXTPGM_STEPexporting 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 1importing STEP_NUMBER like TBTCJOB_STEPCOUNT type RFC_INT length 4tablesexceptions 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 systemlogs 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.

Page 31: Interface Documentation BC-XBP

31

• PROGRAM_NAME_MISSING: You did not give the name of theexternal program

• TARGET_HOST_MISSING: You did not specify the target host.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered a problem. You can find a detailed description in thesyslog.

• EXTERNAL_USER_NAME_MISSING: External user name ismissing. This is the name of a user in the external job schedulingsystem.

• CANT_LOG_ACTION: Activity was terminated because the R/3XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged on to the CCMS XMI interface. The activity cannottherefore be carried out.

Page 32: Interface Documentation BC-XBP

32

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 functionmodule.

RFC-Interface function SXMI_XBP_JOB_CLOSEexporting 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 32importingtablesexceptions 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 hasdiscovered an error. You can see a detailed description in thesyslog.

• EXTERNAL_USER_NAME_MISSING: Name of external user ismissing. This is the name of a user in the external job schedulingsystem.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging system returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged on to the CCMS XMI interface. The activity can thereforenot be carried out.

Page 33: Interface Documentation BC-XBP

33

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 toread all the data associated with a job (name, job class, steps, startdate 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 inhomogenousstructures (data in character and integer format). However, thisfunctionality is currently in preparation. For further details consult theRFC 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 stepshave been assigned to it.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• EXTERNAL_USER_NAME_MISSING: Name of the external useris missing. This is the name of a user in the external jobscheduling system.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 34: Interface Documentation BC-XBP

34

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 todetermine the number of jobs which are defined in the SAP R/3System 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 forinhomogenous structures (data in character and integer format). Thisfunctionality is currently in preparation. For further details consult theRFC 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 hasfound an error. You can find a precise description in the syslog

• EXTERNAL_USER_NAME_MISSING: Name of the external useris missing. This is the name of a user in the external jobscheduling system

• CANT_LOG_ACTION: Activity was terminated because the R/3XMI logging mechanism returned an error

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 35: Interface Documentation BC-XBP

35

7.3 Starting a JobYou start a job using the XBP interface in the R/3 System with the start time type ‘startimmediately’. 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 bestarted immediately because, for example, all background workprocesses are busy, the function reports this to its caller. The job isthen started after a delay.

RFC-Interface function SXMI_XBP_JOB_START_IMMEDIATELYexporting 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 32importingtablesexceptions 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 systemdiscovered an error. You can find a precise description in thesyslog.

• NO_IMMEDIATE_START_POSSIBLE: Job cannot be startedimmediately, since no background work processes are free. Notethat the Job is not released in this case and is therefore notwaiting to run inside the system.

• NO_RELEASE_PRIVILEGE_GIVEN: The R/3 user with which theexternal job management system logged on to the R/3 System, isnot authorized to release the job.

• EXTERNAL_USER_NAME_MISSING: External user name ismissing. This is the name of a user in the external job scheduling

Page 36: Interface Documentation BC-XBP

36

system.

• CANT_LOG_ACTION: Activity was terminated because the R/3XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged on to the CCMS XMI interface. The activity cannottherefore be carried out.

Page 37: Interface Documentation BC-XBP

37

7.3.2 Start Job As Soon As PossibleUnlike the SXMI_XBP_JOB_START_IMMEDIATELY function, no error isreturned 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_ASAPexporting 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 32importingtablesexceptions 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 anerror. You can find a precise description in the syslog.

• NO_RELEASE_PRIVILEGE_GIVEN: The R/3 user with which theexternal job management system logged onto the R/3 System isnot authorized to release the job.

• EXTERNAL_USER_NAME_MISSING: Name of the external useris missing. This is the name of a user in the external jobscheduling system.

• CANT_LOG_ACTION: Activity was terminated because the R/3XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged on to the CCMS XMI interface. The activity cannottherefore be carried out.

Page 38: Interface Documentation BC-XBP

38

7.4 Modifying Steps in a JobThere are two functions which you can use to modify job steps containing ABAP/4 or externalprograms, namely:

• SXMI_BP_ABAP_STEP_MODIFYto modify a job step containing an ABAP/4 program

and

• SXMI_BP_EXTPGM_STEP_MODIFYto 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_MODIFYexporting 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 4importingtablesexceptions 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)

Page 39: Interface Documentation BC-XBP

39

• ABAP/4 program name (required)

• ABAP/4 variant name (optional)

• Name of the SAP user under whose authorization the ABAP/4program is to run (optional, default = SAP user name used by theexternal 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 systemlogged onto the R/3 System).

• Printing and archive parameters (optional, default = printing andarchive parameters of the R/3 user used by the external jobscheduling system to log onto the R/3 System ). You can set thefollowing 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 thestep to be modified.

• INVALID_STEP_COUNT: Step number invalid, i.e. there is nostep with the given number.

• EXTERNAL_USER_NAME_MISSING: Name of the external useris missing. This is the name of a user in the external jobscheduling system.

• PROGRAM_NAME_MISSING: The ABAP/4 program name ismissing.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 40: Interface Documentation BC-XBP

40

Page 41: Interface Documentation BC-XBP

41

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_MODIFYexporting 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 1importingtablesexceptions 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 managementsystem 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 externalprogram 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

Page 42: Interface Documentation BC-XBP

42

step to be modified

• INVALID_STEP_COUNT: The step number is invalid, i.e. there isno step with the given number.

• PROGRAM_NAME_MISSING: The name of the external programis missing.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find precise information in thesyslog.

• EXTERNAL_USER_NAME_MISSING: Name of the external useris missing. This is the name of a user in the external jobscheduling system.

• CANT_LOG_ACTION: Activity was terminated because the R/3XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 43: Interface Documentation BC-XBP

43

7.5 Finding Job Monitor DataUsing an external job management system you can also monitor SAP R/3 jobs anddisplay job logs and spool lists. These can be done using the following functionmodules:

• 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 currentbackground 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_GETexporting 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 32importing STATUS like TBTCJOB_STATUS type RFC_CHAR length 1tablesexceptions 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 hasdiscovered an error. You can find a precise description in thesyslog.

• JOB_DOES_NOT_EXIST: Job does not exist in the R/3 System.

Page 44: Interface Documentation BC-XBP

44

• CANT_LOG_ACTION: Activity was terminated because the R/3XMI logging mechanism returned an error.

• EXTERNAL_USER_NAME_MISSING: Name of the external useris missing. This is the name of a user in the external jobscheduling system.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 45: Interface Documentation BC-XBP

45

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 inhomogenousstructures (data in character and integer format). This functionality iscurrently in preparation. For further details consult the RFCdocumentation.

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 useris missing. This is the name of a user in the external jobscheduling system.

• NO_PRIVILEGE_GIVEN: The SAP R/3 user used by the externalmanagement system to log onto the R/3 System, is not authorizedto read the job log.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• NO_PROTOCOL_THERE_YET: A log does not yet exist for thespecified job.

• JOB_PROTOCOL_DOES_NOT_EXIST: The job log listed in thejob header data no longer exists. It was probably deleted atoperating system level.

• JOB_PROTOCOL_IS_EMPTY: Job log is empty.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 46: Interface Documentation BC-XBP

46

7.5.3 Read the Spool List of a Job

Function name SXMI_XBP_JOB_SPOOLLIST_READ

RFC-Interface function SXMI_XBP_JOB_SPOOLLIST_READexporting 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 4importingtables SPOOL_LIST structure TXMISPOROW length 255 number of fields 1exceptions 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 thegiven number.

• STEP_COUNT_MISSING: No step number was specified.

• STEP_HAS_NO_SPOOLLIST: The specified step has no spoollist.

• STEP_HAS_INVALID_SPOOLID: The spool ID contained in thestep is invalid.

• NO_ABAP_SPOOLLIST: The spool request belonging to the stepdoes not contain an ABAP/4 list. The spool request cannot bedisplayed.

• SPOOL_LIST_IS_EMPTY: The spool request belonging to thestep is empty.

Page 47: Interface Documentation BC-XBP

47

• EXTERNAL_USER_NAME_MISSING: The name of the externaluser is missing. This is the name of a user in the external jobscheduling system.

• NO_PRIVILEGE_GIVEN: The user used by the externalmanagement system to log onto the R/3 System is not authorizedto read the spool list.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 48: Interface Documentation BC-XBP

48

7.5.4 Checking the Status of a JobProblems with the R/3 System (Database, network, termination of background workprocesses) can cause discrepancies between the actual status of a job and its recordedstatus in the database.

Example

A background work process, with an active job, is terminated manually. The jobruntime system cannot set the job status in the database to ‘terminated’.

The function module SXMI_XBP_JOB_STATUS_CHECK recognizes these cases andcorrects the job status accordingly.

Function name SXMI_XBP_JOB_STATUS_CHECK

RFC-Interface function SXMI_XBP_JOB_STATUS_CHECKexporting 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 32importing ACTUAL_STATUS like TBTCJOB_STATUS type RFC_CHAR length 1 STATUS_ACCORDING_TO_DB like TBTCJOB_STATUS type RFC_CHAR length 1tablesexceptions 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 useris missing. This is the name of a user in the external jobscheduling system.

Page 49: Interface Documentation BC-XBP

49

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• NO_PRIVILEGE_GIVEN: The SAP user used by the external jobmanagement system to log onto the R/3 System is not authorizedto use this function.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

7.6 Controlling JobsThe only control function currently in use is one which you can use to terminate active jobs.

Page 50: Interface Documentation BC-XBP

50

7.6.1 Terminating JobsYou can terminate an active job using the function module SXMI_JOB_ABORT.

Function name SXMI_XBP_JOB_ABORT

RFC-Interface function SXMI_XBP_JOB_ABORTexporting 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 32importingtablesexceptions 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 externaluser is missing. This is the name of a user in the external jobscheduling system.

• JOB_IS_NOT_ACTIVE: The job cannot be terminated since it isnot active.

• NO_PRIVILEGE_GIVEN: The SAP R/3 user used by the externaljob management system to log onto the R/3 System is notauthorized to terminate the job.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 51: Interface Documentation BC-XBP

51

7.7 General Help FunctionsBelow 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 aparticular time (SXMI_XBP_ SRV_RES_ON_DATE_GET).

• determine whether resources are available for a job on any server in the R/3System 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_GETexporting ABAP_PROGRAM_NAME like SYST_REPID type RFC_CHAR length 8 EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16importingtables ABAP_VARIANT_TABLE structure RSVARKEY length 22 number of fields 2exceptions 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 programdoes not exist in the R/3 System.

• PROGRAM_HAS_NO_VARIANTS: The ABAP/4 program has novariants.

• NO_VARIANTS_DEFINED_YET: You have not yet defined anyvariants.

• PROGRAM_NOT_EXECUTABLE: The program is not executable.

• NO_EXECUTE_PRIVILEGE_GIVEN: The SAP user used by theexternal job management system to log onto the R/3 System is

Page 52: Interface Documentation BC-XBP

52

not authorized to execute the ABAP/4 program.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• EXTERNAL_USER_NAME_MISSING: The name of the externaluser is missing. This is the name of a user in the external jobscheduling system

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 53: Interface Documentation BC-XBP

53

7.7.2 Determine Current Resources for Jobs in the R/3System

Using the function module SXMI_XBP_ CURRENT_RESOURCES_GET you canretrieve 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 (totalnumber, free, working, class A background work processes).

Function name SXMI_XBP_CURRENT_RESOURCES_GET

RFC-Interface function SXMI_XBP_CURRENT_RESOURCES_GETexporting EXTERNAL_USER_NAME like TXMILOGRAW_EXTUSER type RFC_CHAR length 16importingtables RESOURCE_INFO structure BTCCURRES length 69 number of fields 5exceptions 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 theserver

Exceptions • PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• NO_RESOURCES_FOUND: There are no background processingresources in the R/3 System.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• EXTERNAL_USER_NAME_MISSING: The name of the externaluser is missing. This is the name of a user in the external jobscheduling system.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity could thereforenot be carried out.

Page 54: Interface Documentation BC-XBP

54

7.7.3 Check Available Job Resources at a Particular Time ona Server

In the R/3 System, within the framework of switching operation modes on servers, youcan assign different work process types at different times. For example, you might onlyhave dialog processes during the day, but at night some of these switch to operating asbackground work processes. You can use the function moduleSXMI_XBP_SRV_RES_ON_DATE to determine whether background work processesare 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_GETexporting 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 6importing RESOURCE_INFO structure BTCDTTMRES length 66 number of fields 4tablesexceptions 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 workprocesses on the server at the given time and date.

• PROBLEM_DETECTED: The R/3 job scheduling system hasdiscovered a problem. You can find a precise description in thesyslog.

• 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 theR/3 XMI logging mechanism returned an error.

• EXTERNAL_USER_NAME_MISSING: The name of the externaluser is missing. This is the name of a user in an external jobscheduling system.

• NOT_LOGGED_ON: The external management tool has not

Page 55: Interface Documentation BC-XBP

55

logged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Note

The XMI log does not record any calls to this function, since it does not changeor output any security-sensitive data.

Page 56: Interface Documentation BC-XBP

56

7.7.4 Check Available Job Resources at a Particular Time inthe Whole R/3 System.

You can use function module SXMI_XBP_RESOURCES_ON_DATE_GET todetermine whether background work processes are available at a particular time onany server in the R/3 System.

Function name SXMI_XBP_RESOURCES_ON_DATE_GET

RFC-Interface Call function SXMI_XBP_RESOURCES_ON_DATE_GETexporting 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 6importingtables RESOURCE_INFO_TBL structure BTCDTTMRES length 66 number of fields 4exceptions 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 workprocesses 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 hasdiscovered an error. You can find a precise description in thesyslog.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging system returned an error.

• EXTERNAL_USER_NAME_MISSING: The name of the externaluser is missing. This is the name of a user in the external jobscheduling system.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface. The activity cannottherefore be carried out.

Page 57: Interface Documentation BC-XBP

57

8. Appendix

The following function module is a part of the XMB interface. As it is important for all ofthe 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. Pleaserefer to the XMB interface documentation for further monitoring functions of externalsystem management tools

Page 58: Interface Documentation BC-XBP

58

8.1.1 Reading Syslog Entries in the R/3 System (Part of theXMB Interface)

You can use the function module SXMI_XMB_SYSLOG_READ to read entries fromthe R/3 System syslog. It is always a good idea to do this whenever thePROBLEM_DETECTED exception is triggered, since in almost all cases, the syslogcontains a precise description of the error.

Function name SXMI_XMB_SYSLOG_READ

Short description You can use the function module SXMI_XMB_SYSLOG_READ toread entries from the R/3 System syslog. It is always a good idea to dothis whenever the PROBLEM_DETECTED exception is triggered,since in almost all cases, the syslog contains a precise description ofthe error.

RFC-Interface function SXMI_XMB_SYSLOG_READexporting 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 6importingtables SYSLOG_TBL structure BTCSYSLOG length 255 number of fields 1exceptions 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 syslogentries during the last 10 minutes

Parameter (Output) Table containing syslog entries

Exceptions • INVALID_DATE_TIME: The specified date and/or time is invalid.

Page 59: Interface Documentation BC-XBP

59

• INVALID_SERVER_NAME: The specified server name is invalid.

• PROBLEM_DETECTED: The job scheduling system hasdiscovered an error. You can find a precise description in thesyslog.

• CANT_LOG_ACTION: The activity was terminated because theR/3 XMI logging mechanism returned an error.

• EXTERNAL_USER_NAME_MISSING: Name of the external useris missing. This is the name of a user in the external jobscheduling system.

• NOT_LOGGED_ON: The external management tool has notlogged onto the CCMS XMI interface, The activity cannottherefore be carried out.