Example:Selective zero setting with XML

From prevero Competence Center
Jump to: navigation, search
Last update: 03/2013

Using a definition written in XML (Extensive Markup Language), you can selectively set values to zero in professional planner.

The following criteria can be defined for zero setting:

  • Field reference
  • Source element
  • Period

These three criteria must be defined in XML according to a specific schema. By executing the XML definition, the specified values can be set to zero.


XML definition schema[edit]

The XML definition can only be one line long and must not contain any spaces. In order to give you a better overview of the XML schema, the following figure does not fulfill these requirements.


<root>

<frlist>
<fr id="..."/> or <fr range="...-..."/>
</frlist>

<orglist>
<org id="..."/>
</orglist>

<periodlist>
<period id="..."/>
</periodlist>

</root>


The XML definition is divided into three blocks:

  • In the first block (<frlist>...</frlist>) you can define the field reference you would like to set to zero. You can specify individual field references, as well as field reference segments.
  • In the second block (<orglist>...</orglist>) you specify the OrgID of the element you would like to use as a starting point. This element and all elements hierarchically beneath it are included when setting to zero.
  • In the third block (<periodlist>...</periodlist>) you can specify the period to be set to zero.


To be able to set values to zero in professional planner, this definition must be reformatted:

<root><frlist><fr id="..."/></frlist><orglist><org id="..."/></orglist><periodlist><period id="..."/></periodlist></root>

This XML definition only comprises one line and does not contain any spaces.


Example for an XML definition[edit]

In the following example, we would like to set the field references FR0 (Sales Volume), FR1 (Net Sales), as well as FR101 to FR111 (Rebates, Discounts and Special Selling Costs) to zero, starting with the element with OrgID 2. As a period, the first year in the dataset is specified.

According to these parameters, the following XML definition can be created:

<root>

<frlist>
<fr id="0"/>
<fr id="1"/>
<fr range ="101-107"/>
</frlist>

<orglist>
<org id="2"/>
</orglist>

<periodlist>
<period id="10001"/>
</periodlist>

</root>


In order to be interpreted correctly by professional planner, it must be reformatted to an XML line:

<root><frlist><fr id="0"/><fr id="1"/><fr range ="101-107"/></frlist><orglist><org id="2"/></orglist><periodlist><period id="10001"/></periodlist></root>


Executing the XML definition[edit]

Zero setting using an XML definition can either be carried out via a particular field reference or via a manager.


  • Setting to zero via FR99104: Open a new document and create a SetDat formula with the respective field reference.
SetDat(1;0;0;99104;1)

Switch from edit view to normal view and copy the XML definition onto the field reference. When refreshing the document, this particular field reference overwrites the defined values with zero.


  • Setting to zero via a manager The XML definition can also be executed via a special data import instruction in a manager.