Communication Scenario 466:
Printing – Pull Integration¶
Literature - SAP documentation
Refer to SAP_COM_0466 for further information.
Configure Access to SAP oData Print API¶
Access to SAP oData Print API is provided by seal-cpm-checkin service and configured with the following service keys:
-
SAP_AIR_KEY: The secret key used to access the SAP Application Interfaces. The key is provided by SAP. -
SECRET: The secret used to encrypt the passwords. -
SECRET_FILE: File containing the secret used to encrypt the passwords. -
SAP_SYSTEMS: A JSON or YAML representation of the SAP systems to access, refer to SAP_SYSTEMS below.
Additionally, SAP printer parameters have to be configured in the Output Engine printer configuration.
SAP_SYSTEMS¶
The SAP_SYSTEMS key is a JSON or YAML representation of the SAP systems that are accessed. The key is a list of objects, where each object represents a SAP system. The following keys are used for each object:
Mandatory keys:
-
systemId: Three-letter name of the SAP system, e.g.H22, used for logging purposes and future implementation of scenario SAP_COM_0467: Printing - Notification Integration. -
user: SAP technical user name. -
password: SAP technical user password. Either encrypted usingSECRETorSECRET_FILEor clear text. On how to encrypt passwords, refer to Secure the SAP Logon Data. -
authClientId: oAuth client id, only mandatory for oAuth 2.0 authentication, not used forbasicorcsrfauthentication. -
authClientSecret: oAuth client secret, only mandatory for oAuth 2.0 authentication, not used forbasicorcsrfauthentication.
Optional keys:
-
systemName: Description of the SAP system, replacessystemIdfor logging if given. -
client: Client Id used for the SAP system. -
loginMethod: Method to use for login, possible values arebasic,csrf,oauth, defaultcsrf. -
scenario: The communication scenario to use, possible values are466,467,both, defaultboth. Thebothscenario distinguishes the queues by theOMSType(466, or467) given by the SAP system. -
srvHostPort: Host and port of SAP service in URL format, default ishttps://localhost:50001. -
srvPath: Path to SAP oData Print API service, default is/sap/opu/odata/sap/API_CLOUD_PRINT_PULL_SRV. -
icmInterval: Interval for polling SAP ICM cache, default is5s. -
maxItems: Maximum number of items to fetch from SAP whenitemTransferis set tomulti, default is150. -
waitAfterFetchError: Time to wait after fetch error, default is5s. -
authIssuerUrl: URL to OAuth service, default is${srvHostPort}/oauth/token. -
itemTransfer: Method for transfering document items, possible valuessingleandmulti. Default ismulti. -
notifyTransfer: Method for transfering document status notifications, possible valuessingleandmulti. Default is value fromitemTransfer. -
saveJSON: Iftruesave original JSON document object from SAP as temporary file in the database for debugging purposes. Default isfalse. -
mappings: List of mappings for SAP printer names to OMS printer names. Every entry consists of an object with two properties:-
sap: Name of the queue in SAP. The key is mandatory ifmappingsis present. -
pls: Printer name in PLOSSYS Output Engine. The key is mandatory ifmappingsis present.
-
Examples¶
Example - typical configuration using HTTPS and systemId
SAP_SYSTEMS: |
- systemId: "H22"
user: "technicalUser"
password: "encryptedPassword"
srvHostPort: "https://123.124.125.126:44300"
Connects to https://123.124.125.126:44300, using csrf as login method and the default path to the SAP Cloud Print service. Retrieving print jobs for all printers assigned to user technicalUser.
Example - typical configuration using HTTP and systemName
SAP_SYSTEMS: |
- systemName: "My SAP System"
client: "001"
user: "technicalUser"
password: "encryptedPassword"
srvHostPort: "http://10.100.53.130:50000"
Connects to http://10.100.53.130:50000, using csrf as login method and the default path to the SAP Cloud Print service. Retrieving print jobs for all printers assigned to user technicalUser.
Example - full YAML configuration
SAP_SYSTEMS: |
- systemName: "My SAP System"
client: "001"
loginMethod: "oauth"
user: "username"
password: "encryptedPassword"
authClientId: "cpm-checkin"
authClientSecret: "f042973a-b56c-4ded-8414-7988b8e7bff0"
authIssuerUrl: "https://myidentityprovider:443/oauth/token"
srvHostPort: "http://10.100.53.130:50000"
srvPath: "/sap/opu/odata/sap/API_CLOUD_PRINT_PULL_SRV"
icmInterval: 5s
maxItems: 150
waitAfterFetchError: 10s
itemTransfer: multi
notifyTransfer: multi
saveJSON: true
mappings:
- sap: TEST1
pls: printer4
Example - full JSON configuration
SAP_SYSTEMS: |
[
{
"systemName": "My SAP System",
"client": "001",
"loginMethod": "oauth",
"user": "username",
"password": "encryptedPassword",
"authClientId": "cpm-checkin",
"authClientSecret": "f042973a-b56c-4ded-8414-7988b8e7bff0",
"authIssuerUrl": "https://myidentityprovider:443/oauth/token",
"srvHostPort": "http://10.100.53.130:50000",
"srvPath": "/sap/opu/odata/sap/API_CLOUD_PRINT_PULL_SRV",
"icmInterval": "5s",
"maxItems": 150,
"waitAfterFetchError": "10s",
"itemTransfer": `multi`,
"notifyTransfer": `multi`,
"saveJSON": true,
"mappings": {
"sap": "TEST1",
"pls": "printer4"
}
}
]
Printer Configuration¶
The SAP printer parameters are derived from the Output Engine printer configuration.
-
job overridesare used to disable a parameter or set a single available value. Valid parameter keys for overrides arePRINT_QUALITY,COLOR_MODELandDUPLEX.Example - job override disabling duplex
job: override: DUPLEX: falseExample - job override set duplex to LONG_SIDE
job: override: DUPLEX: LONG_SIDE -
job defaultsare used to set a default value from a fix list of possible values. Valid parameter keys for setting defaults arePRINT_QUALITY,COLOR_MODELandDUPLEX.Example - job default COLOR
job: default: COLOR_MODEL: COLOR -
finisherenables one or more finishing options for print jobs. Available options areSTAPLE,PUNCH,FOLDandSORT.Example - enabling finishing for STAPLE
finisher: ["STAPLE"] -
ppdenables selecting media sizes for the print jobs. The media sizes are read from the spezified PPD file.Example - PPD file
ppd: "small-a4-a3.ppd"The example results in selectable media sizes from ISO_A6 to ISO_A3 in the print job.