Application Development 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: 

How to retrieve data from last page of spool

Former Member
0 Kudos

Hi Experts,

Is there any FM available , which I can use to fetch data on last page of a spool created by a background job running for a report.

I tried to use RSPO_L_RETURN_RAW_DATA , but dont know the various parameters value to be passed for fetching data for last page only.

Please suggest

-Thanks ,

harkamal

1 REPLY 1

Former Member
0 Kudos

Hi,

You can try this:

CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

EXPORTING

SRC_SPOOLID = spoolno

NO_DIALOG = ' '

  • DST_DEVICE =

  • PDF_DESTINATION =

IMPORTING

PDF_BYTECOUNT = numbytes

PDF_SPOOLID = pdfspoolid

  • OTF_PAGECOUNT =

BTC_JOBNAME = jobname

BTC_JOBCOUNT = jobcount

TABLES

PDF = pdf

EXCEPTIONS

ERR_NO_OTF_SPOOLJOB = 1

ERR_NO_SPOOLJOB = 2

ERR_NO_PERMISSION = 3

ERR_CONV_NOT_POSSIBLE = 4

ERR_BAD_DSTDEVICE = 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.

case sy-subrc.

when 0.

perform bd_textbox_msg(rstxpdft) using 80

'Funktion CONVERT_OTFSPOOLJOB_2_PDF erfolgreich'(001).

when 1.

perform bd_textbox_err(rstxpdft) using 80

'Kein OTF- und kein ABAP-Spoolauftrag'(002).

exit.

when 2.

perform bd_textbox_err(rstxpdft) using 80

'Spoolauftrag existiert nicht'(003).

exit.

when 3.

perform bd_textbox_err(rstxpdft) using 80

'Keine Berechtigung zum Lesen Spoolauftrag'(004).

exit.

when others.

perform bd_textbox_err(rstxpdft) using 80

'Fehler bei Funktion CONVERT_OTFSPOOLJOB_2_PDF'(005).

exit.

endcase.

cheers

Aveek