‎2009 Feb 08 9:02 AM
‎2009 Feb 08 9:09 AM
‎2009 Feb 08 9:47 AM
My Code generate a basic report then i will generate the pdf file.
It is not a smartform.
BR,
Ali
‎2009 Feb 08 9:56 AM
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.
‎2009 Feb 08 10:06 AM
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'.
‎2009 Feb 08 10:25 AM
‎2009 Feb 08 10:38 AM
My Report or Final data is comming from different tables, so that i can not download it directly from one inernal table.
br,
ali
‎2009 Feb 08 1:15 PM
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
‎2009 Feb 09 6:06 AM
Hi Ali,
Is the above solution working... Please do let me know if you have got any other solution as well...
Regards,
Siddarth
‎2009 Feb 09 11:14 AM
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.
‎2009 Feb 09 12:48 PM
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
‎2009 Feb 09 12:55 PM
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.
‎2009 Feb 09 1:04 PM
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
‎2009 Feb 09 1:27 PM
hi Siddharth Chordia ,
Can u explain more about ur solution.
Because i already i have the FM download.
what is the differences.?
‎2009 Feb 09 1:32 PM
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
‎2009 Feb 10 4:43 AM
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
‎2009 Feb 10 11:01 AM
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
‎2009 Feb 09 11:18 AM
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.
‎2009 Feb 09 11:38 AM
my code sequence like this:
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
CALL FUNCTION 'DOWNLOAD'
where i should put FM you suggested.
BR,
ali
‎2009 Feb 09 11:45 AM
Put it after:
CALL FUNCTION 'DOWNLOAD'
Let me know if it is working as per your requirement.
Regards,
Nitin.
‎2009 Feb 09 12:11 PM
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.
‎2009 Feb 09 11:31 AM
‎2009 Mar 25 7:35 AM