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 Tree Column Count

Former Member
0 Likes
1,145

Hi;

i have an alv tree report. in my itab there are 50 columns. when i run the report i can only see 15 columns. is there any column count restriction in alv tree. ? if no why the other columns missing. ?

Thanks everyone

Hi;

i have an alv tree report. in my itab there are 50 columns. when i run the report i can only see 15 columns. is there any column count restriction in alv tree. ? if no why the other columns missing. ?

Thanks everyone

9 REPLIES 9
Read only

Former Member
0 Likes
1,058

Hi,

are these 15 columns key columns,

if yes remove the fieldcat-key = 'X'. for these columns, then you will be able to see the remaining columns by scrolling.

Regards,

Raghavendra

Read only

Former Member
0 Likes
1,058

no only 3 of them key field. the others are <b>type i</b> or <b>type p</b>

Read only

0 Likes
1,058

do you have all the 50 fields in your fieldcatalog,

can you put your code here.

Read only

0 Likes
1,058

sorry i cant put it. because i must connect to another server via vpn. for now i cannot connect.

yes i have 50 columns in my fcat

Read only

0 Likes
1,058

do you have any layout variant set , to show only 15 coloumns in display.

if there any default variant then it will show only those columns which is mentioned in the variant.

Regards

Vijay

Read only

0 Likes
1,058

my code something like this

&----


form init_tree.

perform data_retrival.

perform build_fieldcatalog.

  • create container for alv-tree

data: l_tree_container_name(30) type c,

l_custom_container type ref to cl_gui_custom_container.

l_tree_container_name = 'SCREEN_CONTAINER'.

if sy-batch is initial.

create object l_custom_container

exporting

container_name = l_tree_container_name

exceptions

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

if sy-subrc <> 0.

message x208(00) with 'ERROR'. "#EC NOTEXT

endif.

endif.

  • create tree control

create object tree1

exporting

parent = l_custom_container

node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple

item_selection = SPACE

no_html_header = ''

no_toolbar = ''

exceptions

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

illegal_node_selection_mode = 5

failed = 6

illegal_column_name = 7.

if sy-subrc <> 0.

message x208(00) with 'ERROR'. "#EC NOTEXT

endif.

  • create Hierarchy-header

data l_hierarchy_header type treev_hhdr.

perform build_hierarchy_header changing l_hierarchy_header.

  • create info-table for html-header

data: lt_list_commentary type slis_t_listheader,

l_logo type sdydo_value.

perform build_comment using

lt_list_commentary

l_logo.

  • repid for saving variants

data: ls_variant type disvariant.

ls_variant-report = sy-repid.

  • create emty tree-control

call method tree1->set_table_for_first_display

exporting

is_hierarchy_header = l_hierarchy_header

it_list_commentary = lt_list_commentary

i_logo = l_logo

i_background_id = 'ALV_BACKGROUND'

i_save = 'A'

is_variant = ls_variant

changing

it_outtab = gt_empty "table must be emty !!

it_fieldcatalog = gt_fieldcatalog.

  • create hierarchy

perform create_hierarchy.

call method tree1->COLUMN_OPTIMIZE.

endform. " init_tree

&----


*& Form build_fieldcatalog

&----


FORM build_fieldcatalog .

DATA ls_fcat type lvc_s_fcat .

data : pt_fcattemp TYPE slis_t_fieldcat_alv,

lt_fcattemp TYPE SLIS_FIELDCAT_ALV.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'GT_VBRK'

i_inclname = sy-repid

CHANGING

ct_fieldcat = pt_fcattemp[]

EXCEPTIONS

OTHERS = 3.

LOOP AT pt_fcattemp into lt_fcattemp.

move-CORRESPONDING lt_fcattemp to ls_fcat.

move lt_fcattemp-seltext_m to ls_fcat-coltext.

append ls_fcat to gt_fieldcatalog.

ENDLOOP.

loop at gt_fieldcatalog into ls_fcat.

case ls_fcat-fieldname.

when 'VBELN'.

ls_fcat-no_out = 'X'.

when 'FKIMG'.

ls_fcat-do_sum = 'X'.

endcase.

modify gt_fieldcatalog from ls_fcat.

endloop.

ENDFORM. " build_fieldcatalog

but its not the real code

Read only

Former Member
0 Likes
1,058

hi

good

debug the program than check your field catalogue, i hope theer must be some problem.

go to se38

give BCALV*

put f4, you ll find some ALV program related to tree , test them and change your program accordlingly.

thanks

mrutyun^

Read only

Former Member
0 Likes
1,058

thanks everyone i am going to check my code again and come back for result.

thanks again.

Read only

0 Likes
1,058

Hi Mustafa,

use clear ls_fcat.

loop at gt_fieldcatalog into ls_fcat.

case ls_fcat-fieldname.

when 'VBELN'.

ls_fcat-no_out = 'X'.

when 'FKIMG'.

ls_fcat-do_sum = 'X'.

endcase.

modify gt_fieldcatalog from ls_fcat.

clear ls_fcat.

endloop.