Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to align field in the list(Normal) reporting

Former Member
0 Kudos

hi,

I am working on a List(normal) report, which invloves display of cash flow forecast.

The problem pertains to the display part. There are different fields, where in all the fields are of length 8 characters except for one of the fields which is of 12 Characters. Hence, while displaying it in a column, all of them are coming in one aligned manner expcet for that which is of 12 characters. The field which is used which is of 12 characters is HSL01 to HSL16 from the table FAGLFLEXT.

can someone help?

regards,

Ravi

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You will have to handle that special. Take a look at this sample program.



report zrich_0003.


data: one_field(8) type p decimals 2 value '12345.67',
      two_field(12) type p decimals 2  value '12345.67'.


write:/30 one_field.
write:/30 two_field.

skip 3.


write:/<b>38</b> one_field.
write:/30 two_field.

Regards,

Rich Heilman

0 Kudos

Hi

Use Formatting optionswhile writing the values on screen.

I guess you can use LEFT-JUSTIFIED along with your write statements.

_________________________________________________________

... LEFT-JUSTIFIED|CENTERED|RIGHT-JUSTIFIED

Effect

This addition defines whether the output formatted according to the other options is aligned left-justified, centered, or right-justified outside the current output length in the list buffer. Closing blaniks are ignored in the case of fields of the type c and they are treated like the other characters in the case of fields of type string.

The alignment takes place in that the superfluous positions in the list buffer are filled up either right-justified, or left-justified, or alternating right and left. If the output length is not sufficient, the characters are cut off to the right for left-justified and centered, and to the left for right-justified alignment.

If the output length in the list display is not sufficient in Unicode systems, characters are cut off during transfer of data from the list buffer into the list. They are cut off to the right for left-justified, and to the left for right- justified output. In the case of centered output, blanks are removed in alternating fashion on both sides, whereby the cut-off starts on the side with more blanks, and then the other characters on the right side. If, during data transfer from the list buffer into the list, characters are cut off, this is made visible on the left side with the character < and on the right side with the character >.

Example

Output of three literals left, in the middle, and to the right of an output area 60 characters in length.

WRITE: /(60) 'Left' LEFT-JUSTIFIED,

/(60) 'Center' CENTERED,

/(60) 'Right' RIGHT-JUSTIFIED.

_________________________________________________________

Regards

Santosh

Former Member
0 Kudos

DATA: l_field1(8)  TYPE c,
      l_field2(8)  TYPE c,
      l_field3(12) TYPE c.

l_field1 = '12345678'.
l_field2 = 'ABCD'.
l_field3 = '12345ABCDE'.

WRITE:  5 'COL1_HEADING',
       20 'COL2_HEADING',
       35 'COL3_HEADING'.

SKIP 1.

WRITE: l_field1 UNDER 'COL1_HEADING' LEFT-JUSTIFIED,
       l_field2 UNDER 'COL2_HEADING' LEFT-JUSTIFIED,
       l_field3 UNDER 'COL3_HEADING' LEFT-JUSTIFIED.