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 + pdf

Former Member
0 Likes
1,045

Hi Experts,

i have an alv grid with top of page (few lines) and end of page (few lines) and details lines.

i have converted this alv grid to pdf using the FM "CONVERT_ABAPSPOOLJOB_2_PDF".

But i dont know how to include my top of page and the end of page in this PDF converted file.

Thanks

Hi Experts,

i have an alv grid with top of page (few lines) and end of page (few lines) and details lines.

i have converted this alv grid to pdf using the FM "CONVERT_ABAPSPOOLJOB_2_PDF".

But i dont know how to include my top of page and the end of page in this PDF converted file.

Thanks

6 REPLIES 6
Read only

former_member194669
Active Contributor
0 Likes
999

You may need to look into demo program

BCALV_GRID_01

Read only

Former Member
0 Likes
999

try using this prog RSTXPDFT4, feed the spool number of ALV run in background

Read only

Former Member
0 Likes
999

Hi,

Thanks for your replies.

I have the same problem with RSTXPDFT4, i cannot have the top of page and the end of page in the converted pdf file (i have only detailed lines of alv).

However i can see the top and the end of page in the original alv (without conversion)

my code is like this:

{

FORM GENERATE_PDF .

}

w_print-print = 'X'.

NEW-PAGE PRINT ON NO DIALOG PARAMETERS wa_pri_params. "create spool request

PERFORM DISPLAY_ALV_GRID .

NEW-PAGE PRINT OFF. "closing spool request

w_spool = sy-spono.

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

EXPORTING

SRC_SPOOLID = w_spool

NO_DIALOG = 'X'

DST_DEVICE = 'LP01'

  • PDF_DESTINATION = 'X'

  • IMPORTING

  • PDF_BYTECOUNT =

  • PDF_SPOOLID =

  • LIST_PAGECOUNT =

  • BTC_JOBNAME =

  • BTC_JOBCOUNT =

TABLES

PDF = it_pdf

EXCEPTIONS.....

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = 'C:\RO.pdf'

FILETYPE = 'BIN'

TABLES

DATA_TAB = it_pdf

EXCEPTIONS.......

FORM DISPLAY_ALV_GRID .

SORT IT_LIST1 BY num_observation.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = sy-repid

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

I_CALLBACK_HTML_TOP_OF_PAGE = 'HTML_TOP_OF_PAGE'

I_CALLBACK_HTML_END_OF_LIST = 'HTML_END_OF_LIST'

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = w_layout

IT_FIELDCAT = wt_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS = it_events

  • IT_EVENT_EXIT =

IS_PRINT = w_print

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = it_list1[]

EXCEPTIONS......

ENDFORM. " DISPLAY_ALV_GRID

}

Edited by: abybak abybak on Aug 11, 2009 10:46 AM

Edited by: abybak abybak on Aug 11, 2009 10:49 AM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
999

Hello,

I find you have used the params I_CALLBACK_HTML_TOP_OF_PAGE & I_CALLBACK_HTML_END_OF_LIST to display your TOP-OF-PAGE & END-OF-LIST texts.

Please note that the HTML texts can only be used for Online display. They cannot be printed & hence be converted to PDF.

Please correct me if i am wrong.

BR,

Suhas

Read only

Former Member
0 Likes
999

Hi Suhas,

Thank you for your help, you are right, when i changed I_CALLBACK_HTML_TOP_OF_PAGE parameter to TOP_OF_PAGE parameter i could see the header in the pdf file.

but i used I_CALLBACK_HTML_TOP_OF_PAGE because my header (top of page) must be formatted , for example:

Header: field1 (left) field2 (centre) field3 (right) and so on..

And with this parameter ( I_CALLBACK_HTML_TOP_OF_PAGE) i can use METHOD document->add_text and METHOD document->add_gap, this method allow me to format my header, but with TOP_OF_PAGE parameter i can only use (in my mind) the FM 'REUSE_ALV_COMMENTARY_WRITE' with an internal table t_header and my header cannot be formatted with this FM.

Please correct me if i am wrong.

Best regards.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
999

Hello,

Your observation is perfectly correct.

If you use the COMMENTARY_WRITE stmt then you cannot have all the formatting options offered by I_CALLBACK_HTML_TOP_OF_PAGE. And moreover you donot have any options for END_OFLIST other than the HTML one.

I will suggest if you need the PDF download, you better switch to ALV List.

BR,

Suhas