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

Length

Former Member
0 Likes
650

hi all,

i have an ALV report, while executing in background one of the field length is 40 but it is displaying till 15 only.

the field is ktext from aufk table.

the code is as below

loc_count = loc_count + 1.

ls_fieldcat-fieldname = 'KTEXT'.

ls_fieldcat-tabname = 'GT_LINE_ITEM1'.

ls_fieldcat-seltext_l = 'Int Order Descr'.

ls_fieldcat-outputlen = 40.

ls_fieldcat-col_pos = loc_count.

APPEND ls_fieldcat TO gt_fieldcat.

CLEAR ls_fieldcat.

please suggest how to get field length as 40 while executing in background.

thanks in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
616

Hi,

use layout-colwidth_optmize = 'X'.

rgds,

bharat.

Read only

0 Likes
616

hi ,

where do we need to pass this please help

layout-colwidth_optmize = 'X'.

Read only

0 Likes
616

HI,

like this.



TYPE-POOLS SLIS.
DATA:LAYOUT TYPE slis_layout_alv.

layout-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
 EXPORTING
   I_CALLBACK_PROGRAM             = SY-REPID
   IS_LAYOUT                      = LAYOUT
   IT_FIELDCAT                    = FCAT
  TABLES
    T_OUTTAB                       = ITAB.

rgds,

bharat.

Read only

Former Member
0 Likes
616

Use databse tabname instead of internal table as shown.

loc_count = loc_count + 1.

ls_fieldcat-fieldname = 'KTEXT'.

ls_fieldcat-tabname = 'AUFK'.

ls_fieldcat-seltext_l = 'Int Order Descr'.

ls_fieldcat-outputlen = 40.

ls_fieldcat-col_pos = loc_count.

APPEND ls_fieldcat TO gt_fieldcat.

CLEAR ls_fieldcat.

Regards,

Anil.