Interface XbpInterface
- 
- All Superinterfaces:
- RfcInterface
 
 public interface XbpInterface extends RfcInterface XBP Interface Currently supported XBP interfaces are XBP 1.0 and higher, that is XBP 0.1 is not supported.
 Selecting SAP jobs using{ import com.redwood.scheduler.api.connector.sap.rfc.scripting.RfcConnectionManager; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpInterface; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpWork; import com.redwood.scheduler.api.model.SAPSystem; { Partition part = jcsSession.getPsrtitionByName("MyPartition"); SAPSystem sapSystem = jcsSession.getSAPSystemByName(part, "NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem); rfcConnectionManager.callXBP(new XbpWork() { public void performWork(final XbpInterface xbp) { //… } }); } }selectJobs:
 Selecting intercepted SAP jobs using{ import com.redwood.scheduler.api.connector.sap.rfc.scripting.RfcConnectionManager; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpInterface; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpJobSelectionOption; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpJob; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpWork; import com.redwood.scheduler.api.model.enumeration.SapBatchJobStatus; import com.redwood.scheduler.api.model.SAPSystem; import com.redwood.scheduler.api.date.DateTimeZone; import java.util.Iterator; { SAPSystem sapSystem = jcsSession.getSAPSystemByName("NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem); rfcConnectionManager.callXBP(new XbpWork() { public void performWork(final XbpInterface xbp) { SapBatchJobStatus[] statuses = new SapBatchJobStatus[] { SapBatchJobStatus.Scheduled, SapBatchJobStatus.Finished }; DateTimeZone dtz = new DateTimeZone(); dtz.truncateHour(); Iterator<XbpJob> jobs = xbp.selectJobs(XbpJobSelectionOption.All, "*", null, statuses, dtz, new DateTimeZone() ); jobs.forEachRemaining(job -> { jcsOut.println("SAP job #" + job.getJobcount() + " named '" + job.getJobname() + "' has " + job.getNumberOfSteps() + " step(s)."); }); } }); } }getInterceptedJobs:
 Raising an SAP batch event usingimport com.redwood.scheduler.api.connector.sap.rfc.scripting.RfcConnectionManager; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpInterface; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpJobSelectionOption; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpJob; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpWork; import com.redwood.scheduler.api.model.SAPSystem; import java.util.Iterator; { SAPSystem sapSystem = jcsSession.getSAPSystemByName("NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem); rfcConnectionManager.callXBP(new XbpWork() { public void performWork(final XbpInterface xbp) { Iterator<XbpJob> interceptedJobs = xbp.getInterceptedJobs(XbpJobSelectionOption.All); interceptedJobs.forEachRemaining(interceptedJob -> { jcsOut.println("SAP job #" + interceptedJob.getJobcount() + " has been intercepted"); }); } }); }raiseBatchEvent:
 Reading an SAP Variant usingimport com.redwood.scheduler.api.connector.sap.rfc.scripting.RfcConnectionManager; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpInterface; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpWork; import com.redwood.scheduler.api.model.SAPSystem; { SAPSystem sapSystem = jcsSession.getSAPSystemByName("NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem); rfcConnectionManager.callXBP(new XbpWork() { public void performWork(final XbpInterface xbp) { xbp.raiseBatchEvent("Z_TEST", "Testing this."); } }); }getVariant:
 Reading an SAP database table usingimport com.redwood.scheduler.api.connector.sap.rfc.scripting.RfcConnectionManager; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpInterface; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpWork; import com.redwood.scheduler.api.model.SAPSystem; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.AbapVariantValue; import java.util.Iterator; { SAPSystem sapSystem = jcsSession.getSAPSystemByName("NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem); rfcConnectionManager.callXBP(new XbpWork() { public void performWork(final XbpInterface xbp) { Iterator<AbapVariantValue> abapVariantValues = xbp.getVariant("RSUSR007", "TRAINING").getValues(); abapVariantValues.forEachRemaining(val -> { if (val.isParameter()) { jcsOut.println("SAP variant value " + val.getName() + " is a parameter."); } }); } }); }readTable:
 Calling BDC Transactions usingimport com.redwood.scheduler.api.connector.sap.rfc.scripting.RfcConnectionManager; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpInterface; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpWork; Import com.redwood.scheduler.api.connector.sap.rfc.scripting.TableRow; import com.redwood.scheduler.api.model.SAPSystem; import java.util.Iterator; { SAPSystem sapSystem = jcsSession.getSAPSystemByName("NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem); rfcConnectionManager.callXBP(new XbpWork() { public void performWork(final XbpInterface xbp) { String[] cols = new String[] { "BUKRS", "BUTXT", "WAERS" }; String[] wClauses = new String[] { , }; Iterator<TableRow> it = xbp.readTable("T001", "|", cols, wClauses, -1, 20); it.forEachRemaining(tr -> { jcsOut.println(tr.toString()); }); } }); }BdcDynpro:import com.redwood.scheduler.api.connector.sap.rfc.scripting.RfcConnectionManager; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpInterface; import com.redwood.scheduler.api.connector.sap.rfc.scripting.xbp.XbpWork; import com.redwood.scheduler.api.connector.sap.rfc.scripting.BdcDynpro; import com.redwood.scheduler.api.connector.sap.rfc.scripting.BdcReturn; import com.redwood.scheduler.api.connector.sap.rfc.scripting.BdcDynproFactory; import com.redwood.scheduler.api.model.SAPSystem; { SAPSystem sapSystem = jcsSession.getSAPSystemByName("NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem); rfcConnectionManager.callXBP(new XbpWork() { public void performWork(final XbpInterface xbp) { BdcDynpro[] bdcDynpro = new BdcDynpro[1]; bdcDynpro[0] = BdcDynproFactory.createBdcDynpro("SAPLSUU5", "0050"); bdcDynpro[0].addValue("BDC_OKCODE", "=SHOW"); bdcDynpro[0].addValue("USR-02-BNAME", "USER"); BdcReturn bdcReturn = xbp.callTransaction("SU01", bdcDynpro); BdcMessage[] msgs = bdcReturn.getMessages(); for (BdcMessage msg : msgs) { jcsOut.println(msg.getMessageV1() + " " + msg.getMessageType() + " " + bdcReturn.getReturnCode()); } } }); }
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends RfcFunctionModule>
 voidattach(T functionModule)Attaches an RFC-enabled detached function module context which can be used to call the function moduleBdcReturncallTransaction(String transactionName, BdcDynpro[] bdcData)Call a transactionvoidconfirmTransactionId(String tid)Confirm a transaction id<T extends RfcFunctionModule>
 TcreateRfcFunctionModule(Class<T> functionModule)Create an RFC-enabled function module context which can be used to call the function moduleStringcreateTransactionId()Create a transaction id for an IDOCIterator<XbpJob>getInterceptedJobs(XbpJobSelectionOption option)Get intercepted jobs.StringgetISOLanguage()Get ISO language of the SAP systemXbpJobgetJob(String jobname, String jobcount)Get a specific jobStringgetMessageText(BdcMessage message)Retrieve the message text basedBdcMessagereply from a transaction callStringgetMessageText(String language, String msgid, String msgno, String v1, String v2, String v3, String v4)Retrieve the message text based on it's id and number similar to the ABAP keyword MESSAGE.BusinessKeygetSapBusinessKey()Get business key of the SAP systemStringgetSapClient()Get default client of the SAP systemStringgetSAPLanguage()Get SAP language of the SAP systemStringgetSapSystem()Get SAP system InstanceStringgetSapSystemPartition()Get Partition of the SAP systemStringgetSapUser()Get SAP userSAPSystemInfogetSystemInfo()Get the details of the SAP system as returned by the function module RFC_SYSTEM_INFOTimeZonegetTimeZone()Gets the time zone of the SAP systemUserDetailsgetUserDetails(String userName)Get user detailsAbapVariantgetVariant(String abapProgramName, String variantName)Get the data of a variant of an ABAP programbooleanhasRedwoodTransports()Check if Redwood transport are loaded and licensed.booleanhasXbp1()Check if XBP 1.0 is available.booleanhasXbp2()Check if XBP 2.0 is available.booleanhasXbp3()Check if XBP 3.0 is available.voidraiseBatchEvent(String eventId, String eventParameter)Raise a batch eventIterator<TableRow>readTable(String tableName, String delimiter, String[] columns, String[] whereClauses, int rowSkip, int rowCount)Read the contents of the given SAP ABAP tableIterator<XbpJob>selectJobs(XbpJobSelectionOption option, String jobnameMask, String usernameMask, SapBatchJobStatus[] statuses)Select jobs by the name of the job, owner name and statusIterator<XbpJob>selectJobs(XbpJobSelectionOption option, String jobnameMask, String usernameMask, SapBatchJobStatus[] statuses, DateTimeZone fromDateTime, DateTimeZone toDateTime)Select jobs by the name of the job, owner name, status and timeIterator<XbpJob>selectJobs(XbpJobSelectionOption option, String jobnameMask, String usernameMask, SapBatchJobStatus[] statuses, String eventId, String eventParameter)Select jobs by the name of the job, owner name, status and eventvoidsendIDoc(IDoc idoc, String tid)Send an IDOC using a transaction id
 
- 
- 
- 
Method Detail- 
getSystemInfoSAPSystemInfo getSystemInfo() Get the details of the SAP system as returned by the function module RFC_SYSTEM_INFO- Specified by:
- getSystemInfoin interface- RfcInterface
- Returns:
- details of the SAP system
 
 - 
hasXbp1boolean hasXbp1() Check if XBP 1.0 is available. NOTE: this check also succeeds if XBP 2.0 or higher is available. Since this interface does not support XBP 0.1, this check is expected to always succeed.- Returns:
- trueif XBP 1.0 or higher is available,- falseotherwise
 
 - 
hasXbp2boolean hasXbp2() Check if XBP 2.0 is available. NOTE: this check also succeeds if XBP 3.0 or higher is available.- Returns:
- trueif XBP 2.0 or higher is available,- falseotherwise
 
 - 
hasXbp3boolean hasXbp3() Check if XBP 3.0 is available. NOTE: this check also succeeds if XBP 4.0 or higher is available. Hold on... there is no XBP 4.0...- Returns:
- trueif XBP 3.0 or higher is available,- falseotherwise
 
 - 
hasRedwoodTransportsboolean hasRedwoodTransports() Check if Redwood transport are loaded and licensed.- Specified by:
- hasRedwoodTransportsin interface- RfcInterface
- Returns:
- trueif Redwood transport are loaded and licensed,- falseotherwise
 
 - 
selectJobsIterator<XbpJob> selectJobs(XbpJobSelectionOption option, String jobnameMask, String usernameMask, SapBatchJobStatus[] statuses) Select jobs by the name of the job, owner name and status- Parameters:
- option- selection option
- jobnameMask- job name mask.- nullmatches all job names.- *can be used as wildcard.
- usernameMask- owner user name mask.- nullmatches all user names.- *can be used as wildcard.
- statuses- arrays with job statuses.- nullor empty array matches all job statuses.
- Returns:
- Iteratorwith the jobs of type- XbpJob
 
 - 
selectJobsIterator<XbpJob> selectJobs(XbpJobSelectionOption option, String jobnameMask, String usernameMask, SapBatchJobStatus[] statuses, DateTimeZone fromDateTime, DateTimeZone toDateTime) Select jobs by the name of the job, owner name, status and time- Parameters:
- option- selection option
- jobnameMask- job name mask.- nullmatches all job names.- *can be used as wildcard.
- usernameMask- owner user name mask.- nullmatches all user names.- *can be used as wildcard.
- statuses- arrays with job statuses.- nullor empty array matches all job statuses.
- fromDateTime- date and time from where to start the selection.- nullmatches all jobs from the beginning of the universe.
- toDateTime- date and time up to where to do the selection.- nullmatches all jobs till the end of the universe.
- Returns:
- Iteratorwith the jobs of type- XbpJob
 
 - 
selectJobsIterator<XbpJob> selectJobs(XbpJobSelectionOption option, String jobnameMask, String usernameMask, SapBatchJobStatus[] statuses, String eventId, String eventParameter) Select jobs by the name of the job, owner name, status and event- Parameters:
- option- selection option
- jobnameMask- job name mask.- nullmatches all job names.- *can be used as wildcard.
- usernameMask- owner user name mask.- nullmatches all user names.- *can be used as wildcard.
- statuses- arrays with job statuses.- nullor empty array matches all job statuses.
- eventId- event id to search for.
- eventParameter- event parameter value.- nullmatches all parameter values.- *can be used as wildcard.
- Returns:
- Iteratorwith the jobs of type- XbpJob
 
 - 
getInterceptedJobsIterator<XbpJob> getInterceptedJobs(XbpJobSelectionOption option) Get intercepted jobs. Returns an emptyIteratorif XBP 2.0 is not available, i.e. it is not required to explicitly check if XBP 2.0 is available before calling this method.
 - 
getJobXbpJob getJob(String jobname, String jobcount) Get a specific job- Parameters:
- jobname- name of the job
- jobcount- id of the job
- Returns:
- XbpJobwith the job details
 
 - 
raiseBatchEventvoid raiseBatchEvent(String eventId, String eventParameter) Raise a batch event- Parameters:
- eventId- event id
- eventParameter- parameter value of the event
 
 - 
getVariantAbapVariant getVariant(String abapProgramName, String variantName) Get the data of a variant of an ABAP program- Parameters:
- abapProgramName- name of the ABAP program
- variantName- name of the variant
- Returns:
- AbapVariantwith the variant details
 
 - 
readTableIterator<TableRow> readTable(String tableName, String delimiter, String[] columns, String[] whereClauses, int rowSkip, int rowCount) Read the contents of the given SAP ABAP table- Specified by:
- readTablein interface- RfcInterface
- Parameters:
- tableName- name of the ABAP table
- delimiter- column delimiter. Default is- |.
- columns- array with column names that should be retrieved. All columns are retrieved if the array is empty or- null.
- whereClauses- array with where clauses for the query statement. No where clauses are applied if the array is empty or- null.
- rowSkip- number of rows to skip from the beginning of the result set, or- -1to get the complete result set
- rowCount- number of rows to retrieve, or- -1to retrieve all rows
- Returns:
- Iteratorwith the table rows of type- TableRow
 
 - 
callTransactionBdcReturn callTransaction(String transactionName, BdcDynpro[] bdcData) Call a transaction- Specified by:
- callTransactionin interface- RfcInterface
- Parameters:
- transactionName- name of the transaction to call
- bdcData- data that is passed to the input fields of the transaction
- Returns:
- BdcReturnobject with the return code of the transaction call and all messages that were sent
 
 - 
getUserDetailsUserDetails getUserDetails(String userName) Get user details- Specified by:
- getUserDetailsin interface- RfcInterface
- Parameters:
- userName-
- Returns:
- UserDetailsobject containing details of the user in question
 
 - 
getMessageTextString getMessageText(String language, String msgid, String msgno, String v1, String v2, String v3, String v4) Retrieve the message text based on it's id and number similar to the ABAP keyword MESSAGE. Example: xbp.getMessage("EN", "XM", "086", "01.08.2009", "01.09.2009", "3", "XBP") returns "Reorganization of the log for XBP (except from 16.09.2009 to 16.09.2009, audit 3)"- Specified by:
- getMessageTextin interface- RfcInterface
- Parameters:
- language-
- msgid-
- msgno-
- v1-
- v2-
- v3-
- v4-
- Returns:
- message text
 
 - 
getMessageTextString getMessageText(BdcMessage message) Retrieve the message text basedBdcMessagereply from a transaction call- Specified by:
- getMessageTextin interface- RfcInterface
- Parameters:
- message- message as it came back from a transaction call
- Returns:
- message text
 
 - 
getTimeZoneTimeZone getTimeZone() Gets the time zone of the SAP system- Specified by:
- getTimeZonein interface- RfcInterface
- Returns:
- TimeZoneof the SAP system
 
 - 
createRfcFunctionModule<T extends RfcFunctionModule> T createRfcFunctionModule(Class<T> functionModule) Create an RFC-enabled function module context which can be used to call the function module- Specified by:
- createRfcFunctionModulein interface- RfcInterface
- Parameters:
- functionModule- function module to call
- Returns:
- RfcFunctionModulecontext
 
 - 
attach<T extends RfcFunctionModule> void attach(T functionModule) Attaches an RFC-enabled detached function module context which can be used to call the function module- Specified by:
- attachin interface- RfcInterface
- Parameters:
- functionModule- function module to call
 
 - 
createTransactionIdString createTransactionId() Create a transaction id for an IDOC- Specified by:
- createTransactionIdin interface- RfcInterface
- Returns:
- transaction id
 
 - 
confirmTransactionIdvoid confirmTransactionId(String tid) Confirm a transaction id- Specified by:
- confirmTransactionIdin interface- RfcInterface
- Parameters:
- tid- transaction id to confirm
 
 - 
sendIDocvoid sendIDoc(IDoc idoc, String tid) Send an IDOC using a transaction id- Specified by:
- sendIDocin interface- RfcInterface
- Parameters:
- idoc- IDOC to send
- tid- transaction id
 
 - 
getSapSystemString getSapSystem() Get SAP system Instance- Specified by:
- getSapSystemin interface- RfcInterface
- Returns:
- SAP system Instance
 
 - 
getSapSystemPartitionString getSapSystemPartition() Get Partition of the SAP system- Specified by:
- getSapSystemPartitionin interface- RfcInterface
- Returns:
- partition of the SAP system
 
 - 
getSapClientString getSapClient() Get default client of the SAP system- Specified by:
- getSapClientin interface- RfcInterface
- Returns:
- default client of the SAP system
 
 - 
getSapUserString getSapUser() Get SAP user- Specified by:
- getSapUserin interface- RfcInterface
- Returns:
- SAP user
 
 - 
getSapBusinessKeyBusinessKey getSapBusinessKey() Get business key of the SAP system- Specified by:
- getSapBusinessKeyin interface- RfcInterface
- Returns:
- business key of the SAP system
 
 - 
getISOLanguageString getISOLanguage() Get ISO language of the SAP system- Returns:
- ISO language of the SAP system
 
 - 
getSAPLanguageString getSAPLanguage() Get SAP language of the SAP system- Returns:
- SAP language of the SAP system
 
 
- 
 
-