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 without using spool

Former Member
0 Likes
2,346

can i create a pdf file without send a request to spool.

22 REPLIES 22
Read only

Former Member
0 Likes
2,249

Hi Ali,

Refer the following link:

Regards,

Nitin.

Read only

0 Likes
2,249

My Code generate a basic report then i will generate the pdf file.

It is not a smartform.

BR,

Ali

Read only

Former Member
0 Likes
2,249

Then you can directly download an internal table in PDF format with FM GUI_DOWNLOAD

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'C:\test.pdf'

FILETYPE = 'BIN'

TABLES

DATA_TAB = ITAB

EXCEPTIONS

FILE_WRITE_ERROR = 1

NO_BATCH = 2

GUI_REFUSE_FILETRANSFER = 3

INVALID_TYPE = 4

OTHERS = 5.

Hope this will help.

Regards,

Nitin.

Read only

0 Likes
2,249

I use this code

SUBMIT YER00268 TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_loc_mstr_print_parms

WITH SELECTION-TABLE i_int_seltab

AND RETURN.

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'.

CALL FUNCTION 'DOWNLOAD'.

Read only

Former Member
0 Likes
2,249

Is it working fine now ?

Read only

0 Likes
2,249

My Report or Final data is comming from different tables, so that i can not download it directly from one inernal table.

br,

ali

Read only

0 Likes
2,249

Hi,

Once you get the final data in all your tables, you can club them in one single internal table having all the fields, so that it helps you in passing this table to make your PDF

and then you can use the function module....

call function gui_upload.

Regards,

Siddarth

Read only

0 Likes
2,249

Hi Ali,

Is the above solution working... Please do let me know if you have got any other solution as well...

Regards,

Siddarth

Read only

0 Likes
2,249

What you suggested not solve my problem , since i have different internal table and my report come up from the collection of those.

Also, what i have right now i user FM to conver the spool to pdf.

I need to skip the basic list to appear after i save the pdf file.

Read only

0 Likes
2,249

Hi Ali,

What i wanted to say is,

say for example

you have two internal table ex. itab1 and itab2.

then create a table itab3 which has all the fields of itab1 and itab2.

move all the data from itab1 and itab2 to itab3.

then you can use itab3 to download.

Hope this helps.

Regards,

Siddarth

Read only

0 Likes
2,249

Ur idea is OK with me. I already know about it.

But i need to take my report output as it is and save it in pdf.

I do not like to save the row data.

There is a report already setup and i want to keep the layout of it.

that why i can not save to pdf directly.

Read only

0 Likes
2,249

ah ok,

In this case you can have a simple solution,,,, once your report list is generated. run the loop at given below..

data :

begin of fs_itab,

lisel like sy-lisel,

end of fs_itab.

data : t_itab like table of fs_itab.

data : w_lines type i.

describe list number of lines w_lines index sy-lsind.

do w_lines times.

read line sy-index.

append sy-lisel to t_itab.

enddo.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = '<file_name>.pdf'

FILETYPE = 'BIN'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE

  • SHOW_TRANSFER_STATUS = ABAP_TRUE

  • IMPORTING

  • FILELENGTH =

tables

data_tab = t_itab

  • FIELDNAMES =

  • EXCEPTIONS

  • FILE_WRITE_ERROR = 1

  • NO_BATCH = 2

  • GUI_REFUSE_FILETRANSFER = 3

  • INVALID_TYPE = 4

  • NO_AUTHORITY = 5

  • UNKNOWN_ERROR = 6

  • HEADER_NOT_ALLOWED = 7

  • SEPARATOR_NOT_ALLOWED = 8

  • FILESIZE_NOT_ALLOWED = 9

  • HEADER_TOO_LONG = 10

  • DP_ERROR_CREATE = 11

  • DP_ERROR_SEND = 12

  • DP_ERROR_WRITE = 13

  • UNKNOWN_DP_ERROR = 14

  • ACCESS_DENIED = 15

  • DP_OUT_OF_MEMORY = 16

  • DISK_FULL = 17

  • DP_TIMEOUT = 18

  • FILE_NOT_FOUND = 19

  • DATAPROVIDER_EXCEPTION = 20

  • CONTROL_FLUSH_ERROR = 21

  • OTHERS = 22

.

hope this works for you...

Regards,

Siddarth

Read only

0 Likes
2,249

hi Siddharth Chordia ,

Can u explain more about ur solution.

Because i already i have the FM download.

what is the differences.?

Read only

0 Likes
2,249

Hi,

In this,

firstly the report is generated,

since you wanted the list to be displayed as it is in the pdf...

I read each line of the list and then copied it in an internal table which has only one field as sy-lisel...

then that is being downloaded to your presentation server as pdf using gui_download....

Hope i am clear

Regards,

Siddarth

Read only

0 Likes
2,249

hi Siddarth

your answer very helpfull

but the pdf file is empty. I do no why.

Although, the internal table is full with my data.

Pls. fast reply

BR,

Ali

Read only

0 Likes
2,249

Hi,

I dont think its possible for us to create a pdf format directly without using spool...

In this case you might have to use these function modules

RSPO_SX_OUTPUT_TEXTDATA - sending internal table data to spool creation

this will return the spool request number

and then with this number you can

CONVERT_OTFSPOOLJOB_2_PDF - spool to PDF conversion

Hope this helps you

Regards,

Siddarth

Read only

Former Member
0 Likes
2,249

Hi Ali,

You can do one thing. You can create PDF using spool and then immidiately delete the spool using FM 'RSPO_IDELETE_SPOOLREQ'.

Regards,

Nitin.

Read only

0 Likes
2,249

my code sequence like this:

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

CALL FUNCTION 'DOWNLOAD'

where i should put FM you suggested.

BR,

ali

Read only

0 Likes
2,249

Put it after:

CALL FUNCTION 'DOWNLOAD'

Let me know if it is working as per your requirement.

Regards,

Nitin.

Read only

0 Likes
2,249

It give me the following error

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught and

therefore caused a runtime error.

The reason for the exception is:

The call to the function module "RSPO_IDELETE_SPOOLREQ" is incorrect:

In the function module interface, you can specify only

fields of a specific type and length under "SPOOLREQ".

Although the currently specified field

"V_LOC_RQIDENT" is the correct type, its length is incorrect.

Read only

Former Member
0 Likes
2,249

This message was moderated.

Read only

Former Member
0 Likes
2,249

solved