This documentation outlines the process and requirements for integrating SAP S/4 HANA with InterFormNG2, a solution for managing digital forms and output. It is essential to note that there are multiple approaches and methods for system integration, and this documentation highlights some of the feasible options.
Adobe Document Service (ADS) is configured
RFC Connection Configuration
InterFormNG2 installed (Prerequisites)
InterFormNG2 Version 3.5.1 or later is recommended.
The workflow must be created with the "REST webservice basic" input component to process the SAP requests.
The integration between SAP S/4 HANA and InterFormNG2 comprises two
essential processes:
Outbound - Transmitting data/requests from SAP S/4 HANA to
InterFormNG2.
Inbound - Receiving data, such as PDF previews, from InterFormNG2 to SAP S/4 HANA.
The integration with InterFormNG2 is primarily achieved through webservice communication. SAP S/4 HANA initiates a webservice request to an InterFormNG2 workflow. Subsequently, InterFormNG2 processes the XML request and converts it into the desired output format (e.g., PDF, PCL, or ZPL) based on the configured conditions.
InterFormNG2 can then either return the generated document (e.g.,
sending a response with the PDF for previewing) or directly output the
documents to various destinations, such as physical printers, emails,
or storage as PDFs.
SAP ABAP sends a SOAP request to the InterFormNG2 workflow.
The InterformNG2 workflow looks at the request data to decide if
this should be processed by InterFormNG2 or should be re-routed to
ADS.
a. If the decision is to process it in InterFormNG2: The
InterFormNG2 workflow creates a PCL or PDF document (or both),
base64 encodes the created document
and the generates a SOAP response containing the base64 encoded
document. The response must be in the same format as
ADS responses and use “text/xml” as content type (set using the
“Set MIME type” workflow component).
b. If the
decision is to process it in ADS: The InterFormNG2 workflow
sends the original SOAP request XML to ADS using the
“Forward webservice” workflow component.
ADS sends a SOAP response back to InterFormNG2.
A SOAP response is returned to SAP. In the (a) case, the response
generated by InterFormNG2, in the (b) case, the one received as
response from ADS.
Open ABAP Editor (Transaction SE38)
<xsl:param name="Base64"/>
*----------------------------------------------------------------------*
* Report FP_TEST_03
*----------------------------------------------------------------------*
* Printing of documents using PDF based forms
*----------------------------------------------------------------------*
PROGRAM fp_test_03.
INCLUDE fp_utilities. "#EC INCL_OK
DATA carr_id TYPE sbook-carrid.
SELECTION-SCREEN BEGIN OF BLOCK s_data WITH FRAME TITLE text-100.
PARAMETER p_custid TYPE scustom-id DEFAULT 12.
SELECT-OPTIONS s_carrid FOR carr_id DEFAULT 'AA' TO 'ZZ'.
SELECTION-SCREEN END OF BLOCK s_data.
SELECTION-SCREEN BEGIN OF BLOCK s_form WITH FRAME TITLE text-101.
PARAMETER: p_form TYPE fpwbformname DEFAULT 'FP_TEST_03_TABLE',
p_langu TYPE spras DEFAULT 'D',
p_countr TYPE land1 DEFAULT 'DE' MATCHCODE OBJECT
h_t005_land,
p_ia TYPE fpinteractive,
p_norm TYPE fppdfnorm DEFAULT if_fp_pdf_norm=>default
MODIF ID nrm.
SELECTION-SCREEN END OF BLOCK s_form.
SELECTION-SCREEN BEGIN OF BLOCK s_jobp WITH FRAME TITLE text-103.
PARAMETER p_jobp TYPE fpjobprofile MODIF ID jpr.
SELECTION-SCREEN END OF BLOCK s_jobp.
SELECTION-SCREEN BEGIN OF BLOCK s_conn WITH FRAME TITLE text-102.
PARAMETER p_conn TYPE rfcdest OBLIGATORY.
SELECTION-SCREEN END OF BLOCK s_conn.
DATA go_fp TYPE REF TO if_fp.
DATA go_pdf_obj TYPE REF TO if_fp_pdf_object.
DATA gx_fpex TYPE REF TO cx_fp_runtime.
DATA gt_profiles TYPE tfpjobprofile.
DATA: customer TYPE scustom,
bookings TYPE ty_bookings,
connections TYPE ty_connections,
fm_name TYPE rs38l_fnam,
fp_docparams TYPE sfpdocparams,
fp_outputparams TYPE sfpoutputparams,
error_string TYPE string.
INITIALIZATION.
MOVE cl_fp=>get_ads_connection( ) TO p_conn.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'JPR'.
TRY.
IF cl_fp_feature_test=>is_available(
iv_connection = p_conn
iv_feature = cl_fp_feature_test=>gc_job_profiles )
= abap_true.
CONTINUE.
ENDIF.
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage. "#EC NO_HANDLER
ENDTRY.
screen-active = 0.
MODIFY SCREEN.
CLEAR p_jobp.
ENDIF.
IF screen-group1 = 'NRM'.
* TRY.
* IF cl_fp_feature_test=>is_available(
* iv_connection = p_conn
* iv_feature = cl_fp_feature_test=>gc_render_pdfa1 )
* = abap_true.
* CONTINUE.
* ENDIF.
* CATCH cx_fp_runtime_internal
* cx_fp_runtime_system
* cx_fp_runtime_usage. "#EC NO_HANDLER
* ENDTRY.
* screen-active = 0.
* MODIFY SCREEN.
* CLEAR p_norm.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_jobp.
TRY.
IF cl_fp_feature_test=>is_available(
iv_connection = p_conn
iv_feature = cl_fp_feature_test=>gc_job_profiles )
= abap_true.
* Get job-profiles list from the ADS.
go_fp = cl_fp=>get_reference( ).
go_pdf_obj = go_fp->create_pdf_object( connection = p_conn ).
gt_profiles = go_pdf_obj->get_job_profiles( ).
* Show the value-help popup.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'NAME'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_JOBP'
value_org = 'S'
TABLES
value_tab = gt_profiles.
ENDIF.
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage. "#EC NO_HANDLER
ENDTRY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_conn.
PERFORM value_help_for_destination USING 'P_CONN'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_norm.
PERFORM value_help_for_pdfnorm USING 'P_NORM'.
START-OF-SELECTION.
* Get data.
SELECT SINGLE * FROM scustom INTO customer WHERE id = p_custid.
IF customer IS INITIAL.
MESSAGE ID 'AD' TYPE 'E' NUMBER '718' WITH 'SCUSTOM'.
ENDIF.
SELECT * FROM sbook INTO TABLE bookings
WHERE customid = p_custid
AND carrid IN s_carrid
ORDER BY PRIMARY KEY.
IF bookings[] IS NOT INITIAL.
SELECT * FROM spfli INTO TABLE connections FOR ALL ENTRIES IN bookings
WHERE carrid = bookings-carrid
AND connid = bookings-connid
ORDER BY PRIMARY KEY.
ENDIF.
* Print data:
* First get name of the generated function module.
TRY.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = p_form
IMPORTING
e_funcname = fm_name.
CATCH cx_fp_api_repository cx_fp_api_usage cx_fp_api_internal.
MESSAGE ID 'FPAPIGENERIC' TYPE 'E' NUMBER '000' WITH p_form.
ENDTRY.
* Set output parameters and open spool job.
fp_outputparams-preview = abap_true.
fp_outputparams-connection = p_conn.
fp_outputparams-pdfnorm = p_norm.
IF p_jobp IS NOT INITIAL.
TRY.
IF cl_fp_feature_test=>is_available(
iv_connection = p_conn
iv_feature = cl_fp_feature_test=>gc_job_profiles )
= abap_true.
fp_outputparams-job_profile = p_jobp.
ENDIF.
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage INTO gx_fpex.
PERFORM error USING gx_fpex.
ENDTRY.
ENDIF.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = fp_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc IS NOT INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Set form language and country (->form locale).
fp_docparams-langu = p_langu.
fp_docparams-country = p_countr.
fp_docparams-fillable = p_ia.
* Now call the generated function module.
CALL FUNCTION fm_name
EXPORTING
/1bcdwb/docparams = fp_docparams
customer = customer
bookings = bookings
connections = connections
** IMPORTING
** /1bcdwb/formoutput =
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc IS NOT INITIAL.
CALL FUNCTION 'FP_GET_LAST_ADS_ERRSTR'
IMPORTING
e_adserrstr = error_string.
IF error_string IS NOT INITIAL.
* We received a detailed error description.
MESSAGE error_string TYPE 'E'.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
* Close spool job.
CALL FUNCTION 'FP_JOB_CLOSE'
** IMPORTING
** e_result =
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc IS NOT INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*&---------------------------------------------------------------------*
*& Form value_help_for_pdfnorm
*&---------------------------------------------------------------------*
* Get PDFNorm.
*----------------------------------------------------------------------*
* <--P_NORM
*----------------------------------------------------------------------*
FORM value_help_for_pdfnorm USING p_norm TYPE dynfnam.
TYPES: BEGIN OF lty_norm,
pdfnorm type FPPDFNORM,
END OF lty_norm.
STATICS st_norm TYPE STANDARD TABLE OF lty_norm WITH KEY pdfnorm.
*
* fill internal table st_norm with PDFnormion
data wa like line of st_norm.
clear st_norm.
TRY.
IF cl_fp_feature_test=>is_available(
iv_connection = p_conn
iv_feature = cl_fp_feature_test=>gc_pdfa_ext )
= abap_true.
wa-pdfnorm = '' ##no_text. append wa to st_norm.
wa-pdfnorm = 'PDF' ##no_text. append wa to st_norm.
wa-pdfnorm = 'PDF/A-1' ##no_text. append wa to st_norm.
wa-pdfnorm = 'PDF/A-1B' ##no_text. append wa to st_norm.
wa-pdfnorm = 'PDF/A-2B' ##no_text. append wa to st_norm.
wa-pdfnorm = 'PDF/A-3B' ##no_text. append wa to st_norm.
elseif cl_fp_feature_test=>is_available(
iv_connection = p_conn
iv_feature = cl_fp_feature_test=>gc_render_pdfa1 )
= abap_true.
wa-pdfnorm = '' ##no_text. append wa to st_norm.
wa-pdfnorm = 'PDF' ##no_text. append wa to st_norm.
wa-pdfnorm = 'PDF/A-1' ##no_text. append wa to st_norm.
else.
wa-pdfnorm = '' ##no_text. append wa to st_norm.
wa-pdfnorm = 'PDF' ##no_text. append wa to st_norm.
endif.
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage. "#EC NO_HANDLER
ENDTRY.
* Show the value-help popup.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'EXTENSION'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = p_norm
value_org = 'S'
TABLES
value_tab = st_norm.
ENDFORM. "value_help_for_pdfnorm
Choose connection ADS (RFC-Connection for the
InterForm-Server must be configured in advance).
Choose output device and storage mode archive only.
Click on Print Preview.
SAP sends the xml-request to InterForm, which will
return the PDF for previewing.
1_generate_resp2.xsl
2_ng2txp_sap_bookings (1).zip
3_sap_extract_pdf.xsl
4_remove_namespaces.xsl
5_ng2wfxp_SapTest_workflow_clouddemo
(1).zip
There is also the possibility to integrate with InterFormNG2 by enabling data transmission from SAP S/4 HANA to InterFormNG2 via the customization of print programs to generate XML files, which will be sent through a new RFC connection. The process and requirements are similar to the replacement of ADS, though the communication is only between S/4 and InterFormNG2.
The RFC connection is maintained in transaction SM59. When configuring the RFC destination, select Connection Type G - HTTP Connection to External Server. In the RFC destination parameters, provide the IP and port details of the InterForm web service. Additionally, specify the InterForm service user in the Logon & Security tab. Note that specific details like IP, port, InterForm user, and certificate will be defined during the installation of the InterForm server.
Certificate via STRUST: If the connection utilizes HTTPS, you may
need the certificate of the InterForm server.
InterFormNG2 installed (Prerequisites)
InterFormNG2 Version 3.x or later is recommended.
The workflow must be created with the "REST webservice basic" input component to process the SAP requests.
The integration between SAP S/4 HANA and InterFormNG2 comprises two essential processes:
Outbound - Transmitting data/requests from SAP S/4 HANA to InterFormNG2.
Inbound - Receiving data, such as PDF previews, from InterFormNG2 to
SAP S/4 HANA.
The integration with InterFormNG2 is primarily achieved through webservice communication. SAP S/4 HANA initiates a webservice request to an InterFormNG2 workflow. Subsequently, InterFormNG2 processes the XML request and converts it into the desired output format (e.g., PDF, PCL, or ZPL) based on the configured conditions.
InterFormNG2 can then either return the generated document (e.g.,
sending a response with the PDF for previewing) or directly output the
documents to various destinations, such as physical printers, emails,
or storage as PDFs.
This example illustrates how to send an XML request via a webservice to InterFormNG2. Please keep in mind to customize your S/4 environment to send similar XML-requests to InterForm.
Send xml-request via webservice to the endpoint (In this
example we just use an easy html-file which does the
same job).
InterForm will return the PDF to the same endpoint
6_ng2txp_ZSD_X_SALES_DOCUMENT_V2_STANDARD.zip
7_ng2wfxp_webservice_input_workflow.zip
8_webservice.html
S/4-BC-XOM offers an open and versatile interface to integrate external output management systems (OMS) with the SAP S/4HANA spool system, allowing you to connect the SAP spool system with an OMS.
We recommend to get familiar with the SAP Printing Guide: SPA Printing Guide (BC-CCM-PRN).
In SAP, InterFormNG2 can be configured as an eXternal Output
Management System (XOM). For this to work, an OMS command must be
configured in SAP with the SPAD transaction. See more details
here: Defining OMS Command Set for LOMS.
The attached shell script must be placed in the file system on the
SAP ABAP server.
#! /bin/bash
# Argument 1 is path and filename (&F)
docpath=$1
# Argument 2 is copies (&C)
copies=$2
# Argument 3 is name of OMS (&Er)
oms=$3
# Argument 4 is the ID of the SAP system (&Es)
sapid=$4
# Argument 5 is SAP spool id (&EI)
spoolid=$5
# Argument 6 is reply message group (&EG)
msggroup=$6
encoded=$(base64 $docpath)
# Generate uuid, then cut it off at 20 chars since this is max for SAP uid
uuid=$(uuidgen)
uid=${uuid:0:20}
# Construct the XML input for InterFormNG2
xmldoc="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<sapxom>
<sapid>$sapid</sapid>
<oms>$oms</oms>
<spoolId>$spoolid</spoolId>
<msgGroup>$msggroup</msgGroup>
<uid>$uid</uid>
<doc>$encoded</doc>
<doctype>PDF</doctype>
<copies>$copies</copies>
</sapxom>"
# Call the InterFormNG2 workflow
statuscode=$(curl -s -u sapconn:sapconnpw
-X POST
-H 'Content-type: application/xml'
--write-out %{http_code}
--output /dev/null
-d "$xmldoc"
https://clouddemo.interform400.com/basicws/sapxom)
if [[ "$statuscode" -ne 200 ]] ; then
# Error
echo 2.00 1 1 - Error code $statuscode
else
# Success
echo 2.00 4 1 $uid
fi
For the XOM callback, a SAP connection must be configured in
InterFormNG2 settings.
InterFormNG2 installed (Prerequisites)
InterFormNG2 Version 3.5.1 or later is required. A license for
the module is needed.
SAPConnector-3.5.1-ngmodule.jar must be added to the modules
folder: C:\Program Files\InterFormNG2\modules → Please restart
the service afterwards → Please reach out to InterForm in order
to obtain this file.
Two library files are required for the XOM part. According
to SAP license terms we cannot distribute these libraries,
so you must download the libraries from SAP Java Connector The files are sapjco3.jar and sapjco3.dll (if you run NG2 on
Windows, for Linux/IBMi it will be sapjco3.so instead of the dll).
These must be placed in the InterFormNG2 libext folder.
A workflow must be created in InterFormNG2 with the “REST webservice basic” input component. The username and password used for the workflow must be set in the shell script (on the curl command, after -u). The workflow should have the path set as “sapxom”. If another path is used, the shell script must be updated (the URL on the curl command). A callback from InterFormNG2 to SAP is needed when the workflow completes. This requires configuration of a SAP connection in InterFormNG2 (see below).
When all has been configured, InterFormNG2 can act as external
output management system for SAP. The procedure is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<sapxom>
<sapid>A4H</sapid>
<oms>INTERFORM</oms>
<spoolId>000002160400015</spoolId>
<msgGroup>CA4HINTERF</msgGroup>
<uid>840e250a-831c-4a4e-8</uid>
<doc>BASE64_DOCUMENT_DATA</doc>
<doctype>PDF</doctype>
<copies>1</copies>
</sapxom>
The shell script sends a REST webservice request to the InterFormNG2
workflow.
In the workflow, the “uid” field from the input XML can
be used as log info key.
The workflow should as soon as possible
send a response to SAP (i.e. before doing any actual processing). This
can for instance be done using the workflow component “First in, first
out queue” with the wait strategy set to “Return”. (Another option would be to save the input XML to the file system and
then end the workflow. Another workflow can then pick up the file from
the file system.)
A response is returned from the workflow, completing the shell script execution.
<?xml version="1.0" encoding="UTF-8"?>
<sapxom>
<sapid>A4H</sapid>
<oms>INTERFORM</oms>
<spoolId>000002160400015</spoolId>
<msgGroup>CA4HINTERF</msgGroup>
<uid>840e250a-831c-4a4e-8</uid>
<doc>BASE64encodedPDF</doc>
<doctype>PDF</doctype>
<device>PRINTER01</device>
<copies>1</copies>
</sapxom>
As of January 13, 2025, we are excited to announce that our new Help Center is in the final stages of development. While the Knowledge Base is already accessible, our current JIRA system will continue to manage support tickets during this transition period. For assistance with InterForm Output Management Software, please refer to the Support for InterForm Output Management Software.
We appreciate your patience and understanding as we work to enhance your support experience. If you have any questions or encounter any issues, please do not hesitate to reach out via the existing support channels.
Best regards,
The InterForm Support Team