How to convert Classical Report into PDF format..........
Hi Experts,
I have written a classical report with write statements and when i am downloading in excel the format is mismatching and now i want to convert into PDF format.
How to convert into PDF format from Classical report ?
Yusuf
Hi yusuf,
please find the below report,,
please make two include programs before executing it,
there codes are pasted below,
INCLUDE zimpr_data_declaration.
INCLUDE zimpr_performs_wrap.
REPORT zimpr_word_wrap NO STANDARD PAGE HEADING LINE-SIZE 115..
INCLUDE for DATA DECLARATION *
INCLUDE zimpr_data_declaration.
INCLUDE for all performs. *
INCLUDE zimpr_performs_wrap.
TOP-OF-PAGE--
TOP-OF-PAGE.
PERFORM f_top_page. "TOP OF THE REPORT PAGE,I.E. HEADER.
START-OF-SELECTION.
SET PF-STATUS 'SEL_SCREEN'. "PF-STATUS OF THE SELECTION SCREEN.
PERFORM f_data_retrieval. "PERFORM FOR ALL SELECT STATEMENTS.
PERFORM f_report_display. "REPORT DISPLAY,WRITE STATEMENTS.
--Define the actions to be performed for pf-status-----
AT USER-COMMAND.
wf_ok_code = sy-ucomm.
wf_save_ok = wf_ok_code.
CLEAR wf_ok_code.
CASE wf_save_ok.
WHEN 'PDF'. "WHEN PDF ICON IS CLICKED,REPORT WILL CONVERT INTO PDF.
loc_repid = sy-repid. "PROGRAM NAME
--THIS FM SETS THE PARAMETERS FOR LAYOUT OF PDF OUTPUT--
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
layout = loc_paart "LANDSCAPE LAYOUT
line_size = loc_linsz "CHARACTER WIDTH OF REPORT
no_dialog = 'X'
user = sy-uname "USERNAME
IMPORTING
out_parameters = loc_print_parms "OUTPUT PARAMETERS WILL BE COLLECTED HERE.
valid = loc_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
--FOR GENERATING THE SPOOL NUMBER--
NEW-PAGE PRINT ON NO DIALOG PARAMETERS loc_print_parms. " This allocates the spool no
"to the screen without the dialog screen.
PERFORM f_top_page.
PERFORM f_report_display.
NEW-PAGE PRINT OFF. "This marks the end of the screen for which the spool no was generated.
wf_id = sy-spono. " This assign the spool no of the screen to the variable.
--PERFORM FOR GETTING THE PDF OUTPUT--
PERFORM f_pdf_display.
--PERFORM FOR DOWLOADING FILE TO A LOCAL DISK--
PERFORM f_download_local.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
include data declaration----
*& Include ZIMPR_DATA_DECLARATION
TYPE-POOLS : shlp.
DATA : wf_ordert TYPE aufk-auart. "ORDER TYPE
DATA : wf_order TYPE aufk-aufnr. "ORDER NUMBER
DATA : wf_bdate TYPE afko-gstrp. "BASIC START DATE
DATA : wf_status(4) TYPE c ."rihea-i_astatin. "STATUS
DATA : wf_objnr TYPE jest-objnr VALUE 'OR%'. "Object number
DATA : wf_aufnr TYPE aufk-aufnr.
DATA : wf_name TYPE thead-tdname. "NAME TO PASS IN FM READ_TEXT
DATA : wf_date1(12) TYPE c. "DATE
DATA : wf_i1(3) TYPE n,wc_i1(3) TYPE n VALUE '1'. "COUNTERS FOR REPORT DISPLAY
DATA : wf_i2(3) TYPE n,wc_i2(3) TYPE n VALUE '1'.
DATA : wf_kopf TYPE tdid VALUE 'KOPF',wf_aufk TYPE tdobject VALUE 'AUFK'.
DATA : wf_save_ok TYPE sy-ucomm ,wf_ok_code TYPE sy-ucomm.
DATA: wf_id TYPE tsp01-rqident , " For storing Spool request number
wf_bytes TYPE i . " For storing the bytes of data to be converted to PDF.
DATA : wf_langu(2) TYPE c VALUE 'EN'.
DATA: wf_pripar TYPE pri_params, " Structure for Passing Print Parameters
wf_rcpar TYPE arc_params. " ImageLink structure
DATA : wf_statu TYPE dfies-fieldname VALUE 'STATUS',
wf_field TYPE help_info-dynprofld VALUE 'S_STATUS'.
&--SELECTION SCREEN--
SELECTION-SCREEN BEGIN OF BLOCK b_1 WITH FRAME TITLE text-000.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: s_ordert FOR wf_ordert . "ORDER TYPE
SELECT-OPTIONS: s_order FOR wf_order OBLIGATORY. "ORDER NUMBER
SELECT-OPTIONS: s_bdate FOR wf_bdate. "BASIC START DATE
SELECT-OPTIONS: s_status FOR wf_status matchcode object zei_sys . "SYSTEM STATUS
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN END OF BLOCK b_1.
*--INTERNAL TABLES--
TYPES : BEGIN OF ty_aufk,
aufnr TYPE aufk-aufnr, "OREDR NUMBER
auart TYPE aufk-auart, "ORDER TYPE
objnr TYPE aufk-objnr, "OBJECT NUMBER
ktext type aufk-ktext, "SHORT TEXT
gstrp TYPE afko-gstrp, "BASIC START DATE
END OF ty_aufk.
TYPES : BEGIN OF ty_tj02t,
objnr TYPE aufk-objnr, "OBJECT NUMBER
txt04 TYPE tj02t-txt04, "STATUS
istat TYPE tj02t-istat, "Object status
spras TYPE tj02t-spras, "LANGUAGE KEY
END OF ty_tj02t.
TYPES : BEGIN OF ty_temp,
objnr TYPE aufk-objnr,
status(300) TYPE c,
END OF ty_temp.
TYPES : BEGIN OF ty_wrap,
line(54) TYPE c, "LONG TEXT
END OF ty_wrap.
TYPES : BEGIN OF ty_wrap2,
line(25) TYPE c, "STATUS
END OF ty_wrap2.
TYPES : BEGIN OF ty_f4,
txt04 TYPE tj02t-txt04,
txt30 TYPE tj02t-txt30,
END OF ty_f4.
types : begin of ty_sta,
istat type tj02t-istat,
objnr type jest-objnr,
end of ty_sta.
data : int_sta type table of ty_sta with header line.
DATA : int_f4 TYPE TABLE OF ty_f4 WITH HEADER LINE.
DATA: int_pdf TYPE TABLE OF tline WITH HEADER LINE. "TABLE FOR PDF CONVERSION
DATA: int_wrap TYPE TABLE OF ty_wrap WITH HEADER LINE. "TABLE FOR LONGTEXT
DATA: int_wrap2 TYPE TABLE OF ty_wrap2 WITH HEADER LINE. "TABLE FOR STATUS
DATA: int_temp TYPE TABLE OF ty_temp WITH HEADER LINE. "Table for concatenation of system status.
DATA: int_aufk TYPE TABLE OF ty_aufk WITH HEADER LINE.
DATA: int_tj02t TYPE TABLE OF ty_tj02t WITH HEADER LINE.
DATA: int_tline TYPE STANDARD TABLE OF tline WITH HEADER LINE. "TABLE FOR READ_TEXT.
DATA : int_fld TYPE TABLE OF dfies ,wa_fld LIKE LINE OF int_fld. " Field Type for FM for F4 help
DATA :int_return TYPE TABLE OF ddshretval WITH HEADER LINE .
DATA:
loc_print_parms LIKE pri_params, "PRINT PARAMETERS
loc_valid(1) TYPE c,
loc_file type SDOK_CHTRD,
loc_bytecount TYPE i, "NUMBER OF BYTES TRANSFERRED
loc_length TYPE i, "LINE-LENGTH
loc_rqident LIKE tsp01-rqident, "SPOOL NUMBER
loc_rq2name(12) TYPE c.
DATA: loc_filename LIKE rlgrap-filename. "FILENAME
DATA:loc_repid LIKE sy-repid, " Report to execute
loc_linsz LIKE sy-linsz VALUE 115, " Line size
loc_paart LIKE sy-paart VALUE 'X_65_132'. " Paper Format
Include ZIMPR_PERFORMS_WRAP----
*& Include ZIMPR_PERFORMS_WRAP
*& Form f_top_page
top-of the page
--> p1 text
<-- p2 text
FORM f_top_page .
*--HEADER--
FORMAT COLOR 1 .
WRITE : text-010.
FORMAT COLOR 1 OFF.
WRITE : / text-011,sy-datum NO-GAP.
WRITE : / text-012,sy-uzeit NO-GAP,90 text-013,101 sy-uname.
ULINE .
FORMAT COLOR 1 INTENSIFIED OFF .
WRITE : 1 sy-vline, "HEADINGS
2 text-014 NO-GAP,
7 sy-vline,
8 text-015 NO-GAP,
20 sy-vline,
21 text-016 NO-GAP,
76 sy-vline,
77 text-017 NO-GAP,
88 sy-vline,
89 text-018 NO-GAP,
115 sy-vline.
WRITE : /1 sy-vline,
2 text-019 NO-GAP,7 sy-vline,
20 sy-vline,76 sy-vline,77 text-020 NO-GAP,88 sy-vline,115 sy-vline.
ULINE.
FORMAT COLOR 1 OFF.
ENDFORM. " f_top_page
*& Form f_data_retrieval
select statements
--> p1 text
<-- p2 text
FORM f_data_retrieval .
SELECTING ORDER TYPE,ORDER NO.,OBJECT NO. AND BASIC START DATE
SELECT p~aufnr
p~auart
p~objnr
p~ktext
r~gstrp
FROM ( aufk AS p INNER JOIN afko AS r ON raufnr = paufnr )
INTO TABLE int_aufk
WHERE p~aufnr IN s_order AND
p~auart IN s_ordert AND
r~gstrp IN s_bdate AND
p~objnr LIKE wf_objnr.
IF sy-subrc <> 0.
MESSAGE s101(zipm). "no values found for selection criteria.
STOP.
ENDIF.
SORT int_aufk BY aufnr.
DELETE ADJACENT DUPLICATES FROM int_aufk.
SELECT q~istat
p~objnr
FROM ( jest AS p INNER JOIN tj02t AS q ON pstat = qistat )
INTO TABLE int_sta
FOR ALL ENTRIES IN int_aufk
WHERE p~objnr = int_aufk-objnr
AND q~txt04 IN s_status and
q~spras = wf_langu and
p~inact = ''.
IF sy-subrc <> 0.
MESSAGE s101(zipm). "no values found for selection criteria.
STOP.
ENDIF.
SORT int_sta BY objnr.
DELETE ADJACENT DUPLICATES FROM int_sta.
*--SELECTING OBJECT NO.,STATUS AND LANGUAGE--
IF int_sta[] IS NOT INITIAL.
SELECT p~objnr
q~txt04
q~istat
q~spras
FROM ( jest AS p INNER JOIN tj02t AS q ON pstat = qistat )
INTO TABLE int_tj02t
FOR ALL ENTRIES IN int_sta
WHERE p~inact = '' AND
p~objnr = int_sta-objnr AND
q~spras = wf_langu AND
q~txt04 IN s_status AND
p~objnr LIKE wf_objnr.
IF sy-subrc <> 0.
MESSAGE s101(zipm). "no values found for selection criteria.
STOP.
ENDIF.
ENDIF.
ENDFORM. " f_data_retrieval
*& Form f_report_display
report display
--> p1 text
<-- p2 text
FORM f_report_display .
LOOP AT int_tj02t. "concatenating the status into a internal table
AT NEW objnr.
CLEAR int_temp-status.
ENDAT.
CONCATENATE int_temp-status int_tj02t-txt04 INTO int_temp-status SEPARATED BY space.
AT END OF objnr.
int_temp-objnr = int_tj02t-objnr. "key field.
APPEND int_temp.
CLEAR int_temp.
ENDAT.
CLEAR int_tj02t.
ENDLOOP.
LOOP AT int_aufk.
CONCATENATE sy-mandt int_aufk-aufnr INTO wf_name . "concatenating client number and order number
*--THIS FM CAPTURES THE LONG TEXT AND STORES IT IN INTERNAL TABLE--
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = wf_kopf "TEXT ID
language = sy-langu "LANGUAGE
name = wf_name "TEXT NAME
object = wf_aufk "TEXT OBJECT
TABLES
lines = int_tline "LINES OF LONG TEXT.
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
int_tline-tdline = int_aufk-ktext.
APPEND int_tline.
CLEAR :int_tline.
ENDIF.
LOOP AT int_tline.
*--THIS FM WRAPS THE LONG TEXT INTO 54 CHARACTERS EACH--
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = int_tline-tdline "LONG TEXT LINE
outputlen = 54 "OUTPUT LENGTH
TABLES
out_lines = int_wrap "INTERNAL TABLE
EXCEPTIONS
outputlen_too_large = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR :int_tline.
ENDIF.
ENDLOOP.
*-- THIS FM WRAPS THE STATUS INTO 25 CHARACTERS EACH--
READ TABLE int_temp WITH KEY objnr = int_aufk-objnr.
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = int_temp-status
outputlen = 25
TABLES
out_lines = int_wrap2
EXCEPTIONS
outputlen_too_large = 1
OTHERS = 2.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
IF NOT int_wrap2[] IS INITIAL.
ULINE AT (115).
ENDIF.
DESCRIBE TABLE int_wrap LINES wf_i2. "COUNTING THE NO. OF LINES FOR TABLE INT_WRAP
DESCRIBE TABLE int_wrap2 LINES wf_i1. "COUNTING THE NO. OF LINES FOR TABLE INT_WRAP2
WHILE ( wc_i1 LE wf_i1 OR wc_i2 LE wf_i2 ).
IF ( wc_i2 LE wf_i2 ).
READ TABLE int_wrap INDEX wc_i2 . "READING THE INTERNAL TABLE INT_WRAP WITH INDEX
wc_i2 = wc_i2 + 1.
ENDIF.
IF ( wc_i1 LE wf_i1 ).
READ TABLE int_wrap2 INDEX wc_i1 . "READING THE INTERNAL TABLE INT_WRAP2 WITH INDEX
wc_i1 = wc_i1 + 1.
ENDIF.
*--THIS FM CONVERTS THE DATE FROM SYSTEM FORMAT TO OUTPUT FORMAT--
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = int_aufk-gstrp
IMPORTING
output = wf_date1.
IF NOT int_wrap2[] IS INITIAL .
*--REPORT DISPLAY--
WRITE : /1 sy-vline, 2 int_aufk-auart COLOR = 4 INTENSIFIED OFF NO-GAP ,
7 sy-vline ,8 int_aufk-aufnr COLOR = 4 INTENSIFIED OFF NO-GAP,
20 sy-vline,21 int_wrap-line,
76 sy-vline ,77 wf_date1 ,
88 sy-vline ,89 int_wrap2-line,
115 sy-vline.
*--CLEARING THE VARIABLES--
wf_date1 = ''.
CLEAR: int_aufk,int_temp,int_wrap2-line,int_wrap-line.
ENDIF.
ENDWHILE.
wc_i1 = 1.
wc_i2 = 1.
CLEAR :int_wrap,int_wrap2.
REFRESH : int_wrap,int_wrap2,int_tline.
ENDLOOP.
ULINE AT (115).
ENDFORM. " f_report_display
*& Form F_PDF_DISPLAY
pdf conversion
--> p1 text
<-- p2 text
FORM f_pdf_display .
*--THIS FM CONVERTS THE SPOOL REQUEST INTO PDF REPORT--
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = wf_id "SPOOL NUMBER
no_dialog = space
pdf_destination = 'X'
IMPORTING
pdf_bytecount = loc_bytecount "NUMBER OF BYTES TRANSFERRED
TABLES
pdf = int_pdf "TABLE FOR PDF REPORT
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.
ENDFORM. " F_PDF_DISPLAY
*& Form f_download_local
download to local system
--> p1 text
<-- p2 text
FORM f_download_local .
---------------------THIS FM DOWNLOADS THE PDF REPORT INTO LOCAL MACHINE
data loc_ret TYPE iwerrormsg.
CALL FUNCTION 'IW_C_GET_SAPWORKDIR'
IMPORTING
SAPWORKDIR = loc_file
ERROR_MSG = loc_ret
loc_filename = loc_file.
if loc_ret is initial.
concatenate loc_filename '\work order header long text_ ' sy-timlo '.pdf' into loc_filename.
endif.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
bin_filesize = loc_bytecount "NO. OF BYTES
filename = loc_filename "DEFAULT FILE NAME
filetype = 'BIN'
IMPORTING
act_filename = loc_filename
TABLES
data_tab = int_pdf.
ENDFORM. " f_download_local
if you have any doubts,,
please revert
Regards,
Talwinder
Similar Messages
-
How to convert Smart Form into PDF format and return the result in BAPI?
I want to convert a Smart Form into PDF format and return the result in BAPI.
can anyone tell me how it can be done with related example
regards
pranayhi,
smart form to pdf--
All you have to do is call your SF to get OTF and then concert it to PDF. Works like charm:
DATA: p_output_options TYPE ssfcompop,
p_control_parameters TYPE ssfctrlop.
p_control_parameters-no_dialog = 'X'.
p_control_parameters-getotf = 'X'.
CALL FUNCTION v_func_name "call your smartform
EXPORTING
output_options = p_output_options
control_parameters = p_control_parameters
IMPORTING
job_output_info = s_job_output_info.
call function 'CONVERT_OTF_2_PDF'
tables
otf = s_job_output_info-otfdata
lines = t_pdf
and if u need more u can check below links also
Check the below links..
Re: Smartforms to PDF
Re: smartform (otf) as pdf and sending as email-attachment
VISIT THIS LINK
Re: Smartforms to PDF
PLZ REWARD POINTS IF IT HELPS YOU
rgds
anver -
How to convert Labview document into PDF format
Hi! can any one tell me, can we convert the Labview document (Labview saved files)into PDF format. I wanted to convert it using a VI. If any one suggest me or send me the example vi i will be very thankful.
Regards
Ramesh.CHi,
We have a brand new PDF library for LabVIEW. Release date is in october. The library can create pdfs, with all kinds of text writing and picture stuff. It works stand alone, so there is no need for other programs. It should also be platform independend.
If your interested, drop me a mail. I can send you mail when it's released. Maybe we can give you a "beta test", if you send use your findings.
Regards,
Wiebe. (email is " my name " @ carya . nl )
"Ramme" <[email protected]> wrote in message news:[email protected]..
Hi! can any one tell me, can we convert the Labview document (Labview saved files)into PDF format. I wanted to convert it using a VI. If any one suggest me or send me the example vi i will be very thankful. RegardsRamesh.C -
How to get a report in pdf format.
Hi Experts,
Could any one let me know that, how to get the report in PDF format.
Once a report is generated it should be displayed in pdf format or downloaded in pdf format.
Thanks in Advance,
Regards,
Irfan HussainHi,
Check out this code:
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
* Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
* Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
* Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
* Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
* Write statement to represent report output. Spool request is created
* if write statement is executed in background. This could also be an
* ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
*** Alternative way could be to submit another program and store spool
*** id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
* to sap-spool
* spool parameters %_print
* archive parameters %_print
* without spool dynpro
* and return.
* Get spool id from program called above
* IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
* FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
* FORM get_job_details *
FORM get_job_details.
* Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
* FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
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.
CHECK sy-subrc = 0.
* Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
* FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
Regards,
Gayathri -
How to convert spool request to pdf format (to send mail) - SAP 3.1H
Hi,
I am working in 3.1H version. How to convert spool request into pdf cormat to send a mail?. Spool request is in TEXT format.
regards,
sundaram J.Hi sundaram,
1. I suppose u know how to send
mail with attachment.
2. If that is the case,
then no need to do anything.
3. Bcos
There is setting in SCOT,
for INTERNET
ABAP List ---> PDF
Raw TEXT -
PDF
(Your basis team will help u)
4. text data will get automatically converted
to pdf and get mailed.
regards,
amit m. -
Hi my question abt 2 convert a list into pdf format
hi
experts
i had problem to convert displayed list into pdf format showing an error cannot open the file file format not supported, but i am have downloaded the file in .pdf format
please help me
thank you allHi,
check out this program. this might help:
report zabap_pdf.
tables:
tsp01.
data:
mstr_print_parms like pri_params,
mc_valid(1) type c,
mi_bytecount type i,
mi_length type i,
mi_rqident like tsp01-rqident.
*-- INTERNAL TABLES
data:
mtab_pdf like tline occurs 0 with header line,
mc_filename like rlgrap-filename.
*-- SELECTION SCREEN
parameters:
p_repid like sy-repid, " Report to execute
p_linsz like sy-linsz default 132, " Line size
p_paart like sy-paart default 'X_65_132'. " Paper Format
start-of-selection.
concatenate 'c:\'
p_repid
'.pdf'
into mc_filename.
*-- Setup the Print Parmaters
call function 'GET_PRINT_PARAMETERS'
exporting
authority= space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
in_archive_parameters = space
in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog= 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
*-- Make sure that a printer destination has been set up
*-- If this is not done the PDF function module ABENDS
if mstr_print_parms-pdest = space.
mstr_print_parms-pdest = 'LOCL'.
endif.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
*-- Find out what the spool number is that was just created
perform get_spool_number using sy-repid
sy-uname
changing mi_rqident.
*-- Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid= mi_rqident
no_dialog = space
dst_device = mstr_print_parms-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_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.
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = mtab_pdf.
FORM get_spool_number *
Get the most recent spool created by user/report *
--> F_REPID *
--> F_UNAME *
--> F_RQIDENT *
form get_spool_number using f_repid
f_uname
changing f_rqident.
data:
lc_rq2name like tsp01-rq2name.
concatenate f_repid+0(8)
f_uname+0(3)
into lc_rq2name separated by '_'.
select * from tsp01 where rq2name = lc_rq2name
order by rqcretime descending.
f_rqident = tsp01-rqident.
exit.
endselect.
if sy-subrc ne 0.
clear f_rqident.
endif.
endform." get_spool_number -
How to convert table content into html format?
Hi,
Experts,
How to convert internal data into HTML format is there any function module or piece of code to download content into HTML.
Thank u,
Shabeer Ahmed.Then use this code....
REPORT ytest_table_html1.
* D A T A D E C L A R A T I O N
*-HTML Table
DATA:
t_html TYPE STANDARD TABLE OF w3html WITH HEADER LINE,
" Html Table
*- Declare Internal table and Fieldcatalog
it_flight TYPE STANDARD TABLE OF sflight WITH HEADER LINE,
" Flights Details
it_fcat TYPE lvc_t_fcat WITH HEADER LINE.
" Fieldcatalog
*-Variables
DATA:
v_lines TYPE i,
v_field(40).
*-Fieldsymbols
FIELD-SYMBOLS: <fs> TYPE ANY.
* S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
SELECT *
FROM sflight
INTO TABLE it_flight
UP TO 20 ROWS.
* E N D - O F - S E L E C T I O N
END-OF-SELECTION.
*-Fill the Column headings and Properties
* Field catalog is used to populate the Headings and Values of
* The table cells dynamically
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = it_fcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
DELETE it_fcat WHERE fieldname = 'MANDT'.
t_html-line = '<html>'.
APPEND t_html.
CLEAR t_html.
t_html-line = '<thead>'.
APPEND t_html.
CLEAR t_html.
t_html-line = '<tr>'.
APPEND t_html.
CLEAR t_html.
t_html-line = '<td><h1>Flights Details</h1></td>'.
APPEND t_html.
CLEAR t_html.
t_html-line = '</tr>'.
APPEND t_html.
CLEAR t_html.
t_html-line = '</thead>'.
APPEND t_html.
CLEAR t_html.
t_html-line = '<table border = "1">'.
APPEND t_html.
CLEAR t_html.
t_html-line = '<tr>'.
APPEND t_html.
CLEAR t_html.
*-Populate HTML columns from Filedcatalog
LOOP AT it_fcat.
CONCATENATE '<th bgcolor = "green" fgcolor = "black">'
it_fcat-scrtext_l
'</th>' INTO t_html-line.
APPEND t_html.
CLEAR t_html.
ENDLOOP.
t_html-line = '</tr>'.
APPEND t_html.
CLEAR t_html.
DESCRIBE TABLE it_fcat LINES v_lines.
*-Populate HTML table from Internal table data
LOOP AT it_flight.
t_html-line = '<tr>'.
APPEND t_html.
CLEAR t_html.
*-Populate entire row of HTML table Dynamically
*-With the Help of Fieldcatalog.
DO v_lines TIMES.
READ TABLE it_fcat INDEX sy-index.
CONCATENATE 'IT_FLIGHT-' it_fcat-fieldname INTO v_field.
ASSIGN (v_field) TO <fs>.
t_html-line = '<td>'.
APPEND t_html.
CLEAR t_html.
t_html-line = <fs>.
APPEND t_html.
CLEAR t_html.
t_html-line = '</td>'.
APPEND t_html.
CLEAR t_html.
CLEAR v_field.
UNASSIGN <fs>.
ENDDO.
t_html-line = '</tr>'.
APPEND t_html.
CLEAR t_html.
ENDLOOP.
t_html-line = '</table>'.
APPEND t_html.
CLEAR t_html.
*-Download the HTML into frontend
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\Flights.htm'
TABLES
data_tab = t_html
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*-Display the HTML file
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
document = 'C:\Flights.htm'
operation = 'OPEN'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
none of the above function modules r obsolete... -
How to convert word doc into pdf - which product of adobe i need to use- what upgrades - am a newbie
How to convert word doc into pdf - which product of adobe i need to use- what upgrades - am a newbie - simple answers please - Thanks in advance.
@Pipeline2007 - which version of Microsoft Office have you got? Older versions of Acrobat aren't compatible with the latest versions of Office, see this link for info:
http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html -
How to generate jasper report in pdf format using swing
hi all,
im new to swing and jasper.. can anybody provide me some example on how to generate the jasper report in pdf format? i will call the reportManager from sessionBean.. below is my code:
1)delegate:
public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
GenerateReportDto generateReportDto = getAuditTrailServiceRemote().generateIntoPdfReport(fileName, outputFileName, parameters);
return generateReportDto;
2)sessionBean:
public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
//Map parameters = new HashMap();
ReportManager reportManager = new ReportManager();
3)ReportManager()
public void generateIntoPdfReport(String fileName, String outputFileName, Map parameters) {
Connection conn = null;
try {
conn = dataSource.getConnection();
//Generate the report to bytes
File reportFile = new File(fileName);
byte[] bytes =
JasperRunManager.runReportToPdf(
reportFile.getPath(),
parameters,
conn
//conn.close();
//Write the bytes to a file
ByteBuffer buf = ByteBuffer.wrap(bytes);
File file = new File(outputFileName);
// (if the file exists)
boolean append = false;
// Create a writable file channel
FileChannel wChannel = new FileOutputStream(file, append).getChannel();
// Write the ByteBuffer contents; the bytes between the ByteBuffer's
// position and the limit is written to the file
wChannel.write(buf);
// Close the file
wChannel.close();
} finally {
if (conn != null) {
conn.close();
Any help would be highly appreciated. Thanks in advanceHi ,
One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
Read for further info in 'PL/SQL Packages and Types Reference'.
If you have access to OEM ... you can configure this there using wizard.....
Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
My greetings,
Sim -
How to convert BLOB data into string format.
Hi,
I have problem while converting blob data into string format.
for example,
Select dbms_lob.substr(c.shape.Get_wkb(),4000,1) from geotable c
will get me the first 4000 byte of BLOB .
When i using SQL as i did above,the max length is 4000, but i can get 32K using plsql as below:
declare
my_var CLOB;
BEGIN
for x in (Select X from T)
loop
my_var:=dbms_lob.substr(x.X,32767,1)
end loop
return my_var;
I comfortably convert 32k BLOB field to string.
My problem is how to convert blob to varchar having size more than 32K.
Please help me to resolve this,
Thanx in advance for the support,
NileshNilesh,
. . . .The result of get_wkb() will not be human readable (all values are encoded into some binary format).
SELECT utl_raw.cast_to_varchar2(tbl.geometry.get_wkt()) from FeatureTable tbl;
-- resulting string:
☺AW(⌂özßHAA
Å\(÷. . . .You may also want to have a look at { dbms_lob | http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1015792 } "The DBMS_LOB package provides subprograms to operate on BLOBs, CLOBs, NCLOBs, BFILEs, and temporary LOBs."
Regards,
Noel -
How to Export SSRS report into Excel format using query string
Hello all,
I am new to SSRS world.
Last night i was trying to add a hyperlink on the SSRS report (.rdl) file, by clicking which we can export the report into "Excel" format, but with no luck.
Can anybody tell me how to form the hyperlink, so that we can export the report with its current content ( I mean the report content generated by selecting some parameter values)Hi Suman85,
Based on your scenario, you want to add a link on the SSRS report file, and then click it you can export the report into “Excel” format.
Just as kishan1901 said , you can add a textbox to your report and type in the words “Click here and export the report
to excel” .Then right-click the textbox and select Properties. Switch to Navigation tab, click the radiobutton of ‘Jump to URL’ and type in the expression ,here is just a example:
="http://vyof1884200/ReportServer$youhoo?/My+Adventure+Works/Product+Sales+and+Profitability+by+Month&rs:Command=Render&rs:Format=excel"
Then preview the report ,you will see
Click here and export the report to excel
when you move the mouse to it ,the mouse will become a hand ,then left-click, it will jump out a dialog box to indicate user whether the excel file should be saved , opened or canceled.
I think this is what you want, if you have any further requirement, could you please describe it in more detail? We would give you some resolution or workaround.
Regards,
Challen Foo -
How to convert "classic" report to "interactive" report?
Hi,
How do I convert classic report to interactive and vice versa?
ThanksHi,
When you go to the interactive report, in the right you have "Migrate to Interactive Report". That will make your standard report interactive, but will not erase the old report. It will be only disabled. But I don't know if it is possible to migrate from interactive to standard report. -
How to convert Oracle reports into excel?
How can we convert Oracle reports into excel.
i know there was a thread on this topic which i am not able to find.
give the link / help.I found Std Oracle Report output to Excel Sheet has some suggestions. Not being a Reports person anymore I am not in a position to vouch for them.
How did I find this thread? By not using the forum search tool but using Google instead.
Cheers, APC -
How to convert Oracle Report into Excel
Hi,
Please guide for the following:
I am using, Report Developer 11g and I want to save Oracle report into Excel format, is it possible ?
Regards,
Thanks.There is a Reports manual you know!
http://download.oracle.com/docs/cd/E14571_01/bi.1111/b32121/pbr_cla005.htm#i636884 -
How to convert a workbook into PDF and broadcast as Email attachment
Hello Gurus,
i have installed the ADS (Adobe Document services). I would like to broadcast workbooks as a pdf file to some user.
When i open the workbook and go to Broadcast --> Setup a broadcast setting for this workbook. The distribution type is
Broadcast E-mail; Broadcast E-mail (Bursting); Broadcast Portal; Broadcast Multichannel and Output Format only MS Workbook and Link to current Data. Here i miss the possibility as PDF.
Where can i set up that the workbook should be broadcast as PDF.
Any help appreciated.
Thanks and kind rgerads,
MuratThanks all for your answers,
i also read that with changing the format in Report designer then broadcasting via PDF. Is there no possibility for PDFs for MS Excel Workbooks? How does it work when opening the query in Report designer? What do i have to do there but it is no solution for us because in the workbooks we use GET BEX DATA formulas and just show parts of the analyisis grid. I need a proper solution how to use broadcaster converting workbooks into PDF an send them as email attachment
Thanks,
Murat
Maybe you are looking for
-
No/very low sound out of center spea
I have the sound blaster li've! 24-bit card and i just bought a brand new logitech x-530 system, and hooked it up and everything worked except for the front speaker. I have tried the whole EAX thing and it didn't do anything. I played a game and ever
-
Views in Apex 4.1.1 is crashing the Apex engine
Good Morning, I have over 27 views in apex and made a column name change in the views and after I compile about 4 or 5 of them, the apex engine crashes. I was compiling the data views first, before moving on to report views. When I upload the views a
-
Initial Positioning of RowIterators
I have a fairly large hierarchy of Master/detail view Objects like: ViewObject1 ->ViewObject2 --->ViewObject3 ----->etc... My swing/Jclient app starts with a search to find the correct row for ViewObject1 and that row gets set to the current Row. Now
-
Does iPhone 5 sim card size and shape are changed?
About the sim card size and shape, there are some web sites talk about new micro - nano.....what ever sim cards for the new iPhone 5, I searched the details in the official Appel site there was no any topics about this issue, now I want the truth for
-
Multiple clients configuration for STMS
Hi Forum, I would like to setup a Transport mechanism system, with client specific configuration. For example: From Development system all customizing request should go automatically to two clients in Quality system. Dev ---> QAS100 and QAS200. Could