Retrieving Descriptions Using the SAP Command Line Interface

IDoc and schema format descriptions can be obtained either by using the new SapSuiteBuilder interface or with the command line-based tool, CmdlineSAPSuiteBuilder.

This section contains information about retrieving IDoc and schema format descriptions using the SAP Command Line interface. The CmdlineSAPSuiteBuilder is a command line-based tool that is installed when the SAP Suite adapter is installed. The CmdlineSAPSuiteBuilder enables a connection to an SAP system and delivers a particular IDoctype or schema (or its extension) in the form of a data definition format (.ddf) or schema (.xsd) file (see DDF in create mode or XSD in create mode). In List mode, the CMDLineSAPSuiteBuilder delivers a list of either IDocs or schemas from the SAP system to which it is connected. You can then use the .ddf and the .xsd in the Sterling B2B Integrator Map Editor to define your mapping requirements.

To use the utility, you should have a basic knowledge of:

  • Types of IDocs (and their extensions) and RFCs (RFMs) in an SAP system
  • Data formats (.ddf and .xsd)
  • Data mapping concepts
  • Sterling B2B Integrator Map Editor


Based on SAP requirements for retrieving IDocs, the CMDlineSAPSuiteBuilder utility needs particular RFC function calls, including IDOCTYPE_READ_COMPLETE and IDOC_RECORD_READ. Before running the utility, confirm that the necessary RFC function calls are available.

Note: The IDOCTYPE_READ_COMPLETE and IDOC_RECORD_READ RFC function calls are available in SAP release 4.5A (as standard) or 4.0B (with the additional support packages SAPKH40B42 and SAPKH40B48).

Running the Command Line SAPSuiteBuilder Utility

To run the command line SAPSuiteBuilder utility, type one of the following commands:
  • UNIX:

    bin/ <arguments>

  • Windows:

    bin\runSAP3Class.cmd <arguments>

To see the syntax and usage information, type the command without <arguments>, with the following result:
CmdlineSAP3SuiteBuilder (Version 1.3) 
DDF <mode> <DDFBuilder-options>        or 
XSD <mode> <SchemaBuilder-options> 
<mode> ::= -c         create a DDF or XSD file (default) 
|| -l         list IDOCs or RFCs 
usage: <SchemaBuilder-options> - M)andatory or O)ptional - in create mode are: 
-o <outputfilename>     O (name of (XSD)-file to be generated) 
-p <propertyfilename>   M (file with SAP specific properties) 
-r <RFCname>            M (RFCname whose Schema will be extracted)
-w <passwd>             O password to connect to SAP system 
usage: <SchemaBuilder-options> - M)andatory or O)ptional - in list mode are: 
-a <additional arg>     O (used in case of BAPI (M) or RFC (O) ) 
-f <Filterargument>     M (search for a list of BO's, BAPI's or RFC's depending 
                           on searchtype) 
-o <outputfilename>     O (name of (XSD)-file to be generated) 
-p <propertyfilename>   M (file with SAP specific properties) 
-t <searchtype>         M (allowed values: BO or BAPI or RFC) 
-w <passwd>             O password to connect to SAP system 
usage: <DDFBuilder-options> - M)andatory or O)ptional - in create mode are: 
-e <Extension>                    O (CIMtype,  e.g. ZORDERS01) 
-i <IDOCType>                     M (Basictype e.g. ORDERS01) 
-n <No IDoc Version Generation>   O (no IDoc version in records will be generated) 
-o <outputfilename>               O (name of (XSD)-file to be generated) 
-p <propertyfilename>             M (file with SAP specific properties) 
-s <Segment_Release>              O (SAP Release (3 alhpanum. chars, e.g. 40B) ) 
-v <Record Type Vers>             O(allowed values: 2 or 3(default)) 
-w <passwd>                       O password to connect to SAP system 
usage: <DDFBuilder-options> - M)andatory or O)ptional - in list mode are: 
-f <Filterargument>     M (search for a list of IDCOS e.g. ORDERS*) 
-o <outputfilename>     O (name of (XSD)-file to be generated) 
-p <propertyfilename>   M (file with SAP specific properties) 
-s <Segment_Release>    O (SAP Release (3 alhpanum. chars, e.g. 40B) ) 
-w <passwd>             O password to connect to SAP system

There is always a create mode or a list mode for DDF and for XSD. The following examples illustrate how to use the different modes of the command line SAPSuiteBuilder utility.

DDF in create mode

<arguments> =

DDF -c -i ORDERS01 -s 45A -v 3 -p -o orders01.ddf

Create the ddf file orders01.ddf that contains the IDoc structure of the IDOCtype ORDERS01 of segment release 45A and record type version 3. The corresponding SAP-related host and user information are read from the file

The command line SAPSuiteBuilder utility requests the password for the SAP username (field User) as configured in the property file (this is the case in every mode).

In addition, the command line SAPSuiteBuilder program writes to a log file whose name is specified with the token saplogger.logfilename in the property file Its amount of output ranges from only fatal messages to all messages (NONE, FATAL, ERROR, WARN, TIMING, INFO, DEBUG, ALL). Its value depends on the token saplogger.loglevel in the same property file that is common to the SAP Suite adapter package. This logging mechanism is in every mode.

DDF in list mode

<arguments> =

DDF -l -f ORDERS -s 45A -p

Deliver to stdout a list of all IDoctypes (and/or extensions) beginning with the string ORDERS.

XSD in create mode

<arguments> =

XSD -c -r BAPI_MATERIAL_AVAILABILITY-p -o BAPI_Material_Availibility.xsd

Create an XML schema from the RFC BAPI_MATERIAL_AVAILABILITY that, in this case, stands for a particular BAPI of the BusinessObject MATERIAL in the file BAPI_Material_Availibility.xsd. SAP-related properties are read from the file

XSD in list mode

Using this mode, it is possible to filter for RFCs, BAPIs, or BOs, depending on the search type used:
  • Listing of RFCs

    <arguments> =


    List all RFCs beginning with BAPI_SALESORDER_CREATEFROMDAT.

  • Listing of BOs

    <arguments> =

    XSD -l -t BO -f Mat -p

    List all BusinessObjects beginning with the string “Mat.”

  • Listing of BAPIs

    <arguments> =

    XSD -l -t BAPI -a MATERIAL -f Get -p

    List all BAPIs beginning with the string “Get” of the particular BusinessObject Material. Note that BAPIs can only be listed for one particular BusinessObject.

Property File Used by Command Line SAPSuiteBuilder

The property file must be customized before using the utility. Each line in this file should have the following format:

<fieldname> = <value>

The following table describes the possible field names and their default values in the property file:
Note: All mandatory fields have no default value, and therefore have to be set with the correct value. The range for the JCoTraceLevel is undocumented, but the lowest level is 0 (no tracing).
Field Name Default Value Non LB, M or O/LB, M or O Notes/Used Datatype
Gwhost   O IP address or host name
Gwserv   O  
Client   M Three-digit number
User   M Maximum of 12 characters
Lang EN O Exactly two characters
OutboundEncoding UTF-8 O Encoding used during generation of the DDF/schema definitions
Codepage 1100 O Four-digit number
LoadBalanced LB_OFF O If LB_OFF, the fields Ashost and Sysnr are mandatory. If LB_ON, the fields Mshost and R3name are mandatory.
Ashost   M / - If not LoadBalanced: IP address or host name
Sysnr   M / - If not LoadBalanced: Number
Mshost   - / M IP address of message server; if you used field name Ashost, this field is not used.
R3name   - / M SAPSysID
JCoTraceLevel 0 O Range: 0 - 9
JCoTracePath   O  

Error Messages

When the command line SAPSuiteBuilder utility detects errors, the utility writes the errors to either stdout or to the log file associated with sap3logger.logfilename. Typically, errors are written to stdout only if during command-line parsing something was wrong.