Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to fill the blank spaces with dots?

Hi,

i have a text object in my report which is used to display the String that is retrieved from the DB.Now my problem is that at the end of the String i will have to fill it with dots for the last line alone.For example

Patient alcohol history...................

"Patient alcohol History" is the string that i got from the DB.The string can be more than one line also in that case i will have to fill the last line empty spaces with dots.How can i do that

Former Member
Former Member replied

For a single line, and need to pad to 50 characters with dots

@dots

local numbervar n:= 50-length(yourtextfield);

local stringvar name:= yourtextfield;

while n <> 51

do

(name:= name&'.';

n:=n+1;);

name;

For multiple lines you will need to test length eg again sticking with 50 limit on wrapped lines

@dots

If length(yourtextfield) > 100 then

local numbervar n:= 150-length(yourtextfield)

If length(yourtextfield) > 50 then

local numbervar n:= 100-length(yourtextfield)

else

local numbervar n:= 50-length(yourtextfield);

local stringvar name:= yourtextfield;

while n <> 51

do

(name:= name&'.';

n:=n+1;);

name;

Ian

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question