\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{afterpage}
\usepackage{makeidx}
\usepackage{repeatindex}

\makeindex

\textheight6cm%

\begin{document}

Hallo
\index{P01}%
\index{P01!U01}%
\index{P01!U02}%
\index{P01!U03}%
\index{P01!U04}%
\index{P01!U05}%
\index{P01!U06}%
\index{P01!U07}%
\index{P01!U08}%
\index{P01!U09}%
\index{P01a}%
\index{P01a!U10}%
\index{P01b}%
\index{P01b!U11}%
\index{P01b!U12}%
\index{P01b!U13}%
\index{P01b!U14}%
\index{P01b!U15}%
\index{P01b!U16}%
\index{P01b!U17}%
\index{P01b!U18}%
\index{P01b!U19}%
\index{P01b!U20}%
\index{P01b!U21}%
\index{P01b!U22}%
\index{P01b!U23}%
\index{P01b!U24}%
\index{P01b!U25}%
\index{P01b!U26}%
\index{P01b!U27}%
\index{P01b!U28}%
\index{P01b!U29}%
\index{P02}%
\index{P02!U01}%
\index{P02!U02}%
\index{P02!U03}%
\index{P02!U04}%
\index{P02!U05}%
\index{P02!U06}%
\index{P02!U07}%
\index{P02!U08}%
\index{P02!U09}%
\index{P02!U10}%
\index{P02!U11}%
\index{P02!U12}%
\index{P02!U13}%
\index{P02!U14}%
\index{P02!U15}%

\printindex
\end{document}
