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 display problem

Former Member
0 Kudos

Hi,everyone!

How can I display the leading space in ALV grid? It seems that alv always truncate the leading space of the string when displaying it. such as ' abced' will be displayed as 'abcde'

5 REPLIES 5

Former Member
0 Kudos

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

check it....may be work...

If you have set s_alv_layout_cat-colwidth_optimize to 'X' then remove it .

Message was edited by: kishan negi

Former Member
0 Kudos

Hi,kishan,your approach doesn't work.

and Mrutyunjaya,I don't find any hint in the material that you showed to me.

Does anybody know the better way?

0 Kudos

hi

u ve to check what data type u r passing for the field

characters doesnt show leading zeroes

however numeric does..

just chec in dbug mode

n try to see the result with changed datatype..

thanks....

Former Member
0 Kudos

Hii

In the export parameters of function REUSE_ALV_GRID_DISPLAY you will be passing a structure (for example s_alv_layout_cat)to is_layout.

If you have set s_alv_layout_cat-colwidth_optimize to 'X' then remove it .

If this doesnt solve, can u paste that part of your code

you can as well try <b>REUSE_ALV_HIERSEQ_LIST_DISPLAY</b>

Regards

Naresh