Update regarding KOMA-Script version 3.28:
Redefine \raggedsection
and \sectionlinesformat
to center the section titles including the numbers:
\documentclass[numbers=noenddot]{scrbook}
%\providecommand*\Ifstr{\ifstr}% needed up to and including KOMA-Script version 3.27, see https://komascript.de/faq_deprecatedif
\usepackage{blindtext}
\let\raggedsection\centering
\let\raggedchapter\raggedright
\renewcommand\sectionformat{Section~\thesection:\enskip}
\renewcommand\subsectionformat{Subsection~\thesubsection:\enskip}
\renewcommand\subsubsectionformat{Subsubsection~\thesubsection:\enskip}
\renewcommand*\sectionlinesformat[4]{#3#4}
\DeclareTOCStyleEntry[
dynnumwidth,
entrynumberformat=\entrywithprefix{Sect.}
]{default}{section}
\DeclareTOCStyleEntry[
dynnumwidth,
entrynumberformat=\entrywithprefix{Subs.}
]{default}{subsection}
\DeclareTOCStyleEntry[
dynnumwidth,
entrynumberformat=\entrywithprefix{Subsubs.}
]{default}{subsubsection}
\newcommand*\entrywithprefix[2]{%
\def\autodot{}%
\mbox{#1\,#2:}%
}
\begin{document}
\tableofcontents
\chapter{First chapter}
\blindtext
\section{First section}
\blindtext
\subsection{a rabbit subsection with quite a few words to make it
extra long not only because ducks are so cute}
\Blindtext
\blinddocument
\end{document}
Original answers (2015):
You could redefine \raggedsection
, \raggedchapter
and \othersectionlevelsformat
(for version 3.17 or newer see the update below):
\let\raggedsection\centering
\let\raggedchapter\raggedright
\renewcommand\othersectionlevelsformat[3]{%
\ifstr{#1}{section}{Section~#3:\enskip}{%
\ifstr{#1}{subsection}{Subsection~#3:\enskip}{%
#3\autodot\enskip}}}
To centr the section and subsection titles including the numbers use
\makeatletter
\addtokomafont{section}{\let\@hangfrom\relax}
\addtokomafont{subsection}{\let\@hangfrom\relax}
\makeatother

If the entries in the table of contents should also be changed redefine \addsectiontocentry
and \addsubsectiontocentry
additionally:
\renewcommand\addsectiontocentry[2]{%
\ifstr{#1}{}{%
\addtocentrydefault{section}{}{#2}}{%
\addtocentrydefault{section}{Sect.\,#1:}{#2}}}
\renewcommand\addsubsectiontocentry[2]{%
\ifstr{#1}{}{%
\addtocentrydefault{subsection}{}{#2}}{%
\addtocentrydefault{subsection}{Subs.\,#1:}{#2}}}
To get more space for the numbers you could enlarge the tocnumwidth
for section
and subsection
(needs the up to date KOMA-Script version 3.15)
\RedeclareSectionCommand[tocnumwidth=5em]{section}
\RedeclareSectionCommand[tocnumwidth=5.5em]{subsection}

Code:
\documentclass[numbers=noenddot]{scrbook}
\usepackage{blindtext}
\let\raggedsection\centering
\let\raggedchapter\raggedright
\makeatletter
\addtokomafont{section}{\let\@hangfrom\relax}
\addtokomafont{subsection}{\let\@hangfrom\relax}
\makeatother
\renewcommand\othersectionlevelsformat[3]{%
\ifstr{#1}{section}{Section~#3:\enskip}{%
\ifstr{#1}{subsection}{Subsection~#3:\enskip}{%
#3\autodot\enskip}}}
\renewcommand\addsectiontocentry[2]{%
\ifstr{#1}{}{%
\addtocentrydefault{section}{}{#2}}{%
\addtocentrydefault{section}{Sect.\,#1:}{#2}}}
\renewcommand\addsubsectiontocentry[2]{%
\ifstr{#1}{}{%
\addtocentrydefault{subsection}{}{#2}}{%
\addtocentrydefault{subsection}{Subs.\,#1:}{#2}}}
\RedeclareSectionCommand[tocnumwidth=5em]{section}
\RedeclareSectionCommand[tocnumwidth=5.5em]{subsection}
\begin{document}
\tableofcontents
\chapter{First chapter}
\blindtext
\section{First section}
\blindtext
\subsection{a rabbit subsection with quite a few words to make it
extra long not only because ducks are so cute}
\Blindtext
\blinddocument
\end{document}
Update regarding \othersectionlevelsformat
and KOMA-Script Version 3.17 or newer
Note that KOMA-Script Version 3.17 uses \sectionformat
, \subsectionformat
etc. instead \othersectionlevelsformat
. So you have to redefine this commands instead of \othersectionlevelsformat
\renewcommand\sectionformat{Section~\thesection:\enskip}
\renewcommand\subsectionformat{Subsection~\thesubsection:\enskip}
If the code should work with both the older versions (3.15 and 3.16) and version 3.17 or newer you can use
\renewcommand\othersectionlevelsformat[3]{%
\ifstr{#1}{section}{Section~#3:\enskip}{%
\ifstr{#1}{subsection}{Subsection~#3:\enskip}{%
#3\autodot\enskip}}}
\providecommand*\sectionformat}{}
\providecommand*{\subsectionformat}{}
\renewcommand\sectionformat{Section~\thesection:\enskip}
\renewcommand\subsectionformat{Subsection~\thesubsection:\enskip}
\let\raggedsectin\centering