Preparing Word documents
Save2ERP can only send a document that knows where it must be saved. This information is stored in custom properties of the Word document, which the target system fills in when it generates the document.
The properties
| Property | Required | Purpose |
|---|---|---|
S2E_SystemKey | Yes | Target system, for example P01CLNT100. Must match a system declared in .env (variables SAP_P01CLNT100_…). |
S2E_ObjectType | Yes | Type of the object the document is attached to. |
S2E_ObjectKey | Yes | ID of the object. |
S2E_FileName | No | File name suggested to the user. It takes priority over the Word file name, which may contain a counter added by Windows ("Letter (3).docx"). |
S2E_TemplateId | No | ID of the Word template in the target system: designer mode is offered on this document. |
S2E_LabelsShown | No | Written by Save2ERP, never by the target system: the document shows the tag labels (designer mode) and cannot be saved. |
These properties are not visible to the user in the document. They are kept in the copy created by the "Open a copy" button.
What happens if they are missing
| Situation | Message in the pane |
|---|---|
S2E_SystemKey missing (blank document, made by hand…) | Document not recognized |
System not in .env | Unknown system |
| System declared but incomplete | System misconfigured |
S2E_ObjectType or S2E_ObjectKey missing | Document incomplete, when sending |
Checking a document's properties
In Word for Windows: File › Info › Properties › Advanced Properties › Custom tab. The S2E_… properties and their values are listed there.
For a test, you can also add them by hand in this tab, on any document.
Designer mode
In a Word template whose content comes from the target system, the object's values (customer, address, lines of an offer…) are content controls bound to an XML part of the document. Designer mode replaces these values with the label of each tag ("Customer name", "Offer date"…), so that the template designer can see where each piece of information comes from.
The designer mode icon is shown in the pane, to the right of the system icon and above the gear, if:
- the target system grants the user the template designer permission. This permission is read at sign-in: if it has just been granted, the user must sign out and sign in again;
- the document has the
S2E_TemplateIdproperty.
Clicking the icon shows the labels and the "Designer mode" view: while it is shown, the document can be neither saved nor copied. The "Exit designer mode" button shows the object's values again and returns to the upload view.
A document can never be saved with the labels
While the labels are shown, the document has the S2E_LabelsShown property. Even saved and reopened, it opens on the "Designer mode" view, and saving remains refused until the values are back.
No designer mode in Word on the web
Word on the web does not update the content controls mapped to the document's XML part: it shows them, but does not refresh them when the XML changes. This Microsoft limitation prevents designer mode from working: in Word on the web, the icon is not offered. A document left with the labels opens there on the "Designer mode" view, without an exit button; to show the values again, open it in the Word desktop app.
| Message | Cause |
|---|---|
| Incomplete document | S2E_TemplateId missing, or S2E_ObjectType / S2E_ObjectKey missing to return to the values. |
| Template not recognised | The document does not have the XML part of the template returned by the target system. |
| Designer mode unavailable | The target system does not provide the template service. |
| Display change failed | Refused by the target system (designer permission, access to the object, unknown template…), with its message. |
On the target system side
The target system must fill in these properties when it generates the document, and provide the designer mode services if it offers this mode: see Implementing the services and Target system: SAP.