XSF and XML Format Reference for SAP BC-XOM Integrations
From the perspective of SAP ERP, Spectrum acts as an Output Management System (OMS). SAP ERP sends the data for a request in Raw Data Interface (RDI), XML for Smart Forms (XSF), XML for Interactive Forms by Adobe (XFP), or other XML. You can configure the data with values for Spectrum-specific names to override default values.
The OMS Submit command invokes the CLI to pass XSF or XML data to an SAP BC-XOM integration in Spectrum.
XSF or XML data can have one or more smartxsf
elements, each of which maps directly to a Smart Form. A smartxsf
element has two components:
- The Header contains information about the device, such as the device type and form name.
- The Data contains the content to be printed.
A new label will occur on smartxsf and data elements. Header fields from the parent smartxsf element will be copied into the field map when a new data element triggers a new label.
Custom Stylesheet
A custom stylesheet can be configured for incoming XSF or XML requests. If a custom stylesheet is not configured for an integration, Spectrum uses a built-in stylesheet to transform XSF into XML (LPS). XML must be in XML (LPS) format, or a custom stylesheet must be specified to transform the XML to XML (LPS). If you are creating a custom stylesheet, it is recommended that you use the Spectrum XSF stylesheet template as a starting point. To view the XSF stylesheet template, enter the following in the address field of your browser, where spectrum-server
is the name of the server hosting Spectrum for your organization:http://spectrum-server:8080/downloads/sap-smartforms.xsl.template
To implement the options configured in the General, SAP, and Advanced panels in a custom stylesheet for XSF, XML, or XFP, include the following parameters.
<!--
PrinterName is passed in by the parser, and comes from the Spectrum SAP CLI.
If there is no printer specified in the data header or an override field,
this value is used.
Other parameters are integration options.
-->
<xsl:param name="PrinterName" select="''"/>
<xsl:param name="SpoolId" select="''"/>
<!-- ExtendedFieldNames will contain the separation character for true,
and empty string or 'false' for false. Default is '/'.
'/' or '_' = true, '' or 'false' = false
-->
<xsl:param name="ExtendedFieldNames" select="'/'"/>
<xsl:param name="IncludeAuditData" select="'true'"/>

general/form
is used for document ID unless an override field is present for this form.general/output-device
is used for the Spectrum output device unless an override field is present for this form.general/tdcopies
is used for the Spectrum quantity value unless an override field is present for this form.general
is used to add all general sub elements to the data map.
Example XSF
<header>
<general>
<version>1.14.2</version>
<form>SF_XSF_DEMO1</form>
<language>EN</language>
<device>PRINTER</device>
</general>
</header>
Example XML (LPS) after Transform
<variable name="header/general/version">1.14.2</variable>
<variable name="header/general/form">SF_XSF_DEMO1</variable>
<variable name="header/general/language">EN</variable>
<variable name="header/general/device">PRINTER</variable>
Note: In an SAP BC-XOM integration, you can configure the Use Extended Field Names to Refer to RDI or XSF Data Records option to control whether only the symbol name is needed to refer to an XSF data record or whether the window and element names must also be used in the reference.

The following XSF data elements will map directly to Spectrum data refs Data reference. The data source used to populate a field with a value. An Input Data Ref is the data source from which a Prompt field obtains data. by the value of their
name
attribute:
sym
text
include-text
If a data element is a descendent of a table
, a suffix "_N
" will be added to the field name, where N
is the implicit row number within that table group.

You can use the following field names to override values in XSF and XML headers. Spectrum override fields are expected to occur as text
elements with the appropriate corresponding name
attribute value. Before you can do so, you must configure these names in SAP ERP and incorporate them into an ABAP program or SAPscript.
Field Name | Value |
---|---|
LW_PRINTERNAME |
Device name (Alias) of the selected device. |
LW_JOBNAME |
The name for a specific job in Spectrum. |
LW_TRAY |
|
LW_QUANTITY |
|
LW_DUPLICATES |
Important! For XSF, XFP, and XML, the XML (LPS) processor subtracts 1 from the LW_DUPLICATES value. For RDI, the LW_DUPLICATES value is used as is. |
LW_LABEL |
The label template to use with a job. |
LW_PAGES |
|
LW_INLINE_DOCUMENT |
Required for printing external files. Print an external file, such as a PDF, without associating the file with label template. |
LW_INLINE_TYPE |
Required for printing external files. The list of supported external file types. For example, INLINE_PDF. |
LW_LABEL_RANGES |
A set of comma delimited label ranges to reprint in a multi-label or quantity reprint. When printing external files, this is the range of pages to print. An asterisk is a wildcard value that resolves to the last label printed. |
LW_PAGE_HANDLING |
The page handling for imaged files. Maintains aspect ratios. ACTUAL_SIZE: Do not increase or decrease the image size on the page. Default value. FIT: Increase or decrease the image size as appropriate to fit the page. INCREASE: Increase the image size of undersized images only to fit the page. DECREASE: Decrease the image size of oversized images only to fit the page. CUSTOM: Increase or decrease the image size as specified in !PAGE_CUSTOM!. |
LW_PAGE_CUSTOM |
Required if !PAGE_HANDLING! is CUSTOM. For imaged files, the percentage as an integer value to increase or decrease the image size on the page. A value greater than 100 will increase the image size, and a value less than 100 will decrease the image size on the page. Can be used when printing external files. Default: 100. |
LW_FORCE_IMAGE |
When printing external files, whether to force the file to print as an imaged file. TRUE: An external file is imaged regardless if the target device is configured and supports the !INLINE_TYPE! natively. FALSE: Default value. |
LW_TARGET_MEDIA_HEIGHT |
Required if !PAGE_HANDLING! is not CUSTOM. For imaged files, the height of the target media size in thousandths of an inch (mils), unless specified otherwise in !TARGET_MEDIA_UNITS!. |
LW_TARGET_MEDIA_WIDTH |
For imaged files, the width of the target media size in thousandths of an inch (mils), unless specified otherwise in !TARGET_MEDIA_UNITS!. |
LW_TARGET_MEDIA_UNITS |
The target unit of measurement. Can be used when printing external files. INCHES: Thousandths of an inch (mils). Default value. CM: Centimeter. MM: Millimeter. |
Example XSF
<window name="INFO" page="FIRST" page-id="001">
<text name="LW_PRINTERNAME" style="SF_XSF_DEMO1" appmode="append" lang="EN">
<p name="AS">XSFOVERRIDE</p>
</text>
...

The name
attribute of the sym
, text
, and include-text
elements will be used in the following way for extended field names:
sym
:window_text_sym
orwindow_include-text_sym
text
andinclude-text
:window_text
andwindow_include-text
Example XSF
<window name="FOOTER" page="FIRST" page-id="001">
<text name="URL" style="SF_XSF_DEMO1" objname="SF_XSF_DEMO_URL" lang="EN">
<p name="AS">Visit our Web site: <a href="http://www.sap.com">www.sap.com</a>
<url>www.sap.com</url>
</p>
</text>
<include-text name="FOOTER_INCL" style="SAPADRS" objname="ADRS_FOOTER" id="ADRS"
object="TEXT" language="EN" client="820">
<p name="SG"/>
</include-text>
</window>
Example XML (LPS) after Transform
<variable name="FOOTER_URL">Visit our Web site: www.sap.com www.sap.com</variable>
<variable name="FOOTER_FOOTER_INCL"/>

- Header sub elements:
page
,archive
- Data sub elements:
graphics
,address
Note:
Window
is only used for extended field names. Its descendenttext
,include-text
, andsym
elements will be processed. - Formatting fields, however
table
is used to add row index suffixes to table row data