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

Problem with alv print

Former Member
0 Likes
1,077

Hi,

I am using alv grid, there is a problem with print, when i look at print preview it shows only 1 row and even the values in that row are incorrect.

Please help me solv the problem.

Thanks,

Sai.

Hi,

I am using alv grid, there is a problem with print, when i look at print preview it shows only 1 row and even the values in that row are incorrect.

Please help me solv the problem.

Thanks,

Sai.

8 REPLIES 8
Read only

Former Member
0 Likes
1,060

check your internal table which your finally passing to the alv grid display

Read only

0 Likes
1,060

I am getting list OK, but when I try to look at the print preview, I get the above problem.

I have copied the GUI STATUS STANDARD_FULLSCREEN

into my programs status.

Edited by: Sai Mohan Das on Jul 10, 2008 10:15 AM

Edited by: Sai Mohan Das on Jul 10, 2008 10:18 AM

Read only

0 Likes
1,060

Sai,

try to display with the write statement and check whether the data is proper or not. then check the printpreview or the spool .....


Loop at itab.
   write :/ itab-f1 , itab-f2.
endloop.

reply back..

With Rgds,

S.Bharani

Read only

0 Likes
1,060

Hi Bharani,

I have no problem with my list, I can see the output of my list,

but when I try to print it I am facing the above problem.

Thanks,

Sai.

Read only

0 Likes
1,060

sai,

if u dont mine can u send me the code.....

With Rgds,

S.bharani

Read only

0 Likes
1,060

Here is the code

&----


*& Form DISPLAY

&----


  • text

----


FORM display.

DATA : fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.

*data : wa_fieldcat type slis_fieldcat_alv.

DATA : t_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader.

DATA : cnt(3) TYPE c VALUE 0.

  • cnt = cnt + 1.

fieldcatalog-fieldname = 'XBLNR'.

fieldcatalog-seltext_m = 'Invoice No'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 8.

fieldcatalog-tabname = 'it_final'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

cnt = cnt + 1.

fieldcatalog-fieldname = 'BLDAT'.

fieldcatalog-seltext_m = 'Invoice Date'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 9.

fieldcatalog-tabname = 'it_final'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

*CT3 No.

cnt = cnt + 1.

fieldcatalog-fieldname = 'SGTXT'.

fieldcatalog-seltext_m = 'CT3 No'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 8.

fieldcatalog-tabname = 'it_final'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

cnt = cnt + 1.

fieldcatalog-fieldname = 'MBLNR'.

fieldcatalog-seltext_m = 'GRR No.'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 10.

fieldcatalog-tabname = 'it_final'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

cnt = cnt + 1.

fieldcatalog-fieldname = 'BUDAT'.

fieldcatalog-seltext_m = 'GRR DATE'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 9.

fieldcatalog-tabname = 'it_final'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

cnt = cnt + 1.

fieldcatalog-fieldname = 'NAME1'.

fieldcatalog-seltext_m = 'Vendor Name'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 30.

fieldcatalog-tabname = 'it_final'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

cnt = cnt + 1.

fieldcatalog-fieldname = 'MATNR'.

fieldcatalog-seltext_m = 'Material No'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 18.

fieldcatalog-tabname = 'it_final'.

fieldcatalog-no_zero = 'X'.

fieldcatalog-key = 'X'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

cnt = cnt + 1.

fieldcatalog-fieldname = 'MAKTX'.

fieldcatalog-seltext_m = 'Matdesc'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 30.

fieldcatalog-tabname = 'it_final'.

fieldcatalog-key = 'X'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

**Excise Duty

  • cnt = cnt + 1.

  • fieldcatalog-fieldname = 'EDUTY'.

  • fieldcatalog-seltext_m = 'EXCISE DUTY '.

  • fieldcatalog-col_pos = cnt.

  • fieldcatalog-outputlen = 30.

  • fieldcatalog-tabname = 'it_final'.

  • fieldcatalog-do_sum = 'X'.

  • APPEND fieldcatalog TO fieldcatalog.

  • CLEAR fieldcatalog.

*Excise Duty

cnt = cnt + 1.

fieldcatalog-fieldname = 'DBDTY'.

fieldcatalog-seltext_m = 'DEBIT DUTY '.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 12.

fieldcatalog-tabname = 'it_final'.

fieldcatalog-do_sum = 'X'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

*Excise Duty

cnt = cnt + 1.

fieldcatalog-fieldname = 'CRDTY'.

fieldcatalog-seltext_m = 'CREDIT DUTY '.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 12.

fieldcatalog-tabname = 'it_final'.

fieldcatalog-do_sum = 'X'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

*Credit Date

cnt = cnt + 1.

fieldcatalog-fieldname = 'CRDAT'.

fieldcatalog-seltext_m = 'Cr. DATE'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 9.

fieldcatalog-tabname = 'it_final'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

*Closing Balance

cnt = cnt + 1.

fieldcatalog-fieldname = 'CL_BALANCE'.

fieldcatalog-seltext_m = 'BALANCE AMT'.

fieldcatalog-col_pos = cnt.

fieldcatalog-outputlen = 15.

fieldcatalog-tabname = 'it_final1'.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

i_callback_top_of_page = 'TOP-OF-PAGE'

it_fieldcat = fieldcatalog[]

i_save = 'X'

TABLES

t_outtab = it_final[]

EXCEPTIONS

program_error = 1

OTHERS = 2.

ENDFORM. "DISPLAY

*----


    • 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,

v_date1(10),

v_date2(10).

  • Title

wa_header-typ = 'H'.

wa_header-info = 'B-17 BOND REGISTER - INDIGENOUS RAW MATERIALS'.

APPEND wa_header TO t_header.

CLEAR wa_header.

  • Date

wa_header-typ = 'S'.

wa_header-key = ' Report generated on 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.

  • opening balance

wa_header-typ = 'S'.

wa_header-key = ' Opening Amount: '.

wa_header-info = gv_op_balance. "Opening amount

APPEND wa_header TO t_header.

CLEAR: wa_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_header.

  • i_logo = 'ENJOYSAP_LOGO'.

ENDFORM. "top-of-page

Read only

0 Likes
1,060

sai,

1. hav u included any customized pf-status ??

2. how u r generating the prinpreview ???

3. check whether u have given change layout option ???

With Rgds,

S.Bharani

Read only

0 Likes
1,060

The problem is solved, I gave wrong internal table name in my field catalog.

Thanks,

Sai.