Generating a document using the dox42 Integration for SAP® Solutions

Prev Next

Learn how to generate your first document using the dox42 Integration for SAP® Solutions.

Steps

  1. Execute the transaction /CADAXO/D42_CUST in order to open the Integration.

  2. Go to the dox42 Server node and ensure that at least one dox42 Server is defined. If no server is defined, see the system requirements.

  3. On YourServer, store the ‘HelloWorld.docx’ template in the folder of the dox42 Server installation, for example:dox42Server/templates/HelloWorld/HelloWorld.docx

    Note

    • The ‘HelloWorld.docx’ template is supplied with the dox42 Integration for SAP® Solutions. It is a simple Word document containing just a single line of text: <Screenshot HelloWorld.docx>

    • Remember the path where you stored the template, as it will be needed in the next step.

  4. Configure the path to the template in the Template Path subnode:

    Parameter

    Description

    Logical system

    Logical system ID of your SAP system.
    If both dox42 Server and dox42 Online are used within the same logical system, the template path can be differentiated using the dox42 Server ID.

    Template Path

    Folder path on the dox42 Server where the templates are stored.

    • Template paths must begin with “/”. This refers to the root directory of the dox42 Server installation. For example:
      /templates/HelloWorld/

    Active

    Set your Template Path as active by selecting the checkbox.

  5. Configure the template in the Templates node:

    Parameter

    Requirement

    Description

    Template Id

    mandatory

    Identification used for internal purposes only. In this case:

    • HELLO_WORLD

    Template Name

    mandatory

    Name of the template file stored on the dox42 Server. In this case:

    • HelloWorld.docx

    dox42 Server ID

    mandatory

    Choose a dox42 Server as defined in the dox42 Server node

    Operation

    mandatory

    Choose what kind of document will be generated. In this case:

    • GENDOC - Generate Document

    Active

    mandatory

    Set your template as active by selecting the checkbox.

  6. Make sure your newly configured template is selected in the Templates node.

  7. Configure the ReturnAction in the ReturnAction subnode:

    Parameter

    Requirement

    Description

    ReturnAction Id

    mandatory

    Identifier for internal use. In this case:

    • RETURN_ACTION1

    Default

    optional

    When checked, this ReturnAction is set to default.

    Format

    mandatory

    Defines how the generated document should be returned. In our case:

    • doc (the document will be returned in a DOC file format)

    Active

    optional

    Set your configuration as active by selecting the checkbox.

  8. You can now generate your first ‘Hello World’ document. In order to do so,

    1. go back to SAP,

    2. create a Z_HELLO_WORLD report (e.g., as a local object: $TMP) and

    3. execute the following code:

      REPORT Z_HELLO_WORLD.
      
      TRY.
        " Create a dox42 template instance with Template ID 'HELLO_WORLD'
        DATA(dox42_template) = /cadaxo/cl_d42_manager=>create_template_instance( 'HELLO_WORLD' ).
      
        " Create a document instance
        DATA(dox42_document) = dox42_template->create_document( ).
      
      CATCH /cadaxo/cx_d42_rest_api INTO DATA(lx_error).
        WRITE: lx_error->get_text( ).
        RETURN.
      ENDTRY.
      
      " Display the document in SAP GUI
      dox42_document->display_gui( ).
      

Result

You have successfully generated your first document and returned it to your SAP system.

© dox42 2026. All rights reserved.