‎2010 Jul 12 3:10 PM
Hi gurus i have a problem i have created a dinamic internal table but the lenght of the internal table fields is 10 i need longer fields
here is my code thanks
data: begin of it_campos OCCURS 0,
campo1(12) type c,
END OF it_campos.
do n times.
clear nocamptmp.
add 1 to incont.
CONDENSE incont NO-GAPS.
cont = incont.
CONCATENATE nocamp cont into nocamptmp.
wa_campos-campo1 = nocamptmp.
append wa_campos to it_campos.
enddo .
loop at it_campos into wa_campos.
t_fieldcat_wa-col_pos = SY-TABIX.
t_fieldcat_wa-fieldname = wa_campos-campo1.
APPEND t_fieldcat_wa TO t_fieldcat.
endloop .
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fieldcat
IMPORTING
ep_table = tabla
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
others = 2.
ASSIGN tabla->* TO <l_table>.
CREATE DATA ep_line LIKE LINE OF <l_table>.
all is fine but the fields of <l_table> are char(10) and my data is longer than 10 how can i increase the lenght of the table fields
any idea thanks
‎2010 Jul 12 3:17 PM
Thanks i solved by myself i just modify the outputlenght field in the field catalog before use the cl_alv_table_create=>create_dynamic_table
‎2010 Jul 12 3:35 PM
Modify the fieldcatalog accordingly for e.g.,
LOOP AT it_campos INTO wa_campos.
t_fieldcat_wa-col_pos = sy-tabix.
t_fieldcat_wa-fieldname = wa_campos-campo1.
t_fieldcat_wa-inttype = 'C'. " Character Type
t_fieldcat_wa-intlen = '50'. "50 character length
APPEND t_fieldcat_wa TO t_fieldcat.
ENDLOOP .BR,
Suhas