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 display leading spaces in left-justified field in ALV?

Former Member
0 Kudos

Hi,

I need to display leading spaces in field which is left-justified in an ALV Grid Display?

Can anybody suggest some idea?

I have tried populating different fields of the field-catalog.

Thanks and regards,

Abhisek Nag

8 REPLIES 8

Former Member
0 Kudos

What field you are trying to add space? what is the purpose of the requirement?

Regards

Karthik D

0 Kudos

The requirement is there is

I need to display the fields like as

ABCD

ABCD

ABCD

The above are the three rows I am talking about.

former_member556412
Active Participant
0 Kudos

Have u checked using

just as 'L' in field catelog.

Regards,

Bhanu

0 Kudos

Hi Bhanu,

are you talking about Left justified...if yes, the field is left-justified only and I need to have the space in the left of the left aligned field.

Former Member
0 Kudos

Hi,

Try the following,

set the output length of the field throught the field catalog and the set the alignedment of the field as right justified, this will give you the field with leading spaces.

Say the filed is of length 10 and the fieldcatalog is named wa_fcat, then for that fiedl set


wa_fcat-outputlen = 10.
wa_fcat-just = 'R'.

Hope this helps.

Regards,

Sachin

venkat_o
Active Contributor
0 Kudos

Hi Abhishek, Use this for fieldcatalog.

wa_fieldcatalog-lzero = 'X'
It displays leading zeros. Thanks Venkat.O

Former Member
0 Kudos

The lzero is for leading zeros,

I need to display leading spaces...

using edit mask I got till this point..

'A

' A

' A

But there remains a initial a character.

chenevier
Member
0 Kudos

Hello, If other people search a solution for this problem, now SAP solved this issue with the OSS note 1834924 and 3102587.

In the fieldcat options, the option 'parameter0' allow to keep the spaces.