on 03-06-2006 12:55 PM
Hi,
is it possible to display using ALV as below?
Header text1
itab-col1 itab-col2 itab-col3
-
-
-
Header text2
itab1-col1 itab1-col2 itab1-col3
-
-
-
Please let me know.
Thanks!
Sreenivas.
Hi,
I want to display more than two (multiple) , its not just header and item, its completely 5 different internal tables want to display in the same output with different header texts.
Pls help me.
Thanks!
Sreenivas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,
you can do that using REUSE_ALV_HIERSEQ_LIST_DISPLAY.
regards
satesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You try to use the event TOP_OF_PAGE.
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
YOu can do this using Hierarchical ALV.
See a sample program:
TYPE-POOLS: slis.
*--tables declaration
TABLES: SFLIGHT,SPFLI.
*--types declaration
DATA: BEGIN OF i_SFLIGHT OCCURS 0,
CARRID LIKE SFLIGHT-CARRID,
CONNID LIKE SFLIGHT-CONNID,
FLDATE LIKE SFLIGHT-FLDATE,
END OF i_SFLIGHT.
DATA: BEGIN OF i_SPFLI OCCURS 0,
CARRID LIKE SPFLI-CARRID,
CONNID LIKE SPFLI-CONNID,
AIRPFROM LIKE SPFLI-AIRPFROM,
AIRPTO LIKE SPFLI-AIRPTO,
DISTANCE LIKE SPFLI-DISTANCE,
END OF i_SPFLI.
*--variables
DATA: i_repid LIKE sy-repid.
DATA gd_prntparams type slis_print_alv.
DATA: gt_events type slis_t_event.
i_repid = sy-repid.
DATA: i_field TYPE slis_t_fieldcat_alv.
DATA: i_field2 TYPE slis_t_fieldcat_alv.
DATA: G_TABNAME_HEADER TYPE SLIS_TABNAME.
DATA: G_TABNAME_ITEM TYPE SLIS_TABNAME.
DATA: G_KEYINFO TYPE SLIS_KEYINFO_ALV.
*--select options
SELECT-OPTIONS : S_CARRID FOR SFLIGHT-CARRID .
*--initialosation
INITIALIZATION.
*--selection screen on
AT SELECTION-SCREEN .
*--start of selection
START-OF-SELECTION.
SELECT CARRID
CONNID
FLDATE
FROM SFLIGHT INTO TABLE i_SFLIGHT
WHERE CARRID IN S_CARRID.
IF i_SFLIGHT[] IS NOT INITIAL.
SELECT CARRID
CONNID
DISTANCE
INTO TABLE i_SPFLI FROM SPFLI
FOR ALL ENTRIES IN I_SFLIGHT
WHERE CARRID = i_SFLIGHT-CARRID.
IF sy-subrc NE 0.
MESSAGE e001(z538msg).
ENDIF.
ENDIF.
PERFORM fill_fieldcatalog1.
PERFORM fill_fieldcatalog2.
PERFORM HIERARCHY_ALV.
PERFORM alv_events.
G_KEYINFO-header01 = 'CARRID'.
G_KEYINFO-item01 = 'CONNID'.
G_TABNAME_HEADER = 'I_SFLIGHT'.
G_TABNAME_ITEM = 'I_SPFLI'.
&----
*& Form fill_fieldcatalog
&----
FORM fill_fieldcatalog1 .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = i_repid
i_internal_tabname = 'I_SFLIGHT'
i_structure_name = EKPO
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = i_repid
I_BYPASSING_BUFFER = 'X'
I_BUFFER_ACTIVE = ''
CHANGING
ct_fieldcat = i_field
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. " fill_fieldcatalog
&----
*& Form fill_fieldcatalog2
&----
form fill_fieldcatalog2 .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = i_repid
i_internal_tabname = 'I_SPFLI'
i_structure_name = EKPO
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = i_repid
I_BYPASSING_BUFFER = 'X'
I_BUFFER_ACTIVE = ''
CHANGING
ct_fieldcat = i_field
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. " fill_fieldcatalog2
&----
*& Form HIERARCHY_ALV
&----
form HIERARCHY_ALV .
G_KEYINFO-header01 = 'CONNID'.
G_KEYINFO-item01 = 'CONNID'.
G_TABNAME_HEADER = 'I_SFLIGHT'.
G_TABNAME_ITEM = 'I_SPFLI'.
perform build_events.
perform build_print_params.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = I_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT =
IT_FIELDCAT = I_FIELD
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 = 'A'
IS_VARIANT =
IT_EVENTS = GT_EVENTS
IT_EVENT_EXIT =
i_tabname_header = G_TABNAME_HEADER
i_tabname_item = G_TABNAME_ITEM
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
is_keyinfo = G_KEYINFO
IS_PRINT = gd_prntparams
IS_REPREP_ID =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab_header = I_SFLIGHT
t_outtab_item = I_SPFLI
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. " HIERARCHY_ALV
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform.
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform.
form user_command.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/ 'Page:', sy-pagno .
endform.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.