09-30-2007 7:25 AM
Hi all,
I am using reuse_alv_list_display to display my report output,
in my final internal table i have 10 fields and the first field is company code
so for each company code i need to trigger top-of-page which need to display
company code when ever copany code changes it need to display next page
so here i am unable to trigger top-of-page.
could any body help me out .. how we will trigger new-page for each comapny code and company code need to display on top-of-page.
Thanks in advance.
09-30-2007 7:36 AM
You will have to insert page break for each new value of Company Code.
ass this sort to alv grid / list.
CLEAR itsort.
itsort1-spos = 1."column position
itsort1-fieldname = 'Company Code field name
itsort1-tabname = internal table name
itsort1-up = 'X'.
itsort1-group = '*'.
itsort1-subtot = 'X'. " If you want subtotals
APPEND itsort1 TO itsort.
09-30-2007 7:38 AM
You will have to insert page break for each new value of Company Code.
Pass this sort to alv grid / list.
CLEAR itsort.
itsort1-spos = 1."column position
itsort1-fieldname = 'Company Code field name
itsort1-tabname = internal table name
itsort1-up = 'X'.
itsort1-group = '*'.
itsort1-subtot = 'X'. " If you want subtotals
APPEND itsort1 TO itsort.
Here is an example
DATA:itsort TYPE slis_t_sortinfo_alv WITH HEADER LINE.
DATA :itsort1 TYPE slis_sortinfo_alv.
CLEAR itsort.
itsort1-spos = 10."column position
itsort1-fieldname = 'LIFNR'."field name
itsort1-tabname = 'ITFINAL'."internal table
itsort1-up = 'X'.
itsort1-group = '*'.
itsort1-subtot = 'X'.
APPEND itsort1 TO itsort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = itlayout
i_callback_user_command = 'LIST1'
i_callback_top_of_page = 'TOP'
it_fieldcat = itfieldcat[]
i_save = 'A'
is_variant = ITVARIANT
it_events = itevent[]
is_print = ITPRINTPARAMS
it_sort = itsort[]
TABLES
t_outtab = itfinal
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.
Reward if helpful.
09-30-2007 8:15 AM
I got the page break for each company code but it is not dispaying the comapany code on top of page.
i want to display like this on top-of-page in
reuse_alv_list_display
Company code:1010
details
next page
Company code:1520
details.