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: 

Hierarchical display of data

Former Member
0 Kudos
75

Hi All,

I want to display header data & after single record of header

record corresponding item details to be displayed.

What i have to use for that. Is it possible with ALV GRID.

Please Give me reply

5 REPLIES 5

Former Member
0 Kudos
44

Hi,

Use the ALV function module REUSE_ALV_HIERARCHIAL_LIST_DISPLAY.

Refer to program's for hierarchial list display in standard codes BCALV*

Thanks & Regards

Jeyagopi

Former Member
0 Kudos
44

U have to use..

Fm: REUSE_ALV_HIERSEQ_LIST_DISPLAY.

Regards.........

Former Member

Former Member
0 Kudos
44

Hi,

You can use ALV Hierarchical Display to view the Header and Item Details.

DATA:s_layout TYPE slis_layout_alv,

t_fieldcat TYPE slis_t_fieldcat_alv,

s_fieldcat LIKE LINE OF t_fieldcat,

s_event TYPE slis_alv_event,

t_events TYPE slis_t_event,

s_keyinfo TYPE slis_keyinfo_alv.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

i_callback_program = l_repid

is_layout = s_layout

it_fieldcat = t_fieldcat

i_save = 'X'

it_events = t_events

i_tabname_header = 'T_VBAK'

i_tabname_item = 'T_VBAP'

  • I_STRUCTURE_NAME_HEADER =

  • I_STRUCTURE_NAME_ITEM =

is_keyinfo = s_keyinfo

TABLES

t_outtab_header = t_vbak

t_outtab_item = t_vbap

EXCEPTIONS

program_error = 1

OTHERS = 2

Thanks,

Asif Ali Khan

Former Member
0 Kudos
44

hi

good

  • Add following code to 'STATUS_0100'(PBO module)

----


  • Create ALVtree Hierarchy

PERFORM create_alvtree_hierarchy.

  • Add following code to 'Z......F01' INCLUDE

----


&----


*& Form CREATE_ALVTREE_HIERARCHY

&----


  • text

----


  • Builds ALV tree display, (inserts nodes, subnodes etc)

----


form create_alvtree_hierarchy.

DATA: NODE LIKE MTREESNODE,

ld_node type string.

LOOP AT it_ekko INTO wa_ekko.

  • Build the node table.

  • Caution: The nodes are inserted into the tree according to the order

  • in which they occur in the table. In consequence, a node must not

  • occur in the node table before its parent node.

  • Node with key 'Root'

node-node_key = wa_ekko-ebeln. " 'Root'. "#EC NOTEXT

" Key of the node

CLEAR node-relatkey. " Special case: A root node has no parent

CLEAR node-relatship. " node.

node-hidden = ' '. " The node is visible,

node-disabled = ' '. " selectable,

node-isfolder = 'X'. " a folder.

CLEAR node-n_image. " Folder-/ Leaf-Symbol in state "closed":

" use default.

CLEAR node-exp_image. " Folder-/ Leaf-Symbol in state "open":

" use default

CLEAR node-expander. " see below.

node-text = wa_ekko-ebeln. "'Root'.

APPEND node TO node_table.

LOOP AT it_ekpo INTO wa_ekpo WHERE ebeln EQ wa_ekko-ebeln.

  • Node with key wa_ekpo-ebelp "'Child1'

ld_node = sy-tabix.

concatenate wa_ekpo-ebelp ld_node into ld_node.

node-node_key = ld_node. "'Child1'. #EC NOTEXT

  • Node is inserted as child of the node with key wa_ekpo-ebeln "'Root'.

node-relatkey = wa_ekpo-ebeln. " 'Root'.

node-relatship = cl_gui_simple_tree=>relat_last_child.

node-hidden = ' '.

node-disabled = ' '.

node-isfolder = ' '.

CLEAR node-n_image.

CLEAR node-exp_image.

node-expander = ' '. " The node is marked with a '+', although

  • it has no children. When the user clicks on the

  • + to open the node, the event

  • expand_no_children is fired. The programmer can

  • add the children of the

  • node within the event handler of the

  • expand_no_children event

  • (see method handle_expand_no_children

  • of class lcl_application)

node-text = wa_ekpo-ebelp.

APPEND node TO node_table.

ENDLOOP.

ENDLOOP.

  • Add nodes to alv tree

CALL METHOD GD_TREE->ADD_NODES

EXPORTING

TABLE_STRUCTURE_NAME = 'MTREESNODE'

NODE_TABLE = NODE_TABLE

EXCEPTIONS

FAILED = 1

ERROR_IN_NODE_TABLE = 2

DP_ERROR = 3

TABLE_STRUCTURE_NAME_NOT_FOUND = 4

OTHERS = 5.

thanks

mrutyun^