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

hiercal seq report

Former Member
0 Likes
704

Hi Exports,

Can any one have pice of code for hierarchal seq report, i have requirment.

regards

Srinivas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
678

Hi.

Try this code...

first you need to declare header and item table first(accordinly)

&----


*& Form build_keyinfo

&----


*Keyinfo for Header table and item table for Company code and

*Payment term

form build_keyinfo .

i_keyinfo-header01 = text-027. "BUKRS

i_keyinfo-item01 = text-027. "BUKRS

i_keyinfo-header01 = text-029. "ZTERM

i_keyinfo-item01 = text-029. "ZTERM

endform. " build_keyinfo

&----


*& Form build_event_tab

&----


  • text

----


  • -->P_V_REPID text

----


form build_event_tab.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = i_event

exceptions

list_type_wrong = 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.

read table i_event into wa_event with key name = text-037.

if sy-subrc = 0.

wa_event-form = text-025.

modify i_event from wa_event index sy-tabix.

endif.

v_repid = sy-repid.

endform. " build_event_tab

&----


*& Form build_layout

&----


  • Layout for different colors and hotspot.

form build_layout .

i_layout-zebra = c_x. u201CX

i_layout-expand_fieldname = text-024.

i_layout-key_hotspot = c_x. u201CX

endform. " build_layout

&----


*& Form display_data

&----


  • Output dipaly for Header and item tables *

form display_data.

call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

exporting

i_callback_program = v_repid

is_layout = i_layout

it_fieldcat = i_fldcat

it_sort = i_sort

it_events = i_event

i_tabname_header = text-058

i_tabname_item = text-014

is_keyinfo = i_keyinfo

tables

t_outtab_header = i_analyhead

t_outtab_item = i_analysis

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.

*

refresh : i_fldcat,

i_event,

i_analyhead,

i_analysis.

endform. " display_data

Regards

Srinivas

Hi Exports,

Can any one have pice of code for hierarchal seq report, i have requirment.

regards

Srinivas

4 REPLIES 4
Read only

Former Member
0 Likes
679

Hi.

Try this code...

first you need to declare header and item table first(accordinly)

&----


*& Form build_keyinfo

&----


*Keyinfo for Header table and item table for Company code and

*Payment term

form build_keyinfo .

i_keyinfo-header01 = text-027. "BUKRS

i_keyinfo-item01 = text-027. "BUKRS

i_keyinfo-header01 = text-029. "ZTERM

i_keyinfo-item01 = text-029. "ZTERM

endform. " build_keyinfo

&----


*& Form build_event_tab

&----


  • text

----


  • -->P_V_REPID text

----


form build_event_tab.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = i_event

exceptions

list_type_wrong = 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.

read table i_event into wa_event with key name = text-037.

if sy-subrc = 0.

wa_event-form = text-025.

modify i_event from wa_event index sy-tabix.

endif.

v_repid = sy-repid.

endform. " build_event_tab

&----


*& Form build_layout

&----


  • Layout for different colors and hotspot.

form build_layout .

i_layout-zebra = c_x. u201CX

i_layout-expand_fieldname = text-024.

i_layout-key_hotspot = c_x. u201CX

endform. " build_layout

&----


*& Form display_data

&----


  • Output dipaly for Header and item tables *

form display_data.

call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

exporting

i_callback_program = v_repid

is_layout = i_layout

it_fieldcat = i_fldcat

it_sort = i_sort

it_events = i_event

i_tabname_header = text-058

i_tabname_item = text-014

is_keyinfo = i_keyinfo

tables

t_outtab_header = i_analyhead

t_outtab_item = i_analysis

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.

*

refresh : i_fldcat,

i_event,

i_analyhead,

i_analysis.

endform. " display_data

Regards

Srinivas

Read only

Former Member
0 Likes
678

Hi,

Welcome to SCN..

Search SCN you will find lot of links for your requirement.

Read only

GauthamV
Active Contributor
0 Likes
678

hi,

WELCOME TO SDN.

SEARCH in SCN before posting basic questions, you will get lot of information.

use these sample programs.

BALVHD01 - Demo program ALV: Hierarchical-sequential list flight model

BALVHT01 - Test program ALV: hierarchical-sequential list flight model.

Read only

Former Member