Skip to Content
author's profile photo Former Member
Former Member

unable to print TOP_OF_PAGE in ALV Using OOPS??plz help me in my code

*&--data declaration

TYPE-POOLS : slis.

TYPES : BEGIN OF type_vbak,

vbeln LIKE vbak-vbeln, "SD Order

ernam LIKE vbak-ernam, "Name of the person who created

audat LIKE vbak-audat, "Document Date

vbtyp LIKE vbak-vbtyp, "SD Document Category

auart LIKE vbak-auart, "Type of Order

netwr LIKE vbak-netwr,

"Net value in sales current doc currency

waerk LIKE vbak-waerk, "SD Document Currency

vkorg LIKE vbak-vkorg, "Sales Organization

vtweg LIKE vbak-vtweg, "Distribution Chanel

spart LIKE vbak-spart, "Division

END OF type_vbak.

TYPES : BEGIN OF type_vbap,

vbeln LIKE vbap-vbeln, "SD Order

posnr LIKE vbap-posnr, "Sales Document Item

matnr LIKE vbap-matnr, "Component

charg LIKE vbap-charg, "Batch Number

matkl LIKE vbap-matkl, "Material Group

arktx LIKE vbap-arktx, "Short Text for Sales Order Item

kwmeng LIKE vbap-kwmeng,

"cumulative order quantity in sales unit

vrkme LIKE vbap-vrkme, "Sales Unit

netpr LIKE vbap-netpr, "Net Price

END OF type_vbap.

TYPES : type_t_vbak TYPE type_vbak,

type_t_vbap TYPE type_vbap.

DATA : it_vbak TYPE STANDARD TABLE OF type_t_vbak,

it_vbap TYPE STANDARD TABLE OF type_t_vbap.

DATA : wa_vbak TYPE type_t_vbak,

wa_vbap TYPE type_t_vbap.

DATA : d_vbeln LIKE vbak-vbeln,

d_audat LIKE vbak-audat,

lv_vbeln TYPE vbak-vbeln.

*&---Internal table for event catalog

DATA :it_event TYPE slis_t_event,

  • Internal table for Header printing

i_header TYPE slis_t_listheader,

*&---Work area for event catalog

wa_event TYPE slis_alv_event,

*&---Work area for report layout

wa_layout TYPE slis_layout_alv,

  • Workarea for Header printing

wa_header TYPE slis_listheader.

*&---cc1 is refering to the global class 'cl_gui_custom_container'

DATA : cc1 TYPE REF TO cl_gui_custom_container.

*&----alv1 is refering to the global class 'cl_gui_alv_grid'

DATA : alv1 TYPE REF TO cl_gui_alv_grid.

*&----work area for field catalog

DATA : wa_fieldcatalog1 TYPE lvc_s_fcat.

*&----internal table for field catalog

DATA : it_fieldcatalog1 TYPE lvc_t_fcat.

*&----data declaration for ok_code

DATA: ok_code_0101 LIKE sy-ucomm.

*&---cc2 is refering to the global class 'cl_gui_custom_container'

DATA : cc2 TYPE REF TO cl_gui_custom_container.

*&----alv2 is refering to the global class 'cl_gui_alv_grid'

DATA : alv2 TYPE REF TO cl_gui_alv_grid.

*&----work area for field catalog

DATA : wa_fieldcatalog2 TYPE lvc_s_fcat.

*&----internal table for field catalog

DATA : it_fieldcatalog2 TYPE lvc_t_fcat.

*&----data declaration for ok_code

DATA: ok_code_0102 LIKE sy-ucomm.

*&--defining the selection screen

SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.

SELECT-OPTIONS : s_vbeln FOR d_vbeln OBLIGATORY, "SD Order

s_audat FOR d_audat. "Document Date

SELECTION-SCREEN END OF BLOCK bl1.

AT SELECTION-SCREEN ON s_vbeln.

IF s_vbeln[] IS INITIAL.

SET CURSOR FIELD 'S_VBELN-LOW'.

MESSAGE e001 WITH text-001.

ELSE.

SELECT SINGLE vbeln INTO wa_vbak-vbeln

FROM vbak

WHERE vbeln IN s_vbeln.

IF sy-subrc <> 0.

SET CURSOR FIELD 'S_VBELN-LOW'.

MESSAGE e002 WITH text-002.

ENDIF.

ENDIF.

DATA : wa_row_id TYPE lvc_s_row.

----


  • CLASS lcl_event_reciver DEFINITION

----


*

----


CLASS lcl_event_reciver DEFINITION.

PUBLIC SECTION.

  • &--defining the method for each event

METHODS : handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid

IMPORTING e_row_id e_column_id es_row_no,

handle_top_of_page FOR EVENT TOP_OF_PAGE OF cl_gui_alv_grid

IMPORTING e_dyndoc_id.

PROTECTED SECTION.

PRIVATE SECTION.

ENDCLASS. "lcl_event_reciver DEFINITION

----


  • CLASS lcl_event_reciver IMPLEMENTATION

----


*

----


CLASS lcl_event_reciver IMPLEMENTATION.

*&--implement the event handler methods for hot spot click.

METHOD handle_hotspot_click.

CLEAR lv_vbeln.

READ TABLE it_vbak INTO wa_vbak INDEX e_row_id.

lv_vbeln = wa_vbak-vbeln.

**&--for freeing the instance which was created alv2.

  • perform free_previous_object.

*CALL METHOD alv2->free

  • EXCEPTIONS

  • CNTL_ERROR = 1

  • CNTL_SYSTEM_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.

*&--fetching the data

*perform fetch_data_alv2 usinr lv_vbeln.

SELECT vbeln "SD Order

posnr "Sales Document Item

matnr "Component

charg "Batch Number

matkl "Material Group

arktx "Short Text for Sales Order Item

kwmeng "cumulative order quantity in sales unit

vrkme "Sales Unit

netpr "Net Price

INTO TABLE it_vbap

FROM vbap

WHERE vbeln = lv_vbeln.

IF sy-subrc <> 0.

MESSAGE e004 WITH text-004.

ENDIF.

*&---populating the second alv

*perform populate_fieldcatalog2.

*&-POPULATING THE FIELD VBELN

wa_fieldcatalog2-col_pos = 1. "position of the column

wa_fieldcatalog2-fieldname = 'VBELN'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

*wa_fieldcatalog2-hotspot = 'X'.

wa_fieldcatalog2-outputlen = 10. "output length of the field.

wa_fieldcatalog2-seltext = 'SD ORDER NUMBER'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&-POPULATING THE FIELD POSNR

wa_fieldcatalog2-col_pos = 2. "position of the column

wa_fieldcatalog2-fieldname = 'POSNR'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

wa_fieldcatalog2-outputlen = 2. "output length of the field.

wa_fieldcatalog2-seltext = 'SD ITEM'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&-POPULATING THE FIELD MATNR

wa_fieldcatalog2-col_pos = 3. "position of the column

wa_fieldcatalog2-fieldname = 'MATNR'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

wa_fieldcatalog2-outputlen = 2. "output length of the field.

wa_fieldcatalog2-seltext = 'COMPONENT'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&-POPULATING THE FIELD CHARG

wa_fieldcatalog2-col_pos = 4. "position of the column

wa_fieldcatalog2-fieldname = 'CHARG'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

wa_fieldcatalog2-outputlen = 2. "output length of the field.

wa_fieldcatalog2-seltext = 'BATCH NUMBER'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&-POPULATING THE FIELD MATKL

wa_fieldcatalog2-col_pos = 5. "position of the column

wa_fieldcatalog2-fieldname = 'MATKL'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

wa_fieldcatalog2-outputlen = 2. "output length of the field.

wa_fieldcatalog2-seltext = 'MATERIAL GROUP'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&-POPULATING THE FIELD ARKTX

wa_fieldcatalog2-col_pos = 6. "position of the column

wa_fieldcatalog2-fieldname = 'ARKTX'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

wa_fieldcatalog2-outputlen = 2. "output length of the field.

wa_fieldcatalog2-seltext = 'SHORT TEXT'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&-POPULATING THE FIELD KWMENG

wa_fieldcatalog2-col_pos = 7. "position of the column

wa_fieldcatalog2-fieldname = 'KEMENG'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

wa_fieldcatalog2-outputlen = 2. "output length of the field.

wa_fieldcatalog2-seltext = 'SALES QUANTITY'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&-POPULATING THE FIELD VRKME

wa_fieldcatalog2-col_pos = 8. "position of the column

wa_fieldcatalog2-fieldname = 'VRKME'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

wa_fieldcatalog2-outputlen = 2. "output length of the field.

wa_fieldcatalog2-seltext = 'SALES UNIT'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&-POPULATING THE FIELD NETPR

wa_fieldcatalog2-col_pos = 9. "position of the column

wa_fieldcatalog2-fieldname = 'NETPR'. "field name

wa_fieldcatalog2-tabname = 'IT_VBAP'. "INTERNAL table name

wa_fieldcatalog2-ref_table = 'VBAP'. "FOR REFERENCE

wa_fieldcatalog2-outputlen = 2. "output length of the field.

wa_fieldcatalog2-seltext = 'NET PRICE'.

"long key word

APPEND wa_fieldcatalog2 TO it_fieldcatalog2.

CLEAR wa_fieldcatalog2.

*&--display the alv2

*perform display_alv2.

CREATE OBJECT cc2

EXPORTING

  • PARENT =

container_name = 'CUSTOMCONTROL2'

  • STYLE =

  • LIFETIME = lifetime_default

  • REPID =

  • DYNNR =

  • NO_AUTODEF_PROGID_DYNNR =

  • EXCEPTIONS

  • CNTL_ERROR = 1

  • CNTL_SYSTEM_ERROR = 2

  • CREATE_ERROR = 3

  • LIFETIME_ERROR = 4

  • LIFETIME_DYNPRO_DYNPRO_LINK = 5

  • others = 6

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT alv2

EXPORTING

  • I_SHELLSTYLE = 0

  • I_LIFETIME =

i_parent = cc2

  • I_APPL_EVENTS = space

  • I_PARENTDBG =

  • I_APPLOGPARENT =

  • I_GRAPHICSPARENT =

  • I_NAME =

  • I_FCAT_COMPLETE = SPACE

  • EXCEPTIONS

  • ERROR_CNTL_CREATE = 1

  • ERROR_CNTL_INIT = 2

  • ERROR_CNTL_LINK = 3

  • ERROR_DP_CREATE = 4

  • others = 5

.

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 METHOD alv2->set_table_for_first_display

  • EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

  • I_STRUCTURE_NAME =

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

  • IS_LAYOUT =

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

  • IR_SALV_ADAPTER =

CHANGING

it_outtab = it_vbap

it_fieldcatalog = it_fieldcatalog2

  • IT_SORT =

  • IT_FILTER =

  • EXCEPTIONS

  • INVALID_PARAMETER_COMBINATION = 1

  • PROGRAM_ERROR = 2

  • TOO_MANY_LINES = 3

  • others = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDMETHOD. "handle_hotspot_click

*&--implement the event handler methods for top of page

method handle_top_of_page.

CALL METHOD e_dyndoc_id->display_document

EXPORTING parent = cc1.

*write:/5 'Desc :' , 'Sales Document Header & Items'.

*write:/5 'Date :' , sy-datum.

*write:/5 'Page no :' , sy-pagno.

endmethod.

ENDCLASS. "lcl_event_reciver IMPLEMENTATION

*&--data for event handler in hot spot click

DATA: event_handler TYPE REF TO lcl_event_reciver,

*&--data for event handler in top of page

o_dd_doc TYPE REF TO cl_dd_document.

*&--main logic

START-OF-SELECTION.

*&--vbak.

SELECT vbeln "SD Order

ernam "Name of the person who created

audat "Document Date

vbtyp "SD Document Category

auart "Type of Order

netwr "Net value in sales current doc currency

waerk "SD Document Currency

vkorg "Sales Organization

vtweg "Distribution Chanel

spart "Division

INTO TABLE it_vbak

FROM vbak

WHERE vbeln IN s_vbeln AND

audat IN s_audat.

IF sy-subrc <> 0.

MESSAGE e003 WITH text-003.

ENDIF.

CLEAR wa_fieldcatalog1 .

REFRESH it_fieldcatalog1 .

*&-POPULATING THE FIELD VBELN

wa_fieldcatalog1-col_pos = 1. "position of the column

wa_fieldcatalog1-fieldname = 'VBELN'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-hotspot = 'X'.

wa_fieldcatalog1-outputlen = 10. "output length of the field.

wa_fieldcatalog1-seltext = 'SD ORDER NUMBER'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD ERNAM

wa_fieldcatalog1-col_pos = 2. "position of the column

wa_fieldcatalog1-fieldname = 'ERNAM'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 12. "output length of the field.

wa_fieldcatalog1-seltext = 'NAME OF THE PERSON WHO CREATED'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD AUDAT

wa_fieldcatalog1-col_pos = 3. "position of the column

wa_fieldcatalog1-fieldname = 'AUDAT'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 8. "output length of the field.

wa_fieldcatalog1-seltext = 'DOCUMENT DATE'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD VBTYP

wa_fieldcatalog1-col_pos = 4. "position of the column

wa_fieldcatalog1-fieldname = 'VBTYP'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 1. "output length of the field.

wa_fieldcatalog1-seltext = 'DOCUMENT CATEGORY'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD AUART

wa_fieldcatalog1-col_pos = 5. "position of the column

wa_fieldcatalog1-fieldname = 'AUART'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 4. "output length of the field.

wa_fieldcatalog1-seltext = 'TYPE OF THE ORDER'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD NETWR

wa_fieldcatalog1-col_pos = 6. "position of the column

wa_fieldcatalog1-fieldname = 'NETWR'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 15. "output length of the field.

wa_fieldcatalog1-seltext = 'NET VALUE'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD WAERK

wa_fieldcatalog1-col_pos = 7. "position of the column

wa_fieldcatalog1-fieldname = 'WAERK'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 5. "output length of the field.

wa_fieldcatalog1-seltext = 'DOCUMENT CURRENCY'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD VKORG

wa_fieldcatalog1-col_pos = 8. "position of the column

wa_fieldcatalog1-fieldname = 'VKORG'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 4. "output length of the field.

wa_fieldcatalog1-seltext = 'SALES ORG'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD VTWEG

wa_fieldcatalog1-col_pos = 9. "position of the column

wa_fieldcatalog1-fieldname = 'VTWEG'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 2. "output length of the field.

wa_fieldcatalog1-seltext = 'DISTRIBUTION CHANEL'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

*&-POPULATING THE FIELD SPART

wa_fieldcatalog1-col_pos = 10. "position of the column

wa_fieldcatalog1-fieldname = 'SPART'. "field name

wa_fieldcatalog1-tabname = 'IT_VBAK'. "INTERNAL table name

wa_fieldcatalog1-ref_table = 'VBAK'. "FOR REFERENCE

wa_fieldcatalog1-outputlen = 2. "output length of the field.

wa_fieldcatalog1-seltext = 'DIVISION'.

"long key word

APPEND wa_fieldcatalog1 TO it_fieldcatalog1.

CLEAR wa_fieldcatalog1.

CREATE OBJECT cc1

EXPORTING

  • PARENT =

container_name = 'CUSTOMCONTROL1'

  • STYLE =

  • LIFETIME = lifetime_default

  • REPID =

  • DYNNR =

  • NO_AUTODEF_PROGID_DYNNR =

  • EXCEPTIONS

  • CNTL_ERROR = 1

  • CNTL_SYSTEM_ERROR = 2

  • CREATE_ERROR = 3

  • LIFETIME_ERROR = 4

  • LIFETIME_DYNPRO_DYNPRO_LINK = 5

  • others = 6

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT alv1

EXPORTING

  • I_SHELLSTYLE = 0

  • I_LIFETIME =

i_parent = cc1

  • I_APPL_EVENTS = space

  • I_PARENTDBG =

  • I_APPLOGPARENT =

  • I_GRAPHICSPARENT =

  • I_NAME =

  • I_FCAT_COMPLETE = SPACE

  • EXCEPTIONS

  • ERROR_CNTL_CREATE = 1

  • ERROR_CNTL_INIT = 2

  • ERROR_CNTL_LINK = 3

  • ERROR_DP_CREATE = 4

  • others = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT event_handler.

*&---set handler for hot spot click

SET HANDLER: event_handler->handle_hotspot_click FOR alv1,

*&---set handler for top of page

event_handler->handle_top_of_page for alv1.

CALL METHOD alv1->set_table_for_first_display

  • EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

  • I_STRUCTURE_NAME =

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

  • IS_LAYOUT =

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

  • IR_SALV_ADAPTER =

CHANGING

it_outtab = it_vbak

it_fieldcatalog = it_fieldcatalog1

  • IT_SORT =

  • IT_FILTER =

  • EXCEPTIONS

  • INVALID_PARAMETER_COMBINATION = 1

  • PROGRAM_ERROR = 2

  • TOO_MANY_LINES = 3

  • others = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*&--for hot spot click

CALL METHOD cl_gui_control=>set_focus

EXPORTING

control = alv1.

*&--for top of page

CALL METHOD alv1->list_processing_events

EXPORTING

i_event_name = 'TOP_OF_PAGE'

I_DYNDOC_ID = o_dd_doc

  • IS_SUBTOTTXT_INFO =

  • IP_SUBTOT_LINE =

  • I_TABLE_INDEX =

  • CHANGING

  • C_SUBTOTTXT =

.

CALL SCREEN 0101.

&----


*& Module STATUS_0101 OUTPUT

&----


  • text

----


MODULE status_0101 OUTPUT.

SET PF-STATUS 'Z9D_MENU1_ALV'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_0101 OUTPUT

&----


*& Module USER_COMMAND_0101 INPUT

&----


  • text

----


MODULE user_command_0101 INPUT.

CASE ok_code_0101.

WHEN 'BCK1'.

LEAVE PROGRAM.

ENDCASE.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 08:47 AM

    You cannot have top of page on and dynpro screen. You would need to have a section of your screen available to write the top of page details to.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 08:50 AM

    hi,

    as u r using oo alv,

    for the top_of_page to display,

    u need to do like this,

    <b>data: LS_PRINT TYPE LVC_S_PRNT.</b>

    <b>LS_PRINT-RESERVELNS = <some number>.</b>

    and also

    CALL METHOD GO_GRID->SET_TABLE_FOR_FIRST_DISPLAY

    EXPORTING

    IS_LAYOUT = LS_LVCLAYOUT

    IS_PRINT = <b>LS_PRINT</b>

    and by using the above procedure u can see the top of the page in <b>print preview only</b>

    Message was edited by:

    Hymavathi Oruganti

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 09:08 AM

    Go through below code,...

    REPORT Z_OO_ALV_TOP_OF_PAGE MESSAGE-ID ZZ .

    DATA: IT_FLIGHT TYPE TABLE OF SFLIGHT.

    DATA: OK_CODE LIKE SY-UCOMM,

    SAVE_OK LIKE SY-UCOMM.

    DATA: G_CONTAINER TYPE SCRFNAME VALUE 'CONTROL',

    O_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,

    O_SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,

    O_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER,

    O_PARENT_TOP TYPE REF TO CL_GUI_CONTAINER,

    O_HTML_CNTRL TYPE REF TO CL_GUI_HTML_VIEWER.

    CLASS LCL_EVENT_HANDLER DEFINITION .

    PUBLIC SECTION .

    METHODS:

    *Event Handler for Top of page

    TOP_OF_PAGE FOR EVENT TOP_OF_PAGE

    OF CL_GUI_ALV_GRID

    IMPORTING E_DYNDOC_ID.

    ENDCLASS. "lcl_event_handler DEFINITION

    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.

    METHOD TOP_OF_PAGE.

    • Top-of-page event

    PERFORM EVENT_TOP_OF_PAGE USING O_DYNDOC_ID.

    ENDMETHOD. "top_of_page

    ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION

    DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

    G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler

    START-OF-SELECTION.

    SELECT *

    FROM SFLIGHT

    UP TO 20 ROWS

    INTO TABLE IT_FLIGHT.

    END-OF-SELECTION.

    IF NOT IT_FLIGHT[] IS INITIAL.

    CALL SCREEN 100.

    ELSE.

    MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).

    ENDIF.

    MODULE STATUS_0100 OUTPUT.

    SET PF-STATUS 'STATUS'.

    SET TITLEBAR 'TITLE'.

    IF G_CUSTOM_CONTAINER IS INITIAL.

    PERFORM CREATE_AND_INIT_ALV.

    ENDIF.

    ENDMODULE. " STATUS_0100 OUTPUT

    MODULE USER_COMMAND_0100 INPUT.

    CASE SY-UCOMM.

    WHEN 'BACK'.

    LEAVE TO SCREEN 0.

    ENDCASE.

    ENDMODULE. " USER_COMMAND_0100 INPUT

    FORM CREATE_AND_INIT_ALV .

    DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.

    CREATE OBJECT G_CUSTOM_CONTAINER

    EXPORTING CONTAINER_NAME = G_CONTAINER.

    • Create TOP-Document

    CREATE OBJECT O_DYNDOC_ID

    EXPORTING STYLE = 'ALV_GRID'.

    • Create Splitter for custom_container

    CREATE OBJECT O_SPLITTER

    EXPORTING PARENT = G_CUSTOM_CONTAINER

    ROWS = 2

    COLUMNS = 1.

    CALL METHOD O_SPLITTER->GET_CONTAINER

    EXPORTING

    ROW = 1

    COLUMN = 1

    RECEIVING

    CONTAINER = O_PARENT_TOP.

    CALL METHOD O_SPLITTER->GET_CONTAINER

    EXPORTING

    ROW = 2

    COLUMN = 1

    RECEIVING

    CONTAINER = O_PARENT_GRID.

    • Set height for g_parent_html

    CALL METHOD O_SPLITTER->SET_ROW_HEIGHT

    EXPORTING

    ID = 1

    HEIGHT = 5.

    CREATE OBJECT G_GRID

    EXPORTING I_PARENT = O_PARENT_GRID.

    CREATE OBJECT G_HANDLER.

    SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.

    *Calling the Method for ALV output

    CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY

    EXPORTING

    I_STRUCTURE_NAME = 'SFLIGHT'

    CHANGING

    IT_OUTTAB = IT_FLIGHT[].

    CALL METHOD O_DYNDOC_ID->INITIALIZE_DOCUMENT

    EXPORTING

    BACKGROUND_COLOR = CL_DD_AREA=>COL_TEXTAREA.

    • Processing events

    CALL METHOD G_GRID->LIST_PROCESSING_EVENTS

    EXPORTING

    I_EVENT_NAME = 'TOP_OF_PAGE'

    I_DYNDOC_ID = O_DYNDOC_ID.

    ENDFORM. "CREATE_AND_INIT_ALV

    FORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.

    DATA : DL_TEXT(255) TYPE C. "Text

    CALL METHOD DG_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = 'Flight Details'

    SAP_STYLE = CL_DD_AREA=>HEADING

    SAP_FONTSIZE = CL_DD_AREA=>LARGE

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP

    EXPORTING

    WIDTH = 200.

    CALL METHOD O_DYNDOC_ID->ADD_PICTURE

    EXPORTING

    PICTURE_ID = 'ENJOYSAP_LOGO'.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CLEAR : DL_TEXT.

    • program ID

    DL_TEXT = 'Program Name :'.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CLEAR DL_TEXT.

    DL_TEXT = SY-REPID.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CLEAR : DL_TEXT.

    CLEAR : DL_TEXT.

    • program ID

    DL_TEXT = 'User Name :'.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CLEAR DL_TEXT.

    DL_TEXT = SY-UNAME.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CLEAR : DL_TEXT.

    • Run Date

    DL_TEXT = 'Run Date :'.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CLEAR DL_TEXT.

    • Move date

    WRITE SY-DATUM TO DL_TEXT.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CLEAR : DL_TEXT.

    *Time

    DL_TEXT = 'Time :'.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CLEAR DL_TEXT.

    • Move time

    WRITE SY-UZEIT TO DL_TEXT.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    PERFORM DISPLAY.

    ENDFORM. " EVENT_TOP_OF_PAGE

    FORM DISPLAY.

    • Creating html control

    IF O_HTML_CNTRL IS INITIAL.

    CREATE OBJECT O_HTML_CNTRL

    EXPORTING

    PARENT = O_PARENT_TOP.

    ENDIF.

    CALL METHOD O_DYNDOC_ID->MERGE_DOCUMENT.

    O_DYNDOC_ID->HTML_CONTROL = O_HTML_CNTRL.

    • Display document

    CALL METHOD O_DYNDOC_ID->DISPLAY_DOCUMENT

    EXPORTING

    REUSE_CONTROL = 'X'

    PARENT = O_PARENT_TOP

    EXCEPTIONS

    HTML_DISPLAY_ERROR = 1.

    IF SY-SUBRC NE 0.

    MESSAGE I999 WITH 'Error in displaying top-of-page'(036).

    ENDIF.

    ENDFORM. " display

    'Reward is it is helpful'.

    Thanks!

    Brunda

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi what code brunda suggested above is also correct.

      there is a class cl_dd_doculemt in which add_text is amethod using which u can get top_of_page.

      also for the method i mentioned the methos should be print_top_of-page.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 10:00 AM

    HI deepthi,

    check below code, you will see top-of-page in not only in the print preview but also in the output.Pls adjust the below code in your code. Dont change anything just copy and paste.

    DATA: G_CONTAINER TYPE SCRFNAME VALUE 'CONTROL',

    O_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,

    O_SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,

    O_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER,

    O_PARENT_TOP TYPE REF TO CL_GUI_CONTAINER,

    O_HTML_CNTRL TYPE REF TO CL_GUI_HTML_VIEWER.

    DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

    G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler

    CLASS LCL_EVENT_HANDLER DEFINITION .

    PUBLIC SECTION .

    METHODS:

    *Event Handler for Top of page

    TOP_OF_PAGE FOR EVENT TOP_OF_PAGE

    OF CL_GUI_ALV_GRID

    IMPORTING E_DYNDOC_ID.

    ENDCLASS. "lcl_event_handler DEFINITION

    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.

    METHOD TOP_OF_PAGE.

    • Top-of-page event

    PERFORM EVENT_TOP_OF_PAGE USING O_DYNDOC_ID.

    ENDMETHOD. "top_of_page

    ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION

    MODULE STATUS_0100 OUTPUT.

    SET PF-STATUS 'STATUS'.

    SET TITLEBAR 'TITLE'.

    IF cc1 IS INITIAL.

    PERFORM CREATE_AND_INIT_ALV.

    ENDIF.

    ENDMODULE.

    MODULE USER_COMMAND_0100 INPUT.

    CASE SY-UCOMM.

    WHEN 'BACK'.

    LEAVE TO SCREEN 0.

    ENDCASE.

    ENDMODULE. " USER_COMMAND_0100 INPUT

    FORM CREATE_AND_INIT_ALV .

    DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.

    CREATE OBJECT cc1

    EXPORTING CONTAINER_NAME = 'CUSTOMCONTROL1'.

    • Create TOP-Document

    CREATE OBJECT O_DYNDOC_ID

    EXPORTING STYLE = 'ALV_GRID'.

    • Create Splitter for custom_container

    CREATE OBJECT O_SPLITTER

    EXPORTING PARENT = cc1

    ROWS = 2

    COLUMNS = 1.

    CALL METHOD O_SPLITTER->GET_CONTAINER

    EXPORTING

    ROW = 1

    COLUMN = 1

    RECEIVING

    CONTAINER = O_PARENT_TOP.

    CALL METHOD O_SPLITTER->GET_CONTAINER

    EXPORTING

    ROW = 2

    COLUMN = 1

    RECEIVING

    CONTAINER = O_PARENT_GRID.

    • Set height for g_parent_html

    CALL METHOD O_SPLITTER->SET_ROW_HEIGHT

    EXPORTING

    ID = 1

    HEIGHT = 5.

    CREATE OBJECT G_GRID

    EXPORTING I_PARENT = O_PARENT_GRID.

    CREATE OBJECT G_HANDLER.

    SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.

    *Calling the Method for ALV output

    CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY

    EXPORTING

    I_STRUCTURE_NAME = 'IT_VBAK'

    CHANGING

    IT_OUTTAB = it_vbak[].

    CALL METHOD O_DYNDOC_ID->INITIALIZE_DOCUMENT

    EXPORTING

    BACKGROUND_COLOR = CL_DD_AREA=>COL_TEXTAREA.

    • Processing events

    CALL METHOD G_GRID->LIST_PROCESSING_EVENTS

    EXPORTING

    I_EVENT_NAME = 'TOP_OF_PAGE'

    I_DYNDOC_ID = O_DYNDOC_ID.

    ENDFORM. "CREATE_AND_INIT_ALV

    FORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.

    DATA : DL_TEXT(255) TYPE C. "Text

    CALL METHOD DG_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = (Here write the header for top-of-page)

    SAP_STYLE = CL_DD_AREA=>HEADING

    SAP_FONTSIZE = CL_DD_AREA=>LARGE

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP

    EXPORTING

    WIDTH = 200.

    • Using below code only if you require logo

    CALL METHOD O_DYNDOC_ID->ADD_PICTURE

    EXPORTING

    PICTURE_ID = 'ENJOYSAP_LOGO'.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CLEAR : DL_TEXT.

    • The below code is for printing program ID in the top-of-page

    DL_TEXT = 'Program Name :'.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CLEAR DL_TEXT.

    DL_TEXT = SY-REPID.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CLEAR : DL_TEXT.

    CLEAR : DL_TEXT.

    • below code is for print the username. Like this you can write what ever you want

    • in the top-of-page

    DL_TEXT = 'User Name :'.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CLEAR DL_TEXT.

    DL_TEXT = SY-UNAME.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CLEAR : DL_TEXT.

    • Run Date

    DL_TEXT = 'Run Date :'.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CLEAR DL_TEXT.

    • Move date

    WRITE SY-DATUM TO DL_TEXT.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    CLEAR : DL_TEXT.

    *Time

    DL_TEXT = 'Time :'.

    CALL METHOD DG_DYNDOC_ID->ADD_GAP.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.

    CLEAR DL_TEXT.

    • Move time

    WRITE SY-UZEIT TO DL_TEXT.

    CALL METHOD O_DYNDOC_ID->ADD_TEXT

    EXPORTING

    TEXT = DL_TEXT

    SAP_EMPHASIS = CL_DD_AREA=>HEADING

    SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.

    • Add new-line

    CALL METHOD DG_DYNDOC_ID->NEW_LINE.

    PERFORM DISPLAY.

    ENDFORM. " EVENT_TOP_OF_PAGE

    FORM DISPLAY.

    • Creating html control

    IF O_HTML_CNTRL IS INITIAL.

    CREATE OBJECT O_HTML_CNTRL

    EXPORTING

    PARENT = O_PARENT_TOP.

    ENDIF.

    CALL METHOD O_DYNDOC_ID->MERGE_DOCUMENT.

    O_DYNDOC_ID->HTML_CONTROL = O_HTML_CNTRL.

    • Display document

    CALL METHOD O_DYNDOC_ID->DISPLAY_DOCUMENT

    EXPORTING

    REUSE_CONTROL = 'X'

    PARENT = O_PARENT_TOP

    EXCEPTIONS

    HTML_DISPLAY_ERROR = 1.

    IF SY-SUBRC NE 0.

    MESSAGE I999 WITH 'Error in displaying top-of-page'(036).

    ENDIF.

    ENDFORM. " display

    'Reward if it is useful'.

    Thanks!

    Brunda

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.