FAQ: TFORMer SDK
How Can I Interface from SAP to TFORMer?
How Can I Interface from SAP to TFORMer?
For interfacing to SAP® you have three options (all need some ABAP coding):
TFORMer TFPrint
TFPrint is a command line utility, which creates a print job based upon TFORMer templates. You call TFPrint from within SAP and pass the template file name, the CSV or XML data file name and the target printer in the command line arguments.
tfprint -F "C:\Templates\LogisticLabel.tff" -D "C:\JobData\20220927_ID1022.csv" -DT TEXT –DO SC; -O MyPrinterName -OT WIN32In ABAP you can use FM SXPG_COMMAND_EXECUTE and the commands maintained in SM69 transaction to run any external scripts. If you want to have a log for troubleshooting, you could redirect TFPrint stdout/stderr to a status file (time stamped with Job ID). If you want to process status/error messages in SAP you could read back the status file after printing.
If you want to isolate/disconnect the printing process from the App Server, you can run TFPrint on another server (Print Server) via Remote Shell Execute.
- Invoke-Command: Running Remote Commands - PowerShell | Microsoft Learn
- PSExec: PsExec - Windows Sysinternals | Microsoft Learn
We recommend to encapsulate the whole printing into a PowerShell or CMD script, this script then can be called from anywhere. Data may be passed and/or Templates may be updated via shared folder; a scheduled cleanup script can remove old job and status files (after nn days).
- TFPrint is part of the TFORMer SDK and uses an SDK license.
- For creating the label/report templates you need a TFORMer Designer license.
- ABAB Coding efforts are low. Remote shell execution needs a proper security setup.
TFORMer Web Service
On request we offer a WCF based web service which provides the TFORMer API in a SOAP (WSDL) compatible format. You can print to all printers available on the server (or remotely) or just create a PDF which is returned to the caller (byte array).
The label templates are stored in a specific directory on the server (App_Data), only the label data is submitted in the SOAP request. Templates could be updated externally by sharing the templates folder or using a file sync tool, which distributes templates from a central folder or master repository. The SOAP response provides full error information, which can be handled by ABAP or just stored in a log for trouble-shooting.
We deliver the service as source code and as precompiled web deploy package. You can host the service in your own infrastructure (Windows server / IIS).
- In the standard version there is no login mechanism, but the source code (.NET C#) can be freely extended. For external users you should only allow https and use IP whitelisting (feature in IIS).
For accessing the web service from within SAP ABAP you may want to create a proxy and a service consumer – here is a tutorial/guide:
- Consume SOAP Based Web Services with SAP BTP, ABAP Environment | Tutorials for SAP Developers
- Generating Proxies | SAP Help Portal
- How to configure a Service Consumer - ABAP Connectivity - Support Wiki (sap.com)
After installation the WSDL can be retrieved from the following URL
http://yourhostname/yourinstallationpath/TFORMer.asmx?WSDL
We don’t have an ABAP sample for consuming (calling) the web service, but the included Test App (C# .NET source code) shows how to fill the request parameters. It can be also used for testing the web service availability/functionality.
- The web service is based upon TFORMer SDK and uses an SDK license.
- For creating the label/report templates you need a TFORMer Designer license.
- ABAB Coding efforts are a bit higher – you need the integrate the SOAP web service calls (proxy class). Once the web service is setup, the solution should run flawlessly.
TFORMer Server
TFORMer Server provides automatic label printing by monitoring specific (adjustable) directories for new job files. The job files are in a proprietary text format or XML format and contain the template to use, the target printer name and the name value pairs (records) for the data fields. The templates are organized in a repository, which is read either from a local or a shared (external) folder. If monitoring a directory is not suitable, you can also pass jobs via a telnet interface or a periodical ODBC query.
The server maintains “spools”, where you see the job files on a per printer basis. You can reprint selected jobs from a spool or stop and continue a spool. Once the job file is imported, the jobs are maintained in the server and managed by either a browser interface or a dedicated “Spool Admin” App. By default there is no status feedback to SAP, except with the telnet/ODBC interface. Unicode is supported by XML files, all other channels use ANSI ASCII or Latin-1.
Please contact us for the demo version and the installation and user manuals.
- TFORMer Server uses its own license, which is printer/site based.
- For creating the label/report templates you need a TFORMer Designer license.
- As long as it’s just writing the data file, the effort for ABAP programming is manageable. On the other hand, this solution needs more knowledge (security setup, how to handle specific error codes, etc) and more user training.