05-22-2006 4:49 AM
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'
05-22-2006 4:56 AM
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
05-22-2006 5:13 AM
05-22-2006 5:58 AM
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?
05-22-2006 8:01 AM
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....
05-22-2006 7:06 AM
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