How to use placeholders
Tags:
Official product documentation:
Parameterizing Values for Provisioning Templates
You parameterize values in system provisioning templates, to execute templates multiple times with different values.
If you want to parameterize some values in the template, you must replace those values with placeholders. Each time the template is executed, you are asked to provide the actual values, the placeholders will be replaced with.
Prerequisites
- You have exported a system provisioning template.
For more information, see Exporting System Provisioning Templates. - You have identified the variable values that you want to parameterize.
- You have read and comply with SAP Note 2077756.
Procedure
- In the template XML file, add your individual <placeholder> element inside the <placeHolders> element as direct child of the root element <template> as follows:
<template>
<placeHolders>
<placeHolder/>
</placeHolders>
...
</template>
- Define the placeholder with the following attributes:
Attribute | Description |
---|---|
name | Name of the placeholder which replaces the parameterized values in the template XML file.
|
description | Optional The description is used by the person who edits the template. There is no technical meaning. |
value | Optional Default value which is used if nothing else is specified before template execution.
|
For example, we declare the two placeholders PLACEHOLDER-NAME-UPPER and PLACEHOLDER-NAME-LOWER as follows:
<template>
<placeHolders>
<placeHolder name="PLACEHOLDER-NAME-UPPER" description="upper case" value="SID"/>
<placeHolder name="PLACEHOLDER-NAME-LOWER" description="lower case" value="sid"/>
</placeHolders>
...
</template>
- Replace the variable (parameterized) value with the defined placeholder name everywhere the value appears in the template with the same semantic.
For example: If you want to parameterize the target SID of the system, replace all target SID occurrences in the template with a declared placeholder name. This should be done for each value that needs to be changed in future template executions. - You can now import and execute the template.
For more information, see Managing System Provisioning Templates on SAP Help Portal.
Before execution, you are prompted to specify the actual values for the placeholders. Then the placeholder names will be replaced with these values and the process execution will proceed normally.
Figure 1: Dialog prompting the user to enter the actual values for the placeholders before template execution
Execution via WebServices
You can also specify placeholder values when executing templates via WebServices.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:acc="http://xml.sap.com/2007/07/acc">
<soapenv:Header/>
<soapenv:Body>
<acc:executeTemplate>
<TemplateId>template-c295ae08-4f87-11e4-83c4-000000665ce2</TemplateId>
<Properties>
<Properties>
<Name>PLACEHOLDER-NAME-UPPER</Name>
<Value>SID</Value>
</Properties>
</Properties>
</acc:executeTemplate>
</soapenv:Body>
</soapenv:Envelope>
In this case the placeholders are specified as properties in the Properties section of the executeTemplate WebService.