Application Development and Automation 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: 
Read only

ALV DISPLAY WIDTH PROBLEM

Former Member
0 Likes
929

Hi

my internal table is

DATA: BEGIN OF IT_LFA1 OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

NAME1 LIKE LFA1-NAME1,

END OF IT_LFA1.

i am displaying this table with REUSE_ALV_LIST_DISPLAY.

field catelog is like

F_WA_LFA1-FIELDNAME = 'LIFNR'.

F_WA_LFA1-TABNAME = 'IT_LFA1'.

F_WA_LFA1-SELTEXT_L = 'VENDOR NO'.

APPEND F_WA_LFA1 TO F_LFA1.

F_WA_LFA1-FIELDNAME = 'NAME1'.

F_WA_LFA1-TABNAME = 'IT_LFA1'.

F_WA_LFA1-SELTEXT_L = 'VENDOR NAME'.

APPEND F_WA_LFA1 TO F_LFA1.

Here only 10 characters of vendor name are displayed.

How to display the complete name lfa1-name1

I dont want take static lenth like

F_WA_LFA1-outputlen = <b>some fixed number</b>

rather;

F_WA_LFA1-outputlen = <b>length of it_lfa1-lifnr</b>

Regards,

MB

Message was edited by:

M B

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
893

Set the parameter COLWIDTH_OPTIMIZE in the layout structure to 'X'. The column width will be adjusted to the contents.

Manoj

8 REPLIES 8
Read only

Former Member
0 Likes
893

Hi

U can force the output length:

F_WA_LFA1-FIELDNAME = 'NAME1'.

F_WA_LFA1-TABNAME = 'IT_LFA1'.

F_WA_LFA1-SELTEXT_L = 'VENDOR NAME'.

<b>F_WA_LFA1-OUTPUTLEN = 35. <----


</b>

APPEND F_WA_LFA1 TO F_LFA1.

Max

Read only

0 Likes
893

like this

fcat-fieldname = 'WA2'.

fcat-key = 'X'.

<b> fcat-outputlen = '40'.</b>

fcat-just = 'L'.

fcat-seltext_m = ' CNF-TECO'.

Regards

Prabhu

Read only

Former Member
0 Likes
893

HI,

IF wa_fieldcat-fieldname = 'NAME1'.

wa_fieldcat-col_pos = '1'.

<b> wa_fieldcat-outputlen = 20.</b> this will be the display length

MODIFY i_fieldcat FROM wa_fieldcat.

ENDIF.

Read only

Former Member
0 Likes
893

hi,

add this :

F_WA_LFA1-outputlen = 13.

regards,

keerthi

Read only

Former Member
0 Likes
893

ifieldcat-outputlen = 40.

regards

shiba dutta

Read only

Former Member
0 Likes
893
DATA: BEGIN OF IT_LFA1 OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
END OF IT_LFA1.

F_WA_LFA1-FIELDNAME = 'LIFNR'.
F_WA_LFA1-TABNAME = 'IT_LFA1'.
F_WA_LFA1-SELTEXT_L = 'VENDOR NO'.
APPEND F_WA_LFA1 TO F_LFA1.

F_WA_LFA1-FIELDNAME = 'NAME1'.
F_WA_LFA1-TABNAME = 'IT_LFA1'.
F_WA_LFA1-SELTEXT_L = 'VENDOR NAME'.
F_WA_LFA1-SELTEXT_M = 'VENDOR NAME'.
F_WA_LFA1-OUTPUTLEN = specify teh length of name1.
APPEND F_WA_LFA1 TO F_LFA1.

Refer http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm

Hope this helps.

Read only

Former Member
0 Likes
894

Set the parameter COLWIDTH_OPTIMIZE in the layout structure to 'X'. The column width will be adjusted to the contents.

Manoj

Read only

Former Member
0 Likes
893

Hi,

use <fieldcatalog>-colwidth_optimize = 'X'.this will optimize the length automatically depending on the text.