Skip to Content
author's profile photo Former Member
Former Member

CONVERT_ABAPSPOOLJOB_2_PDF doesnt prompt to save the filename

Dear all

Here with this i m getting the spool but CONVERT_ABAPSPOOLJOB_2_PDF doesnt prompt to save the PDF file . Do i need to use GUI_DOWNLOAD along with this .

PlllllZZZZZZ...... suggest

SELECT SINGLE * FROM ZPLH WHERE VBELN = SSORD

AND POSNR = ITNO.

IF SY-SUBRC EQ 0.

DATA : v_jobcount LIKE tbtcjob-jobcount,

ZTEST LIKE TBTCJOB-JOBNAME.

*-- run in the background

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = 'ZTEST'

IMPORTING

jobcount = v_jobcount

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

EXIT.

ENDIF.

*-- submit the program in the background

SUBMIT ZPP_REP_ENCLOSURE_PACKLIST3

WITH JOBNO = SSORD

WITH LINENO = ITNO

USER sy-uname

TO SAP-SPOOL WITHOUT SPOOL DYNPRO

DESTINATION 'LOHP'

IMMEDIATELY 'X'

KEEP IN SPOOL 'X'

VIA JOB 'ZTEST' NUMBER v_jobcount AND RETURN.

IF SY-SUBRC = 0.

  • * Job scheduled successfully

ENDIF.

IF SY-SUBRC = 4.

  • *Job scheduling terminated by user

ENDIF.

IF SY-SUBRC = 8.

  • *Error in job scheduling (JOB_SUBMIT)

ENDIF.

IF SY-SUBRC = 12.

  • *Error in internal number assignment .

ENDIF.

*-- close the job

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = v_jobcount

jobname = 'ZTEST'

strtimmed = 'X'

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

IF sy-subrc <> 0.

  • MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno

  • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

clear tbtcp.

STEP = 1.

select single listident from tbtcp

into tbtcp-listident

where jobname = 'ZTEST'

and jobcount = v_jobcount

and stepcount = step.

IF SY-SUBRC EQ 0.

move tbtcp-listident to spool_id.

ENDIF.

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

EXPORTING

SRC_SPOOLID = SPOOL_ID

NO_DIALOG = ''

  • DST_DEVICE = 'LOHP' "E_DEVTYPE

  • PDF_DESTINATION = 'LOHP'

IMPORTING

PDF_BYTECOUNT = BTC

  • PDF_SPOOLID =

  • LIST_PAGECOUNT =

  • BTC_JOBNAME =

  • BTC_JOBCOUNT =

TABLES

PDF = T_SPOOL_2_PDF

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

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ELSE.

TEXT02 = ITNO.

MESSAGE I014(ZQOTBANK) WITH TEXT02.

ENDIF.

Thnx

Moni

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 25, 2005 at 09:21 AM

    Hi MD,

    I download the result of the function like this :

    call function 'CONVERT_OTFSPOOLJOB_2_PDF'

    exporting

    src_spoolid = v_spoolid

    NO_DIALOG = 'X'

    IMPORTING

    PDF_BYTECOUNT = v_numbytes

    TABLES

    PDF = it_pdf.

    call function 'DOWNLOAD'

    exporting

    bin_filesize = v_numbytes

    filetype = 'BIN'

    importing

    act_filename = v_filename

    tables

    data_tab = it_pdf.

    Regards

    Frédéric

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2005 at 11:09 AM

    Hi Monirujjaman,

    Have a look at demo program RSTXPDFT4.

    Thanks

    Lakshman

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.