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

sapscript spool number for pdf conversion after script goes to printer

Former Member
0 Likes
671

Hi Gurus,

I am working on SAPscript. The print program I am using is RM08NAST for printing ERS SAPscript.

The routine MRM_ENTRY_ERS under that program does all the data selection and printing of script.

Now the functional team wants to get the OTF format converted in pdf.

(<b>Note: I know how to convert the things in pdf. So please don't provide with links which shows pdf conversion. My problem is different)</b>

I cannot use any pdf converison function module because then I have to change the standard function module MRM_ENTRY_ERS which is not good idea because its very complex.

So I am planning to use the pdf conversion function module CONVERT_OTFSPOOLJOB_2_PDF immediately after the MRM_ENTRY_ERS.

1) But I need the spool number then ? How do I get it.

2) I guess as soon as the MRM_ENTRY_ERS gets executed the Script will get displayed or get printed on printer.

So if I am using the function module CONVERT_OTFSPOOLJOB_2_PDF after routine MRM_ENTRY_ERS, if I want to save that pdf what do I do ?

Thanks.

Regards,

Tushar.

3 REPLIES 3
Read only

Former Member
0 Likes
549

Hi,

You can use the following code, once you get the spoolid...

You can get that, by date and time stamp, just immediately after the MRM_ENTRY_ERS.

Regards,

Raj

SELECT SINGLE * FROM tsp01 WHERE rqident = rspoid.

client = tsp01-rqclient.

name = tsp01-rqo1name.

CALL FUNCTION 'RSTS_GET_ATTRIBUTES'

EXPORTING

authority = 'SP01'

client = client

name = name

part = 1

IMPORTING

type = type

objtype = objtype

EXCEPTIONS

fb_error = 1

fb_rsts_other = 2

no_object = 3

no_permission = 4.

IF objtype(3) = 'OTF'.

isotf = 'X'.

ELSE.

isotf = space.

ENDIF.

IF isotf = 'X'.

CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

EXPORTING

src_spoolid = rspoid

no_dialog = ' '

IMPORTING

pdf_bytecount = pdf_bytecount

pdf_spoolid = pdf_spoolid

btc_jobname = btc_jobname

btc_jobcount = btc_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.

CALL FUNCTION 'RSPO_IDELETE_SPOOLREQ'

EXPORTING

spoolreq = spoolreq

EXCEPTIONS

OTHERS = 2.

ENDIF.

Read only

0 Likes
549

Hi Raj,

After I get the conversion done in pdf format, I need a small dialog pop up which will say where you want to save the converted pdf file and the pdf converted file should get saved there. How do I achieve this ? This might be a basic ABAP question, but please help...

Rajesh.

Read only

0 Likes
549

SY-SPONO contain spool number.

Use POPUP_TO_CONFIRM fm to popup a scree.

REgards

Sridhar