Sunday, December 19, 2010
We use HTML_TOP_OF_PAGE event to display TOP OF PAGE for ALV GRID Display.
REPORT ztest_notepad.
DATA: gt_sflight TYPE TABLE OF sflight.
DATA: g_repid LIKE sy-repid.
DATA: r_dd_table TYPE REF TO cl_dd_table_area.
"START-OF-SELECTION
START-OF-SELECTION.
SELECT * FROM sflight INTO TABLE gt_sflight UP TO 10 ROWS.
g_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
i_structure_name = 'SFLIGHT'
TABLES
t_outtab = gt_sflight.
*&---------------------------------------------------------------------*
*& Form html_top_of_page
*&---------------------------------------------------------------------*
FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
"add heading
CALL METHOD document->add_text
EXPORTING
text = 'Header information'
sap_style = cl_dd_area=>heading.
"underline and new line
CALL METHOD document->underline.
CALL METHOD document->new_line.
"add quick table with two columns
CALL METHOD document->add_table
EXPORTING
no_of_columns = 2
border = '0'
width = '40%' "you can set any width of top area in %
IMPORTING
tablearea = r_dd_table.
"first row
CALL METHOD r_dd_table->new_row.
"fill columns in first row
CALL METHOD r_dd_table->add_text
EXPORTING
text = 'First column first row'
sap_color = cl_dd_area=>list_key_int.
CALL METHOD r_dd_table->add_text
EXPORTING
text = 'Second column first row'
sap_color = cl_dd_area=>list_key.
"add first row
CALL METHOD r_dd_table->new_row.
"fill columns in second row
CALL METHOD r_dd_table->add_text
EXPORTING
text = 'First column second row'
sap_color = cl_dd_area=>list_key_int.
CALL METHOD r_dd_table->add_text
EXPORTING
text = 'Second column second row'
sap_color = cl_dd_area=>list_key.
"request for second row
CALL METHOD r_dd_table->new_row.
ENDFORM. "html_top_of_page
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Sending email with pdf attachment
- ABAP - Step by step tutorial on Smart Forms - Template Node
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
how can we get the header information also printed on page?
ReplyDelete