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: 

ALV Grid - Displaying leading spaces

Former Member
0 Kudos

I've created an ALV Grid which contains one column that is type c 132 lenght. My format on each line of output is different. Some lines I need leading spaces. My internal table has the spaces in it. When I send it to the ALV function module, it gets rid the the leading spaces. Is there a way to display the leading spaces in an ALV Grid?

4 REPLIES 4

Former Member
0 Kudos

HI Matthew,

Use JUST field in the structure SLIS_T_FIELDCAT_ALV which you pass to the Function Module.There are 3 values for JUST.

1) 'R' means the text will be written from right

2) 'L' means the text will be written from left

3) 'C' means the text will be written at Center.

For example..

DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

FIELDCAT_LN LIKE LINE OF GT_FIELDCAT.

Pass it like.

CLEAR FIELDCAT_IN.

FIELDCAT_LN-FIELDNAME = 'MATNR'.

FIELDCAT_LN-TABNAME = 'IT_EKPO'.

FIELDCAT_LN-JUST = 'R'.

APPEND FIELDCAT_LN TO GT_FIELDCAT.

Now pass GT_FIELDCAT to the FM.

Message was edited by: Phani Kiran Nudurupati

Former Member
0 Kudos

Let me clearify a little more. Each record of the layout has 4 to 8 rows. The ALV Grid has 1 column called txt. I've placed spaced(indented) in the front of different rows.

EX.

Row 1) Starts at the first character space

Row 2) skipped 4 character spaces then wrote the text

Row 3) skipped 10 characters spaces then wrote the text

Row 4) skipped 30 characters spaces then wrote the text

Row 5) skipped 2 characters spaces the wrote the text.

I did this to format the report so the user could read it easier. The loved it but now they want it pushed to an ALV grid.

The internal table holds each line with the correct number of spaces. But when I push it to the ALV function module it ignores the leading spaces.

0 Kudos

I had a similar situation and I changed the spaces to a dash.

level 1

-


level 2

-


level3

0 Kudos

i don't know this can be the exact solution just use <b>.</b> and then no. of spaces u want....