Application Development 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: 

ALVGRID: Building a Tree

Former Member
0 Kudos

Hi

I want to build a tree into a ALVGRID. I want to have the header data ( Ekko) on the main row and the details (EKPO) hidden in the tree.

How does one progam a row to hide a a sub row?

3 REPLIES 3

Former Member
0 Kudos

Check sample programs

like BCALV_TREE_DEMO

Former Member
0 Kudos

Hi

I did make a copy of BCALV_TREE_SIMPLE_DEMO deleted the flight tables and moved my own data(ekko) into the tables.

Obviously i don't understand the logic behind this program.

I get the following error.

Runtime errors ETWA_NOT_ASSIGNED

Information on where terminated


The termination occurred in the ABAP program "CL_GUI_ALV_TREE_SIMPLE========CP"   
 in "SET_HIERARCHY_DATA".                                                         
The main program was "ZBCALV_TREE_SIMPLE_DEMO ".                                                                                
The termination occurred in line 13 of the source code of the (Include)           
 program "CL_GUI_ALV_TREE_SIMPLE========CM01G"                                    
of the source code of program "CL_GUI_ALV_TREE_SIMPLE========CM01G" (when         
 calling the editor 130).                                                                                
Source code extract                                                                                
000010   method SET_HIERARCHY_DATA.                                               
000020                                                                            
000030     data: ls_fieldcat type lvc_s_fcat,                                     
000040           ls_new_item type lvc_s_item,                                     
000050           l_data type lvc_value.                                           
000060                                                                            
000070     field-symbols: <f1> type any.                                          
000080     if not is_outtab_line is initial.                                      
000090      loop at mt_fieldcatalog into ls_fieldcat where                       
000100                               tech is initial.                             
000110         assign component ls_fieldcat-fieldname                             
000120                of structure is_outtab_line to <f1>.                        
     >             if not <f1> is initial.                                        

0 Kudos

I've noticed that if i only use one field the report display without errors but i now don't get the line items under one tree.


form build_sort_table.

  data ls_sort_wa type lvc_s_sort.

* create sort-table
  ls_sort_wa-spos = 1.
  ls_sort_wa-fieldname = 'EBELN'.
  ls_sort_wa-up = 'X'.
  ls_sort_wa-subtot = 'X'.
  append ls_sort_wa to gt_sort.

*  ls_sort_wa-spos = 2.
*  ls_sort_wa-fieldname = 'EKGRP'.
*  ls_sort_wa-up = 'X'.
*  ls_sort_wa-subtot = 'X'.
*  append ls_sort_wa to gt_sort.

*  ls_sort_wa-spos = 3.
*  ls_sort_wa-fieldname = 'EKORG'.
*  ls_sort_wa-up = 'X'.
*  append ls_sort_wa to gt_sort.

endform.                               " BUILD_SORT_TABLE