SAP Knowledge Base Article - Public

2352610 - Position Management: Automatic Generation of Position Code


How do you automatically generate position codes?

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.


Employee Central - Position Management


If you want system to generate position codes, you have to define a sequence and then use this sequence in a business rule.


Setting Up the Number Sequence:

You can create a sequence in Manage Data as following:

  1.  Go the Company Processes and Cycles portlet in the Admin Center and choose Employee Files -> Manage Sequence.
  2.  In the resulting screen, choose Create New Sequence, then make these entries:
    • An external name and an external code.
    • The number at which the sequence should start — in the example below, 1. Note that this number cannot be zero or a minus number, such as —1.
    • How big each step should be. In the example, this is also 1 below, meaning that the first number in the sequence was 1, the second 2, and so on.
  •  - In the example, notice that this sequence has already reached 62. This means that the next object created in the relevant sequence will have number 62.



Creating the Rule:

Now you can create a business rule with Position as the base object as the following:

  • The If condition must be as shown below. DO NOT set position code = Automatic.
  • In the Then condition, you can use the sequence object and the text template to set the external code. In the example above, the external codes will be generated as Position1, Position2, and so on. To enter a text, choose Text and make the entry you need, like the text Position_%d shown above.
  • For the template, you can use the Format String Syntax from Java. If, for example, your sequence starts with 1, but the code for the postion will always be an 8-digit number starting with 1 and filled with zeros, you would use this pattern: 1%07d.

  • According to the above business rule, all position codes will be in the format: Position_seqCurrentNumber.The format can be adapted as per business requirement.


Adding Rule to Position Object Definition:

  • This rule should be added to saveRules in Rules section of Position object's definition. 


  • Note:
    Please do not set the Position Code on an initializeRules. This is not supported.

Position External Code:

  • The Position code field, should be set to read only on the Position Object Definition.
  • Finally, you need to set the Is the Position External Code Auto Generated? to Yes in Position Management Settings


For further information please refer to the Position Management implementation handbook on the SAP Help site.

See Also


position management, employee central, ec, automatic code, generate, position, code, position code , KBA , LOD-SF-EC-POS , Position Management , LOD-SF-EC , Employee Central , How To


SAP SuccessFactors Employee Central all versions