IntegrationsInstall the Command Line Interpreter (CLI)

If you intend to support SAP BC-XOM integrations, then you must install the Loftware Spectrum Command Line Interpreter (CLI) on the SAP Application Server to prepare for Loftware Spectrum® Integration for use with SAP® Applications.

The CLI is a utility that is run by the SAP Spooler when a print job is submitted from SAP ERP. The CLI passes the request to the Loftware Spectrum® Integration for use with SAP® Applications. Spectrum applies the appropriate label template, sends the job to the printer, and then sends the status back to the SAP Spooler.

Note: These steps are required only if you intend to support SAP BC-XOM integrations.

Note: It is strongly recommended that each SAP Application Server be configured with its own CLI and a uniquely named CLI log file.

The following steps should be performed by a SAP Basis Administrator on the SAP Application Server. The configuration for the Loftware Spectrum CLI requires moving files into a folder that the SAP Logical Output Management System (LOMS) instance can access.

Install the Loftware Spectrum Command Line Interpreter

To install the CLI on the SAP Application Server, perform the following steps.

  1. Download the file from the Spectrum Application Server, where spectrum-server is the name of the server hosting Spectrum for your organization:

    http://<spectrum-server>:<port>/downloads/sapClient-package.zip

  2. Extract the contents of the sapClient-package.zip package to the desired folder on the SAP Application Server.

    Note: The CLI can be in any location, as long as the Output Management System (OMS) definition in SAP Spool Administration (SPAD) has the appropriate path in the OMS Submit Command.

  3. Open a Command Prompt window or Terminal, navigate to the folder where you unzipped the files to, and then run the install.cmd or install.sh command.
  4. If your Spectrum Application Server is implemented with SSL, do the following to ensure the SAP CLI can connect to Spectrum:
    1. In your browser, navigate to the Spectrum sign in page.
    2. Follow your browser's instructions to save the SSL certificate to a file.
    3. On the SAP Application Server, navigate to <SAPCLI_HOME>/jre/bin.
    4. Execute the following command:

      keytool -importcert -alias myAlias

      -file \path\to\file\saved\from\browser

      -keystore <SAPCLI_HOME>\jre\lib\security\cacerts

    5. At the prompt for the keystore password, enter changeit.
    6. At the prompt for trusting the certificate, enter yes.
  5. Edit the runcli file as described for your operating system.

    Note: The script output must be only the single output line generated by the sapcli request. This format is dictated by SAP and additional lines are not allowed. The following is an example.
    2.00 4 1 test Print\ request\ accepted\ by\ Loftware\ Spectrum

  6.  Optional: To use the encryptpw utility to encrypt the password parameter in the runcli file, do the following.
    1. Open the encryptpw.cmd_EXAMPLE (Windows Server) or encryptpw.sh_EXAMPLE (Linux) file in a text editor.
    2. Change C:\saptest\ (Windows Server) or /opt/loftware (Linux) to the fully-qualified path to the folder where the sapcli tool is installed.
    3. Replace the parameter -file with the case-sensitive name of the file for which passwords need to be encrypted.
    4. Replace the parameter -field with the case-sensitive name of the password option to encrypt.
    5. Save the file as encryptpw.cmd (Windows Server) or encryptpw.sh (Linux).
    6. Run the script from the command line.
  7. Open the log4j2.xml_EXAMPLE file in a text editor. Change the Property LOG_DIR value C:/saptest to be the explicit directory where the sapcli tool is installed. Save the file as log4j2.xml.

    log4j2.xml_EXAMPLE File

    Copy
    <?xml version="1.0" encoding="UTF-8" ?>
    <!-- 
      Change the Property LOG_DIR value "C:/saptest" to be the explicit directory 
      where the sapcli tool is installed. 
      -->
    <Configuration>
       <!--
            Properties
        -->
        <Properties>
            <!-- http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout -->
            <Property name="PATTERN">[%d{yyyy/MM/dd HH:mm:ss.SSS}][%5p][%c](%t) %m%n</Property>
            <Property name="LOG_DIR">C:/saptest</Property>
        </Properties>

        <!--
            Appenders
            where log messages go to
        -->
        <Appenders>
            <RollingFile name="FILE" fileName="${LOG_DIR}/sapcli.log"
                filePattern="${LOG_DIR}/sapcli.%d{yyyy-MM-dd}-%i.log.gz">
                <PatternLayout pattern="${PATTERN}" charset="UTF-8" />
                <!-- triggering policies -->
                <Policies>
                    <!-- rollover once the file has reached the specified size -->
                    <SizeBasedTriggeringPolicy size="10000KB" />
                </Policies>
                <DefaultRolloverStrategy max="5"/>
            </RollingFile>
        </Appenders>

        <!--
            Loggers
        -->
        <Loggers>
            <Logger name="com.loftware.sapCliClient" level="INFO"/>
            <Root level="ERROR">
                <AppenderRef ref="FILE"/>
            </Root>
        </Loggers>

    </Configuration>
  8. The CLI can be in any location, as long as the Output Management System (OMS) definition in SAP Spool Administration (SPAD) has the appropriate path in the OMS Submit Command. OMS commands should include the required quotation marks, as shown in the following example. For the last parameter, enter RDI, XSF, XML, or XFP as appropriate. For more information, see Configure SAP ERP for BC-XOM Communication.
  9. OMS Submit Example (Windows Server)

    Path: C:\saptest\

    Submit: runcli.cmd http://localhost:8080/spectrum-server/int/sbpj "n=bcxom1" SapTest CIDSDEVLK "PDFDev1" ZZMEDRUCK.rdi DEVPORTSAP01_IDS_03 RDI

    Sending via SSL Example (Windows Server)

    PATH: C:\saptest\

    Submit: runcli.cmd https://localhost:8443/spectrum-server/int/sbpj "n=bcxom1" SapTest CIDSDEVLK "PDFDev1" ZZMEDRUCK.rdi DEVPORTSAP01_IDS_03 RDI

Continue with Configure an SAP User for Spectrum.