cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in printing long text passed from subroutine pool on script.

former_member190818
Active Contributor
0 Kudos

Hi all,

I am trying to print text stored in an internal table that has 132 chars as field length.The internal table contains records such that a single sentence could be stored in more than one record and a sentence may start or end in one record.Also,there are some blank lines which separate different paragraphs stored as records in the internal table.This is available in a subroutine pool and needs to be passed to the script and printed after formatting.

The formatting is to be such that:

1)The sentences should appear on the form such that they should be justified(each sentence should take the same length with automatic adjustment of spaces)

2)The last word should not be truncated at the end of sentence,instead should be printed on the next line.

3)There should be proper spaces maintained as in if a sentence is such that it is in 2 records,when it is printed on script there should be space at the place where the two records are joined and the words should not be combined.

4)The blank lines present in the internal table should appear on the script to separate paragraphs.However,if they are at the beginning or ending of the table they should not appear.

Due to some problems using standard texts,we are not passing to standard text dynamically.Instead we are populating 20 different variables with this data and trying to print the same on the script.However,if we are printing these variables with para format as '=',there are no spaces at places where two parts of a sentence join.To avoid ,this we used rkd_word_wrap and split the sentences into 80 chars each.But in this case,its not printing variables that have blank values as blank lines and also not considering the "BLOCK",justified format when applied to variables.Instead ,it is printing as a single paragraph of text with spaces intact but doesnt seperate multiple paragraphs with blank lines.

Could you suggest some ideas to acheive this?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member190818
Active Contributor
0 Kudos

I have restricted the no. of chars per variable using rkd_word_wrap fn module to 80 chars,as this is the max a variable passed to script from sub-routine is taking.Anything more than this is truncated.

But the problem printing these again is that each variable doesnt cover the entire width of the window as it is supposed to appear and applying "Justify" on variable is not working.Also,wherever there is a blank line stored in a variable,it doesnt print it.

This is the example of internal table contents that I am trying to print...

1 Parking is available at the venue and I would be grateful if you could

2 share travel wherever possible.

3

4 Parking is not available at the venue and I would be grateful if you

5 could share travel wherever possible.

6

7 If you have any special requirements and you have not already advised me

8 of this please let me know. Some of the activities may be slightly

9 physical so you should wear comfortable, casual clothing and low, well-

10 fitting shoes.

The paragraphs should be printed a shown with blank lines in between.Any suggestions?

Former Member
0 Kudos

Hello,

First you need to know how many characters print in a single line, based on that build logic to see what's the next character, if it's space keep the remaining sentence in a vairable which has 132 length.

and for the second line too apply the same thing and put it remaining in the other new vairable and pass them to the script from the external routine and print only if vairables have some data.

I doubt on the formatting of sentences equally.

When you are printing the vairables in script, dont use = as continues line. define the same paragraph format for each vairable one after the other.