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

alv ouput in html format

Former Member
0 Likes
1,182

hi abapers,

iam scheduling a report in background..and spool is genarated and that spool output is sent as mail..

but in my spool there are two pages..with reapeat heading..

ex:

for page 1.

xxxxxxx comapny

123 12323 2323 23232

for page 2

xxxxxx comapny

1233 3432 35433 3435

here in page2 the heding is again apperaing

i don't to repeat the agaain for page2 also.

can any help me......

hi abapers,

iam scheduling a report in background..and spool is genarated and that spool output is sent as mail..

but in my spool there are two pages..with reapeat heading..

ex:

for page 1.

xxxxxxx comapny

123 12323 2323 23232

for page 2

xxxxxx comapny

1233 3432 35433 3435

here in page2 the heding is again apperaing

i don't to repeat the agaain for page2 also.

can any help me......

11 REPLIES 11
Read only

Former Member
0 Likes
1,144

I guess you are using the top of page event, use the top of list event and the header will be printed only once at the top of the list.

regards,

Advait

Read only

0 Likes
1,144

Thanks for u r reply..

i tried both top-of-list and top-of-page..

but still iam unable to supress page heading for second page..

Read only

0 Likes
1,144

Use only top-of-list and not both.

regards,

Advait

Read only

0 Likes
1,144

ok,

but i tried with top-of-list also bt still same problem is repeating..

Read only

0 Likes
1,144

That is strange, top of list should get triggered only once at the beginning of the list. Can you paste your code here? So we can see what is wrong with it.

regards,

Advait

Read only

0 Likes
1,144

<< Unformatable code removed >>

Please just post the relevant portion

Edited by: Rob Burbank on May 5, 2009 10:47 AM

Read only

0 Likes
1,144

FORM write_data .

PERFORM build_catlogue.

PERFORM build_layout USING fieldlayout.

PERFORM fill_eventstab TABLES eventstab.

****by sagun desai 06.06.2007 req by Sharma

ls_variant-report = sy-repid.

IF sy-uname EQ 'UPLABAP' .

PERFORM display_list.

ELSE.

PERFORM display_list1.

ENDIF.

****end by sagun

ENDFORM.

********************************

iam desigining my catalog here

*************************************

FORM build_layout USING fieldlayout TYPE slis_layout_alv.

fieldlayout-f2code = '&ETA'.

fieldlayout-zebra = 'X'.

fieldlayout-key_hotspot = 'X'.

fieldlayout-detail_popup = 'X'.

fieldlayout-cell_merge = 'X'.

ENDFORM. " build_layout

FORM fill_eventstab TABLES p_eventstab STRUCTURE eventstab.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = p_eventstab[]

EXCEPTIONS

list_type_wrong = 1

OTHERS = 2.

READ TABLE p_eventstab WITH KEY name = slis_ev_top_of_page.

IF sy-subrc = 0 .

MOVE 'TOP_OF_LIST' TO p_eventstab-form.

APPEND p_eventstab.

ENDIF.

ENDFORM. " fill_eventstab

FORM top_of_list.

CLEAR: heading,heading[].

heading-typ = 'H'.

  • HEADING-INFO = 'New DPR for Formulation plants'.

heading-info = 'Advanta India Ltd'.

APPEND heading.

heading-typ = 'H'.

heading-info = 'Daily production & Despatch report of Field Crops PackedSeed'.

APPEND heading.

heading-typ = 'A'.

heading-info = 'All figures are in KG / EA '.

APPEND heading.

heading-typ = 'A'.

heading-info = 'Report for only those products,produced/planned inthis month'.

APPEND heading.

heading-info = 'All stocks are current stk'.

APPEND heading.

FORM display_list .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZPPR_ADV_DPR5'

is_layout = fieldlayout

it_fieldcat = lt_fieldcat

i_default = 'X'

i_save = 'A'

is_variant = ls_variant

it_events = eventstab[]

TABLES

t_outtab = it_final.

ENDFORM. " display_list

Read only

0 Likes
1,144

On thing I noticed in your code is that you are using incorrect event name while reading the events internal table, because of this, the subroutine top_of_list is getting called for each new page.


FORM fill_eventstab TABLES p_eventstab STRUCTURE eventstab.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 0
    IMPORTING
      et_events       = p_eventstab[]   ---> Use another internal table and read that and append to p_eventstab
    EXCEPTIONS
      list_type_wrong = 1
      OTHERS          = 2.

  READ TABLE p_eventstab WITH KEY name = slis_ev_top_of_page.   " I guess this should be slis_ev_top_of_list
  IF sy-subrc = 0 .
    MOVE 'TOP_OF_LIST' TO p_eventstab-form.
    APPEND p_eventstab.                     " Here use another internal table  
  ENDIF.
ENDFORM.                    " fill_eventstab

Here is the changed code


FORM fill_eventstab TABLES p_eventstab STRUCTURE eventstab.

  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 0
    IMPORTING
      et_events       = lt_eventstab[]   "--->declare local lt_eventtab
    EXCEPTIONS
      list_type_wrong = 1
      OTHERS          = 2.

  READ TABLE lt_eventstab WITH KEY name = slis_ev_top_of_list.  " Read lt_eventab
  IF sy-subrc = 0 .
    MOVE 'TOP_OF_LIST' TO p_eventstab-form.
    APPEND p_eventstab.
  ENDIF.
ENDFORM.                    " fill_eventstab

Hope this solves your issue.

regards,

Advait

Edited by: Advait Gode on May 5, 2009 4:37 PM

Read only

0 Likes
1,144

thanks for u reply,,

i added tha code u have given,

but probelm is heading is not appearing,hence in events table it is top-of-list ,it is displaying only list..

Read only

Former Member
0 Likes
1,144

Hi,

Can u paste ur code .

Regards.

Read only

Former Member
0 Likes
1,144

still nobody in sdn rectified the sol for this, iam forcebly closing this thread