--- sapconf-0.98/sapconf-use-rpm-queryformat	2016-09-01 14:16:56.211178649 +0200
+++ sapconf-0.98/sapconf	2016-09-01 14:22:04.012956102 +0200
@@ -37,12 +37,8 @@
 # GLOBAL Variables
 #
 
-SAPCONF_PACKAGE=`rpm -q sapconf`
-
 export SCRIPTNAME=sapconf
-export SAPCONF_MAJOR_VERSION=$(echo $SAPCONF_PACKAGE | cut -d'-' -f2 | cut -d'.' -f1)
-export SAPCONF_MINOR_VERSION=$(echo $SAPCONF_PACKAGE | cut -d'-' -f2 | cut -d'.' -f2)
-export SAPCONF_BUILD_VERSION=$(echo $SAPCONF_PACKAGE | cut -d'-' -f3 | cut -d'.' -f1)
+export SAPCONF_NAME_VERSION_RELEASE="$(rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}' $SCRIPTNAME)"
 export LOGDIR=/var/log/sap
 export LOGFILE=${LOGDIR}/${SCRIPTNAME}-$(date +"%Y%m%d%H%M").log
 
@@ -852,11 +848,11 @@
      usage
 fi
 
-out "######        ${SCRIPTNAME}-${SAPCONF_MAJOR_VERSION}.${SAPCONF_MINOR_VERSION}-${SAPCONF_BUILD_VERSION}  by Red Hat       ######"
+out "######    $SAPCONF_NAME_VERSION_RELEASE by Red Hat   ######"
 if [ $CHECK_ONLY == 0 ]; then
-        out "###### Preparing System for SAP Installation  ######"
+        out "###### Preparing System for SAP Installation ######"
 else
-        out "###### Checking System for SAP Installation    ######"
+        out "###### Checking System for SAP Installation ######"
 fi
 out ""
 
