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

PDF Convertion

Former Member
0 Likes
662

Hello all

We have an application to create a pdf of the timeslip of a user. We create a spool (ABAP List) and in the spool the abap list is ok (portrait, even if its X_90_132).

If we convert the spool with CONVERT_ABAPSPOOLJOB_2_PDF we get a working PDF but the format has changed to landscape. The text looks terrible, because there is allways to much space between the characters. The same line is now streched over the whole landscape line. Althought some part of the page is lost because only 54 lines are shown instead of 90.

Has anyone an idea how i should be able to convert the spool coorectly?

Best Regards

Stefan

Hello all

We have an application to create a pdf of the timeslip of a user. We create a spool (ABAP List) and in the spool the abap list is ok (portrait, even if its X_90_132).

If we convert the spool with CONVERT_ABAPSPOOLJOB_2_PDF we get a working PDF but the format has changed to landscape. The text looks terrible, because there is allways to much space between the characters. The same line is now streched over the whole landscape line. Althought some part of the page is lost because only 54 lines are shown instead of 90.

Has anyone an idea how i should be able to convert the spool coorectly?

Best Regards

Stefan

3 REPLIES 3
Read only

Former Member
0 Likes
605

Hi Stefan,

i use it in this way:

REPORT ZGRO_PDF_SPOOL_DOWNLOAD.

*

DATA: FILESIZE TYPE I.

DATA: SPOOL_NR LIKE TSP01-RQIDENT.

*

DATA: BEGIN OF PDF_OUTPUT OCCURS 0.

INCLUDE STRUCTURE TLINE.

DATA: END OF PDF_OUTPUT.

*

START-OF-SELECTION.

*

SPOOL_NR = 7909.

*

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

EXPORTING

SRC_SPOOLID = SPOOL_NR

IMPORTING

PDF_BYTECOUNT = FILESIZE

TABLES

PDF = PDF_OUTPUT

EXCEPTIONS

ERR_NO_ABAP_SPOOLJOB = 1

ERR_NO_SPOOLJOB = 2

ERR_NO_PERMISSION = 3

ERR_CONV_NOT_POSSIBLE = 4

ERR_BAD_DESTDEVICE = 5

USER_CANCELLED = 6

ERR_SPOOLERROR = 7

ERR_TEMSEERROR = 8

ERR_BTCJOB_OPEN_FAILED = 9

ERR_BTCJOB_SUBMIT_FAILED = 10

ERR_BTCJOB_CLOSE_FAILED = 11

OTHERS = 12.

*

CHECK SY-SUBRC = 0.

*

  • Download Spool

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = FILESIZE

FILENAME = 'D:\TESTPDF.PDF'

FILETYPE = 'BIN'

TABLES

DATA_TAB = PDF_OUTPUT.

*

I have no Problems. Do you make the same Download?

Regards, Dieter

Read only

anversha_s
Active Contributor
0 Likes
605

hi stefan,

chk this link.

http://www.erpgenie.com/sap/abap/pdf_creation.htm

exactly ur requirement is there.

rgds

anver

if helpful pls mark points

Read only

Former Member
0 Likes
605

First thx for the help

@Dieter Gröhn

On a 4.70 System I use:

call function 'CONVERT_ABAPSPOOLJOB_2_PDF'

exporting

src_spoolid = spoolid

importing

pdf_bytecount = numbytes

tables

pdf = pdf_line_tab.

call method cl_bsp_utility=>download

exporting

content_type = 'application/pdf'

content_disposition = 'attachment; filename=zeitwirtschaft.pdf'

response = response

navigation = navigation

object_t = pdf_line_tab.

On a ERP-System i have to convert the to xstring, because the cl_bsp_utility=>download only accept a table type x as of this release...

call function 'CONVERT_ABAPSPOOLJOB_2_PDF'

exporting

src_spoolid = spoolid

importing

pdf_bytecount = numbytes

tables

pdf = pdf_line_tab.

data: spool_nr type tsp01-rqident,

pdf_tab_line type tline.

field-symbols

type x.

loop at pdf_line_tab into pdf_tab_line.
assign pdf_tab_line to

casting type x.
concatenate pdf_line_xstring

into pdf_line_xstring in byte mode.
endloop.

cl_bsp_utility=>

download(

content_type = 'application/pdf'

content_disposition = 'attachment; filename=zeitwirtschaft.pdf'

response = response

navigation = navigation

object_s = pdf_line_xstring

).

But even if I use the download function its the same result.

@anver

Thx for the link. I just get an error 127 if I try to use the programm. Just to be sure, the Ident is the Spool-ID?

Interner Fehler 127/ 127 im Spooler (obsolete c-call: rspoarsd_abap_read_spool_dataset)

Any Ideas?

Best Regard

Stef