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

FORM e04_comment_build

Former Member
0 Likes
814

I MADE THIS FORM AND I DONT GET DATA AT THE TOP OF THE PAGE

WHY?

AND IN THE PRINT I GET THE DATA BUT SMALL

FORM e04_comment_build USING e04_lt_top_of_page TYPE

slis_t_listheader.

DATA: ls_line TYPE slis_listheader.

DATA zline type i.

CLEAR e04_lt_top_of_page .

REFRESH e04_lt_top_of_page .

CLEAR ls_line.

ls_line-typ = 'H'.

ls_line-key = ''.

ls_line-info = 'PO report'(001).

APPEND ls_line TO e04_lt_top_of_page.

CLEAR ls_line.

ls_line-typ = 'S'.

ls_line-key = text-011.

CONCATENATE sy-datum6(2) '/' sy-datum4(2) '/' sy-datum(4)

'&&' sy-uzeit(2) ':' sy-uzeit+2(2)

INTO ls_line-info.

REPLACE '&&' WITH ' ' INTO ls_line-info.

APPEND ls_line TO e04_lt_top_of_page.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
776
chk this,if u could not get still , then there is some prblem with GUI

*&---------------------------------------------------------------------*
*& Report  Y_TOP_PAGE                                                  *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  y_top_page                              .

TABLES : mara.
TYPE-POOLS: slis.

DATA : w_repid LIKE sy-repid.
  w_repid = sy-repid.

DATA : BEGIN OF it_mara OCCURS 0,
       matnr LIKE mara-matnr,
       END OF it_mara.

*layout
DATA: wa_layout           TYPE SLIS_LAYOUT_ALV.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
      wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.

START-OF-SELECTION.

  SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.

END-OF-SELECTION.


  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
     i_program_name               = w_repid
   I_INTERNAL_TABNAME           = 'IT_MARA'
*     i_structure_name             = 'IT_MARA'
*   I_CLIENT_NEVER_DISPLAY       = 'X'
   I_INCLNAME                   = w_repid
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = it_fieldcat_wrt_off[]
   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.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program     = w_repid
      i_callback_top_of_page = 'TOP-OF-PAGE'
      is_layout              = wa_layout
      it_fieldcat            = it_fieldcat_wrt_off
    TABLES
      t_outtab               = it_mara
    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.



*-------------------------------------------------------------------*
* Form  TOP-OF-PAGE                                                 *
*-------------------------------------------------------------------*
* ALV Report Header                                                 *
*-------------------------------------------------------------------*
FORM top-of-page.
*ALV Header declarations
  DATA: t_header TYPE slis_t_listheader,
        wa_header TYPE slis_listheader,
        t_line LIKE wa_header-info,
        ld_lines TYPE i,
        ld_linesc(10) TYPE c.

* Title
  wa_header-typ  = 'H'.
  wa_header-info = 'CHANDU REPORT'.
  APPEND wa_header TO t_header.
  CLEAR wa_header.

* Date
  wa_header-typ  = 'S'.
  wa_header-key = 'Date: '.
  CONCATENATE  sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) INTO wa_header-info.   "todays date
  APPEND wa_header TO t_header.
  CLEAR: wa_header.

* Total No. of Records Selected
*  describe table it_ekko lines ld_lines.
*  ld_linesc = ld_lines.
*  concatenate 'Total No. of Records Selected: ' ld_linesc
*                    into t_line separated by space.
*  wa_header-typ  = 'A'.
*  wa_header-info = t_line.
*  append wa_header to t_header.
*  clear: wa_header, t_line.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = t_header.
*            i_logo             = 'Z_LOGO'.
ENDFORM.                    "top-of-page
7 REPLIES 7
Read only

Former Member
0 Likes
776

hi,

TOP OF PAGE will be triggered when there is any data to display, do u have any data to be displayed below top of page

as by the definition of top of page it will be triggered after it sees first write statement in the program

Read only

Former Member
0 Likes
776

Hi liat,

since it is ALV , and what is this FM you are using .

if it is ALV list display FM you can use normal write statements but if it is Grid FM then it will display the Top of page and are you using fm <b>REUSE_ALV_COMMENTARY_WRITE</b> in your top_of_page event.

check it once.

show your code,,

Regards

Vijay

Regards

Vijay

Read only

Former Member
0 Likes
776

Hi,

If you are using REUSE_ALV_LIST_DISPLAY,

Follow the below procedure.

1. Register the event TOP-OF-PAGE

DATA: ls_event TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = rt_events.

IF sy-subrc <> 0.

ENDIF.

READ TABLE rt_events WITH KEY name = slis_ev_top_of_page

INTO ls_event.

IF sy-subrc = 0.

MOVE alv_top_of_page TO ls_event-form.

APPEND ls_event TO rt_events.

ENDIF.

2. CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

i_logo = space

it_list_commentary = alv_list_top_of_page.

IF sy-subrc NE 0.

ENDIF.

3. Build your comments using this alv_list_top_of_page.

As you have written this part of the code.

4. Finally display the ALV list.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = sy-repid

is_layout = alv_layout

it_fieldcat = alv_fcat[]

i_save = 'X'

it_events = alv_events[]

TABLES

t_outtab = t_rep

EXCEPTIONS

program_error = 0

OTHERS = 0.

Hope it helps.

Regards,

Shashank

Read only

Former Member
0 Likes
776

Hi,

check this SAP program <b>BALVST02_GRID</b>, for the usage of FM <b>REUSE_ALV_COMMENTARY_WRITE</b>, and top of page.

Regards

Vijay

Read only

0 Likes
776

I USE THIS

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

HOW I CAN DO IT.

I REMEMBER THAT I USE IT AND I GET IT

Read only

0 Likes
776

Hi,

Did you use I_CALLBACK_TOP_OF_PAGE?

Have a look at this.

FU REUSE_ALV_GRID_DISPLAY I_CALLBACK_TOP_OF_PAGE

Text

EXIT routine for handling TOP-OF-PAGE

Description

If the caller specifies an EXIT routine, this routine must have the following form:

FORM top_of_page.

Module REUSE_ALV_COMMENTARY_WRITE can then be called within the EXIT routine. This module is responsible for formatting the header information and also ensures online HTML formatting. In the print preview or in batch mode, the text passed is then output in the normal format.

If module REUSE_ALV_COMMENTARY_WRITE cannot be used, you must use two parameters instead. In I_CALLBACK_TOP_OF_PAGE you pass the form routine that is responsible for normal formatting in batch mode or in the print preview mode. The form routine that is responsible for online formatting, is passed in parameter I_CALLBACK_HTML_TOP_OF_PAGE. If one of these parameters is not filled, top-of-page is not output in the respective mode.

Regards,

Shashank

Read only

Former Member
0 Likes
777
chk this,if u could not get still , then there is some prblem with GUI

*&---------------------------------------------------------------------*
*& Report  Y_TOP_PAGE                                                  *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  y_top_page                              .

TABLES : mara.
TYPE-POOLS: slis.

DATA : w_repid LIKE sy-repid.
  w_repid = sy-repid.

DATA : BEGIN OF it_mara OCCURS 0,
       matnr LIKE mara-matnr,
       END OF it_mara.

*layout
DATA: wa_layout           TYPE SLIS_LAYOUT_ALV.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
      wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.

START-OF-SELECTION.

  SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.

END-OF-SELECTION.


  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
     i_program_name               = w_repid
   I_INTERNAL_TABNAME           = 'IT_MARA'
*     i_structure_name             = 'IT_MARA'
*   I_CLIENT_NEVER_DISPLAY       = 'X'
   I_INCLNAME                   = w_repid
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = it_fieldcat_wrt_off[]
   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.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program     = w_repid
      i_callback_top_of_page = 'TOP-OF-PAGE'
      is_layout              = wa_layout
      it_fieldcat            = it_fieldcat_wrt_off
    TABLES
      t_outtab               = it_mara
    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.



*-------------------------------------------------------------------*
* Form  TOP-OF-PAGE                                                 *
*-------------------------------------------------------------------*
* ALV Report Header                                                 *
*-------------------------------------------------------------------*
FORM top-of-page.
*ALV Header declarations
  DATA: t_header TYPE slis_t_listheader,
        wa_header TYPE slis_listheader,
        t_line LIKE wa_header-info,
        ld_lines TYPE i,
        ld_linesc(10) TYPE c.

* Title
  wa_header-typ  = 'H'.
  wa_header-info = 'CHANDU REPORT'.
  APPEND wa_header TO t_header.
  CLEAR wa_header.

* Date
  wa_header-typ  = 'S'.
  wa_header-key = 'Date: '.
  CONCATENATE  sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) INTO wa_header-info.   "todays date
  APPEND wa_header TO t_header.
  CLEAR: wa_header.

* Total No. of Records Selected
*  describe table it_ekko lines ld_lines.
*  ld_linesc = ld_lines.
*  concatenate 'Total No. of Records Selected: ' ld_linesc
*                    into t_line separated by space.
*  wa_header-typ  = 'A'.
*  wa_header-info = t_line.
*  append wa_header to t_header.
*  clear: wa_header, t_line.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = t_header.
*            i_logo             = 'Z_LOGO'.
ENDFORM.                    "top-of-page