Application Development 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: 

Block ALV: New-page, Page No after each block, TOP-OF-PAGE

Former Member
0 Kudos

Hi All,

I am using block ALV to show 4 blocks in one report.

I want these functionalities in that:

1. TOP-OF-PAGE above all the blocks ie main top-of-page

I want a main top-of-page above all the blocks. This will be

different from top-of-page wrt every block,

like commentry_write in normal alv.

2. After every block i want to trigger a new-page for next block.

3. After every block i want Number of pages for that block to be

printed at end-of-page of that block.

Please provide answers to these. Points assured.

Thanks.

Vinod.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Debarish,

I want a main top-of-page, not for every blocks.

Like this:

Main Heading

Company: XX

Report Name:

Current date: XX

Block 1

Block2

.

.

.

Vinod.

6 REPLIES 6

Former Member
0 Kudos

Hello,

I think using Blocked alv we can dispaly multiple blocks it is not possible to display multiple top-of-pages.

So better you use normal output display i.e. without alv go for wirte statements.

Former Member
0 Kudos

hI,

For top of page do like this...



data:       it_evt_fl1 TYPE slis_t_event,
             it_evt_fl2 TYPE slis_t_event,
             is_events   TYPE slis_alv_event.


  is_events-name ='TOP_OF_PAGE'.
  is_events-form ='TOP1'.
  APPEND is_events TO it_evt_fl1.
  CLEAR is_events.
  is_events-name ='TOP_OF_PAGE'.
  is_events-form = 'TOP2'.
  APPEND is_events TO it_evt_fl2.

then...give the headings

*&      Form  top1
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
FORM top1.
  SKIP.
  WRITE:/20 'your text'(025) COLOR 5.
*  WRITE:/20  'your text'(024) COLOR 4.
ENDFORM.                                                    "top1


*&---------------------------------------------------------------------*
*&      Form  top2
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM top2.
  SKIP.
  WRITE:/20 'your text'(026) COLOR 5.
*  WRITE:/20  'your text'(024) COLOR 4.
ENDFORM.                                                    "top2



  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
      is_layout                        = it_layout
      it_fieldcat                      = it_fcat
      i_tabname                        = 'IT_FINAL_D2'
      it_events                        = it_evt_fl1
*    IT_SORT                          =
*    I_TEXT                           = ' '
    TABLES
      t_outtab                         = it_final_d2
  EXCEPTIONS
    program_error                    = 1
    maximum_of_appends_reached       = 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.


  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
      is_layout                        = it_layout
      it_fieldcat                      = it_fcat
      i_tabname                        = 'IT_FINAL_D2'
      it_events                        = it_evt_fl2
*    IT_SORT                          =
*    I_TEXT                           = ' '
    TABLES
      t_outtab                         = it_final_d2
  EXCEPTIONS
    program_error                    = 1
    maximum_of_appends_reached       = 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.

Former Member
0 Kudos

Hi Debarish,

I want a main top-of-page, not for every blocks.

Like this:

Main Heading

Company: XX

Report Name:

Current date: XX

Block 1

Block2

.

.

.

Vinod.

0 Kudos

Hi,

Verry well then just do the way I said once and pass the it_event to your first alv block fm.

i.e only one top.

and in it write the way you want i.e. Main Heading

Company: XX

Report Name:

Current date: XX

Regards

Debarshi

Former Member
0 Kudos

One problem has been solved..

Now can anyone guide me for

Number of pages and new page for after each block.

0 Kudos

Hi,

For this part see saptechnical.com/Tutorials/ALV/PageNumbers/Demo

it might help you...