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 Report

Former Member
0 Likes
901

Hi all!

I am using the function

'REUSE_ALV_HIERSEQ_LIST_DISPLAY' to display a hierarchical report. This function displays Header & Item details. But I have requirement where I need to display Sales Header Info, Item Info and individual delivery schedules for each item. This function does not help in displaying the 3-step hierarchical info. Is there any other approach to solve this problem...

Regards,

Abhijeet A Kharade

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
861

Hi,

I know that it's no an answer to your question, but i suggest you to use the ALV GRID Control classes.

WIth they, you have a greater flexibility on the alv strucute(e.g. you can build a hierarchical list with all the step you need.).

good expamples of hierarchical list implementatio are report

BCALV_TREE_01

BCALV_TREE_02

BCALV_TREE_03

BCALV_TREE_04

BCALV_TREE_05

BCALV_TREE_06

BCALV_TREE_DEMO

If you want some pdf documentation about it, send me an email (you can get it from my profile).

bye

enzo

Hi all!

I am using the function

'REUSE_ALV_HIERSEQ_LIST_DISPLAY' to display a hierarchical report. This function displays Header & Item details. But I have requirement where I need to display Sales Header Info, Item Info and individual delivery schedules for each item. This function does not help in displaying the 3-step hierarchical info. Is there any other approach to solve this problem...

Regards,

Abhijeet A Kharade

7 REPLIES 7
Read only

Former Member
0 Likes
861

same thread

Read only

Former Member
0 Likes
861

Hai

go through the following Code

&----


*& Report ZALV_HIER *

*& *

&----


*& *

*& *

&----


REPORT ZALV_HIER .

type-pools:slis.

tables: ekko,ekpo.

data:begin of it_ekko occurs 0,

ebeln like ekko-ebeln,

bukrs like ekko-bukrs,

lifnr like ekko-lifnr,

bedat like ekko-bedat,

end of it_ekko.

data: begin of it_ekpo occurs 0,

sno like ekpo-ebeln,

ebelp like ekpo-ebelp,

menge like ekpo-menge,

netwr like ekpo-netwr,

end of it_ekpo.

data v_repid like sy-repid.

data it_fieldcat type slis_fieldcat_alv occurs 0 with header line.

data x_keyinfo type slis_keyinfo_alv.

select-options:s_ebeln for ekko-ebeln.

initialization.

v_repid = sy-repid.

s_ebeln-low = '1000'.

s_ebeln-sign = 'I'.

s_ebeln-option = 'EQ'.

S_ebeln-high = '5000'.

append s_ebeln.

start-of-selection.

perform get_data.

perform get_field.

perform get_key.

perform key_modify.

perform display.

&----


*& Form get_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data.

select ebeln

bukrs

lifnr

bedat

from ekko into table it_ekko." where ebeln in s_ebeln.

select ebeln

ebelp

menge

netwr from ekpo into table it_ekpo." where ebeln in s_ebeln.

endform. " get_data

&----


*& Form get_field

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_field.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = v_repid

i_internal_tabname = 'IT_EKKO'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = v_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

changing

ct_fieldcat = it_fieldcat[] .

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = v_repid

i_internal_tabname = 'IT_EKPO'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = v_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

changing

ct_fieldcat = it_fieldcat[]

  • EXCEPTIONS

  • INCONSISTENT_INTERFACE = 1

  • PROGRAM_ERROR = 2

  • OTHERS = 3

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. " get_field

&----


*& Form get_key

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_key.

x_keyinfo-header01 = 'EBELN'.

x_keyinfo-item01 = 'SNO'.

endform. " get_key

&----


*& Form DISPLAY

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form display.

*loop at it_ekko where ebeln eq '4500005016'.

  • write it_ekko-ebeln.

  • endloop.

*

*loop at it_ekpo where sno eq '4500005016'.

  • write it_ekpo-sno.

  • endloop.

*

**

*loop at it_fieldcat where key eq space .

  • write : / it_fieldcat-fieldname,it_fieldcat-key.

*endloop.

*

*loop at it_ekko.

  • loop at it_ekpo where sno eq it_ekko-ebeln.

  • write : / it_ekpo-menge,it_ekpo-ebelp.

  • endloop.

  • endloop.

*

*

*

call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

i_callback_program = v_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • IS_LAYOUT =

it_fieldcat = it_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

i_tabname_header = 'IT_EKKO'

i_tabname_item = 'IT_EKPO'

  • I_STRUCTURE_NAME_HEADER =

  • I_STRUCTURE_NAME_ITEM =

is_keyinfo = x_keyinfo

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab_header = it_ekko

t_outtab_item = it_ekpo

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. " DISPLAY

&----


*& Form key_modify

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form key_modify.

loop at it_fieldcat. "Avoid Repitiotion of data.

case it_fieldcat-fieldname.

when 'SNO'.

if it_fieldcat-tabname = 'IT_EKPO'.

it_fieldcat-no_out = 'X'.

it_fieldcat-key = space.

endif.

endcase.

modify it_fieldcat index sy-tabix.

endloop.

endform. " key_modify

Thanks & regards

Sreeni

Read only

0 Likes
861

Sreeni.

This code is about using 2 internal tables. I am looking for a solution which allows me to have 3 internal tables. ie The drop down hierarchy should be available till 3 levels.

Abhijeet

Read only

0 Likes
861

Hi,

you can try with the FM <b>RS_TREE_LIST_DISPLAY</b>

Regards

vijay

Read only

Former Member
0 Likes
861

Hi,

it is not possible with normal Hierarchial alv list. Go for ALV TREE there you can add how many ever Nodes you want ..

Regards

vijay

Read only

Former Member
0 Likes
862

Hi,

I know that it's no an answer to your question, but i suggest you to use the ALV GRID Control classes.

WIth they, you have a greater flexibility on the alv strucute(e.g. you can build a hierarchical list with all the step you need.).

good expamples of hierarchical list implementatio are report

BCALV_TREE_01

BCALV_TREE_02

BCALV_TREE_03

BCALV_TREE_04

BCALV_TREE_05

BCALV_TREE_06

BCALV_TREE_DEMO

If you want some pdf documentation about it, send me an email (you can get it from my profile).

bye

enzo

Read only

0 Likes
861

Enzo,

May I have your email-id.

Thanks,

Abhijeet