2009 Jan 01 12:30 PM
Hi Exports,
Can any one have pice of code for hierarchal seq report, i have requirment.
regards
Srinivas
2009 Jan 01 12:33 PM
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
2009 Jan 01 12:33 PM
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
2009 Jan 01 12:34 PM
Hi,
Welcome to SCN..
Search SCN you will find lot of links for your requirement.
2009 Jan 01 12:35 PM
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.
2009 Jan 02 5:10 AM
Hi ,
Please refer the below links :
http://www.slideshare.net/bunny_aug15/abap-alv?type=powerpoint
http://born4abap.blogspot.com/2008/05/abap-alv-in-brief.html
Regards,
Radhika.