
en el blog Servicio de impresión SAP, marcus berg ha introducido BTP SAP Print Service. En mis siguientes 2 blogs, presentaré cómo configurar, cómo probar y cómo usarlo en UI5. hay mision Agregue etiquetas de impresión a su experiencia de usuario para SAP S/4HANA Cloud.en el que se ha presentado en detalle una extensión de S4Hana Cloud en paralelo para la impresión de etiquetas. Configurar el servicio de impresión es una gran parte de esto. También puede encontrar información detallada en la misión.
has instalado cartero en tu ordenador .
Para hacer esto, el rol de administrador de subcuenta debe asignarse a su usuario. Si no puede encontrar los siguientes 3 planes de servicio de impresión, comuníquese con su gerente de éxito del cliente de BTP.
En este paso, creará instancias de servicio para el remitente y el destinatario del plan. Se crearán claves de servicio para el remitente y el destinatario del plan. Para llevar a cabo este paso, puede usar Refuerzo desde la cabina BTP en la cuenta global. El receptor del plan se utiliza para cargar documentos y crear tareas de impresión. El remitente del plan será utilizado por el administrador de impresión en la nube para conectarse.
Puedes seguir el documento para crear una suscripción al servicio de impresión.
Para la configuración de la autorización, puede seguir los siguientes documentos:
Definición y agrupación de roles
Asignación de colecciones de roles a usuarios
Configuración de la colección de roles
Anote la información en el marco rojo.
{
"info": {
"_postman_id": "43b9377d-9355-4e0b-bd4f-044c9deb6d9d",
"name": "print",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Step1 Get Token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.collectionVariables.set(\"bearToken\",\"Bearer \".concat(pm.response.json().access_token))"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "{{printclientsecret}}",
"type": "string"
},
{
"key": "username",
"value": "{{printclientkey}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "default"
}
]
},
"url": {
"raw": "{{printtokenurl}}",
"host": [
"{{printtokenurl}}"
]
}
},
"response": []
},
{
"name": "Step2 Get PrintQ",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.collectionVariables.set(\"printQ\",pm.response.json()[0].qname)"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"pm.request.addHeader(\"Authorization\",pm.collectionVariables.get(\"bearToken\"));"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "clientId",
"value": "{{printclientkey}}",
"type": "string"
},
{
"key": "accessTokenUrl",
"value": "{{printtokenurl}}",
"type": "string"
},
{
"key": "grant_type",
"value": "client_credentials",
"type": "string"
},
{
"key": "clientSecret",
"value": "{{printclientsecret}}",
"type": "string"
},
{
"key": "tokenName",
"value": "printkey",
"type": "string"
},
{
"key": "addTokenTo",
"value": "header",
"type": "string"
},
{
"key": "scope",
"value": "",
"type": "string"
},
{
"key": "tokenType",
"value": "Bearer",
"type": "string"
},
{
"key": "client_authentication",
"value": "header",
"type": "string"
},
{
"key": "password",
"value": "Guoq07@5",
"type": "string"
},
{
"key": "username",
"value": "jacky.liu02@sap.com",
"type": "string"
},
{
"key": "headerPrefix",
"value": "Bearer",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "{{printserviceurl}}/qm/api/v1/rest/queues",
"host": [
"{{printserviceurl}}"
],
"path": [
"qm",
"api",
"v1",
"rest",
"queues"
]
}
},
"response": []
},
{
"name": "Step3 Upload Document",
"event": [
{
"listen": "test",
"script": {
"exec": [
"if(pm.response.to.have.status(201)){",
" pm.collectionVariables.set(\"dmId\",pm.response.text());",
" pm.collectionVariables.set(\"fileName\",pm.request.body.formdata.all()[0].src.split(\"/\").last());",
"}",
" "
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept-encoding": true,
"connection": true,
"accept": true
}
},
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "string"
},
{
"key": "client_authentication",
"value": "header",
"type": "string"
},
{
"key": "clientId",
"value": "{{printclientkey}}",
"type": "string"
},
{
"key": "accessTokenUrl",
"value": "{{printtokenurl}}",
"type": "string"
},
{
"key": "clientSecret",
"value": "{{printclientsecret}}",
"type": "string"
},
{
"key": "tokenName",
"value": "printkey",
"type": "string"
},
{
"key": "addTokenTo",
"value": "header",
"type": "string"
},
{
"key": "scope",
"value": "",
"type": "string"
},
{
"key": "tokenType",
"value": "Bearer",
"type": "string"
},
{
"key": "password",
"value": "Guoq07@5",
"type": "string"
},
{
"key": "username",
"value": "jacky.liu02@sap.com",
"type": "string"
},
{
"key": "headerPrefix",
"value": "Bearer",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "If-None-Match",
"value": "*",
"type": "default"
},
{
"key": "scan",
"value": "true",
"type": "default"
},
{
"key": "Accept",
"value": "application/json",
"type": "default"
},
{
"key": "DataServiceVersion",
"value": "2.0",
"type": "default"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file",
"type": "file",
"src": "/Users/I501000/Downloads/q4.jpg"
}
]
},
"url": {
"raw": "{{printserviceurl}}/dm/api/v1/rest/print-documents",
"host": [
"{{printserviceurl}}"
],
"path": [
"dm",
"api",
"v1",
"rest",
"print-documents"
]
}
},
"response": []
},
{
"name": "Step4 Create Print Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"pm.collectionVariables.get(\"dmId\");"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "string"
},
{
"key": "client_authentication",
"value": "header",
"type": "string"
},
{
"key": "clientId",
"value": "{{printclientkey}}",
"type": "string"
},
{
"key": "accessTokenUrl",
"value": "{{printtokenurl}}",
"type": "string"
},
{
"key": "clientSecret",
"value": "{{printclientsecret}}",
"type": "string"
},
{
"key": "tokenName",
"value": "printkey",
"type": "string"
},
{
"key": "addTokenTo",
"value": "header",
"type": "string"
},
{
"key": "scope",
"value": "",
"type": "string"
},
{
"key": "tokenType",
"value": "Bearer",
"type": "string"
},
{
"key": "password",
"value": "Guoq07@5",
"type": "string"
},
{
"key": "username",
"value": "jacky.liu02@sap.com",
"type": "string"
},
{
"key": "headerPrefix",
"value": "Bearer",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "If-None-Match",
"value": "*",
"type": "default"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"numberOfCopies\": 1,\n \"username\": \"test user\",\n \"qname\": \"{{printQ}}\",\n \"metadata\": {\n \"business_metadata\": {\n \"business_user\": \"user1\",\n \"object_node_type\": \"object_node_1\"\n },\n \"version\": 1.2\n },\n \"printContents\": [\n {\n \"objectKey\": \"{{dmId}}\",\n \"documentName\": \"{{fileName}}\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{printserviceurl}}/qm/api/v1/rest/print-tasks/{{dmId}}",
"host": [
"{{printserviceurl}}"
],
"path": [
"qm",
"api",
"v1",
"rest",
"print-tasks",
"{{dmId}}"
],
"query": [
{
"key": "itemId",
"value": "2349add8-d48e-46ee-91d6-e7bb98cfdbff",
"disabled": true
}
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "printtokenurl",
"value": "https://apjcoe-x66183k9.authentication.eu10.hana.ondemand.com/oauth/token",
"type": "default"
},
{
"key": "printclientkey",
"value": "sb-6aa6869e-be85-4b6f-b2345|print-app!b46384",
"type": "default"
},
{
"key": "printclientsecret",
"value": "Dwsj8LMo=",
"type": "default"
},
{
"key": "printserviceurl",
"value": "https://api.eu10.print.services.sap",
"type": "default"
},
{
"key": "dmId",
"value": "",
"type": "default"
},
{
"key": "fileName",
"value": ""
},
{
"key": "printQ",
"value": ""
},
{
"key": "bearToken",
"value": ""
}
]
}
solo mantenga las variables en el marco rojo.
Podemos encontrar la tarea de impresión creada en la siguiente captura de pantalla.
¡Gracias por tu tiempo!
¡Saludos!
Jacky Liu
Calle Eloy Gonzalo, 27
Madrid, Madrid.
Código Postal 28010
Paseo de la Reforma 26
Colonia Juárez, Cuauhtémoc
Ciudad de México 06600
Real Cariari
Autopista General Cañas,
San José, SJ 40104
Av. Jorge Basadre 349
San Isidro
Lima, LIM 15073