SAP Script to PDF and then Archeiving
Hi
Kindly let me know how to convert SAP Script to PDF. And once it is done, archeiving of data is to be done.
Regards
Ramesh Sundaram
Hi,
Use the code below
Before OPEN_FORM
Data: gi_otf TYPE STANDARD TABLE OF itcoo,
gi_line TYPE TABLE OF tline,
bin_file TYPE i.
itcpo-tdgetotf = 'X'.
After CLOSE_FORM
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = bin_file
TABLES
otf = gi_otf
lines = gi_line
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Manish
Similar Messages
-
Convert sap script to pdf and send mail before close_form
hi experts,
I am converting a sap script to PDF and then sending that pdf to vendor mail ids.
I am getting the Data for the conversion of pdf From close_form.But it contains the data for all the vendors . But i have to Send the mail to the specific vendors.For ex if my script output has 5 sheets each with different vendors . I have to send 1 sheet as a pdf mail for that particular vendor. so,1 sheet each for 5 differrent vendors . But the data i get from close_form is the data for all the 5 vendors. How to split the data ?. can any one help me on this issue.
with thanks in advance,
syedHi,
Change your driver program so that it calls the script n no of times .. and every time send mail to particular vendor ..
Loop at vendors.
call the form ...
send mail ...
endloop ...
Regards,
Srini. -
How to convert sap script to pdf and send it as email attachment
hi,
my requirement is to convert a standard sales order form to pdf and send it as email attachment. get me some sample code for the same
thanks in advanceHi
See this sample code and after that use the fun module to send the mail
SO_NEW_DOCUMENT_ATT_SEND_API1
REPORT zzz_jaytest .
Types Declaration
TYPES : BEGIN OF ty_pa0001,
pernr TYPE pa0001-pernr,
bukrs TYPE pa0001-bukrs,
werks TYPE pa0001-werks,
END OF ty_pa0001.
Internal Table Declaration
DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details
i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data
i_content_txt TYPE soli_tab, "Content
i_content_bin TYPE solix_tab, "Content
i_objhead TYPE soli_tab,
Work Area Declaration
w_pa0001 TYPE ty_pa0001, "For pa0001 Details
w_res TYPE itcpp, "SAPscript output
"parameters
w_otf TYPE itcoo, "For OTF
w_pdf TYPE solisti1, "For PDF
w_transfer_bin TYPE sx_boolean, "Content
w_options TYPE itcpo, "SAPscript output
"interface
Variable Declaration
v_len_in TYPE so_obj_len,
v_size TYPE i.
Constants Declaration
CONSTANTS : c_x TYPE c VALUE 'X', "X
c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
c_otf TYPE sx_format VALUE 'OTF', "OTF
c_pdf TYPE sx_format VALUE 'PDF', "PDF
c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
c_bin TYPE char10 VALUE 'BIN', "BIN
c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
"File Name
c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name
START-OF-SELECTION.
Selecting the records from pa0001
SELECT pernr bukrs werks FROM pa0001
INTO TABLE i_pa0001 UP TO 10 ROWS.
Setting the options
w_options-tdcopies = 1 ."Number of copies
w_options-tdnoprev = c_x."No print preview
w_options-tdgetotf = c_x."Return of OTF table
w_options-tddest = c_locl."Spool: Output device
Opening the form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = c_form
device = c_printer
language = sy-langu
OPTIONS = w_options
IMPORTING
RESULT = w_res.
LOOP AT i_pa0001 INTO w_pa0001.
Writting into the form
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MAIN'
window = 'MAIN'.
ENDLOOP.
Closing the form
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = w_res
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Converting OTF data to single line
LOOP AT i_otf INTO w_otf.
CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
INTO w_pdf.
APPEND w_pdf TO i_content_txt.
ENDLOOP.
Converting to PDF Format
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = c_otf
format_dst = c_pdf
devtype = c_printer
CHANGING
transfer_bin = w_transfer_bin
content_txt = i_content_txt
content_bin = i_content_bin
objhead = i_objhead
len = v_len_in
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
v_size = v_len_in.
Downloading the PDF File
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_size
filename = c_name
filetype = c_bin
TABLES
data_tab = i_content_bin.
If you r using this function module check it once....
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
Fehlerhandling
if sy-subrc <> 0.
endif.
or u can use the standard program RSTXPDFT4 to download the script into PDF format onto a particular location
follow this link for sample program.
http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html
check...
How to send smart form via email
/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
Regards
Anji -
Sap script convert to pdf and then send to email
Hi,
good day sap guys
ive dev the sap scipt for customer statemnet one which is used the t.code is f.27.
i need to convert the sap script to pdf and then send to email.
plz let me know..
how to do it.
regards
chanduHi,
I script program use the following (go to the "call function 'CLOSE_FORM'")
data: binfilesize type i.
data: pdftab type table of tline with header line.
data: i_itcpp like itcpp.
data: g_t_otfdata type standard table of itcoo with header line.
call function 'CLOSE_FORM'
IMPORTING
RESULT = i_itcpp
tables
otfdata = g_t_otfdata[]
exceptions
others = 1.
if sy-subrc ne 0.
retcode = sy-subrc.
perform protocol_update.
endif.
call function 'CONVERT_OTF'
exporting
format = 'PDF'
importing
bin_filesize = binfilesize
BIN_FILE =
tables
otf = g_t_otfdata[]
lines = pdftab[].
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
concatenate file_path '.pdf' into filename.
call function 'GUI_DOWNLOAD'
exporting
bin_filesize = binfilesize
filename = filename
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 = ' '
IMPORTING
FILELENGTH =
tables
data_tab = pdftab[]
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
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif. -
Conversion of QC21 sap script to pdf
Hello Experts
I was working on QC21 sap script layout,got guidance from u guys & i managed to finish.
now can anyone tell me how to convert the sap script to pdf format?
KashHi,
if u wish to automate the process, then u can write the following code...
DATA: V_PRINT_PARMS LIKE PRI_PARAMS.
DATA: V_PDFSPOOLID TYPE TSP01-RQIDENT,
V_RQIDENT TYPE TSP01-RQIDENT.
DATA: V_RQ2NAME TYPE STRING.
DATA: T_PDF LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA: T_RSPAR TYPE STANDARD TABLE OF RSPARAMS.
To Setup The Print Parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
AUTHORITY = SPACE
COPIES = '1'
COVER_PAGE = SPACE
DATA_SET = SPACE
DEPARTMENT = SPACE
DESTINATION = SPACE
EXPIRATION = '1'
IMMEDIATELY = SPACE
LAYOUT = SPACE
MODE = SPACE
NEW_LIST_ID = 'X'
NO_DIALOG = 'X'
USER = SY-UNAME
IMPORTING
OUT_PARAMETERS = V_PRINT_PARMS.
IF SY-SUBRC EQ 0.
Submit Program & Store Spool ID Into Memory
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
CURR_REPORT = 'RQCAAP01'
TABLES
SELECTION_TABLE = T_RSPAR.
ENDIF.
SUBMIT RQCAAP01 VIA SELECTION-SCREEN TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS V_PRINT_PARMS
WITH SELECTION-TABLE T_RSPAR
AND RETURN.
Retrieving Spool ID From TSP01 Table
CONCATENATE V_RQ2NAME SY-UNAME INTO V_RQ2NAME.
SELECT * FROM TSP01
WHERE RQ2NAME EQ V_RQ2NAME ORDER BY RQCRETIME DESCENDING.
V_RQIDENT = TSP01-RQIDENT.
EXIT.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR V_RQIDENT.
ENDIF.
To Convert Spool ID To PDF Format
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = V_RQIDENT
TABLES
PDF = T_PDF.
IF SY-SUBRC EQ 0.
To Download The File In PDF Format
to get file name and location for saving
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
EXPORTING
WINDOW_TITLE = 'Select The Path Where The PDF Should Be Saved'
DEFAULT_FILE_NAME = 'Certificate Of Analysis.PDF'
CHANGING
FILENAME = v_filename
PATH = v_filepath
FULLPATH = v_fullpath.
To download the PDF file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = v_fullpath
FILETYPE = 'BIN'
TABLES
DATA_TAB = T_PDF.
ENDIF.
I hope this resolves ur issue...
Regards,
Radhika -
Print to pdf and then email...
I frequently print a document to pdf and then email it as an attachment. The print dialog box allows me to save as pdf or email as pdf. I would like a print plugin that does both actions - allows me to name and save the pdf to a specified location and then adds it as an attachment to a new email. Any ideas?
Create a Print Plug in Automator, such as the below, which does exactly as you want. When you set it up, make sure you click the Options that I clicked and this will allow you to name the PDF, and save it wherever you want to.
I named my Print Plugin "PDF File & Email" -
Creating a link to a pdf and then being able to come back to first pdf
hi there!
I want to be able to create a link in my InDesign document to the glossary (another InDesign document). Of course I am exporting as PDFs and then the user would be able to close the glossary and come back to the first document in the place that they were when they left. This seems like it should be easy, but I can't find a way to come back. Acrobat doesn't have a back button, and when you close the glossary you also close the first document.The user can open the document again, but then they have to find their place.
Is there a way to link to another document and have it open in a new Acrobat window? That's what I really want.
Any ideas?
Thanks,
Tim.Hi Steve, thanks very much for that. Wow, I feel lucky to get one of the best. I've seen some of your videos.
Okay, but javascript, eh? Hmm. Okay, I'm listening. Can you give me a bit more? Point me in the right direction?
Thanks. -
How do I convert a word document into a pdf and then upload it to a web site
How do I convert a word document into a pdf and then upload it to a web site so people can read it from my
site with Dreamweaver 4?. How can I do this? Can anyone please help? I'm only a newbie. Thanking you in anticipation.First you need to install a means of printing to pdf from word. I like cutepdf writer ( http://cutepdf.com/Products/CutePDF/writer.asp ). Once installed you will print the doc in word and under the printer selection you choose pdf.
Once you have the file you put it in your local site folders and upload it using Dreamweaver. Be sure to link to it from a page so users can get to it and I would recommend giving the link a target of _black so it will open in a new window (see the properties inspector in DW). -
Error while converting Image -to- PDF and then to PDF/A
Hi,
I'm trying to convert a Image format(JPEG,bmp,tiff) to PDF and then to PDF/A. I could able to convert Image to PDF successfully.
I'm getting the below error while converting the PDF(that was generated) to PDF/A.
Caused by: com.adobe.livecycle.output.exception.OutputException: Input Document is a already flat PDF Document
at com.adobe.printSubmitter.PrintServer.transformPDF(PrintServer.java:307)
at com.adobe.printSubmitter.service.OutputServiceImpl.transformPDFInTxn(OutputServiceImpl.ja va:518)
at com.adobe.printSubmitter.service.OutputServiceImpl$4.doInTransaction(OutputServiceImpl.ja va:481)
... 106 more
Error OCCURRED: ALC-DSC-000-000: com.adobe.idp.dsc.DSCException: Internal error.
Please give me the solution to convert PDF to PDF/A?I've just read a footnote in the API documentation which indicates that the transformPDF function cannot be used for this purpose:
"GS_Enterprise said on Nov 24, 2007 at 12:03 PM :
Please note that the parameter "inPdfDoc" for transformPDF assumes that the stream content is an XFA-based PDF, and that it's not an XFA-based PDF with a PDF background (also known as "XFA foreground"). In other words, this function does not convert any input PDF to PDF/A, but only those PDFs generated from an XFA template which does not include any static PDF content as a background." -
My hard drive died last week, and I needed to install a new one. Previously, I was able to save a .doc with text and inserted photo to .pdf and then to .jpg. Now I can get the .pdf but can't determine what to do to convert to .jpg. Does anyone know ?
Rather than do that, which means starting over from scratch, losing all your edits, organisation and so on, why not simply use iPhoto Library Manager to revert the Library to the older version? Easier, less destructive.
The instructions on that are here
If you really want to start over: you can access the Originals folder simply by going to your Pictures Folder and finding the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed. -
Do I begin by scanning my illustration in a pdf and then save it as a png on illustrator?
Do I begin by scanning my artwork as pdf and then saving it as a png on illustrator?
Depends on what you want to do with the file. Most scanning software can scan as tiff, png, jpg and sometimes pdf. In each of these cases the resulting file is usually a raster file. The exception is software that can convert text into edible text known as OCR, or have some time of auto trace feature for converting artwork into vector objects. This is where pdf would shine compared to the other formats. Tiff is the only remaining one that can also save live editable text.
As I said once the pdf is imported into illustrator, what format you choose to save from there will depend on what you plan on doing next with it. Ai, pdf, psd or tiff would make good candidates for master files. (A file you can re-edit at a later date with no worry of degradation) And then each of these formats have their pros and cons. -
Do I begin by scanning my illustratration in a pdf and then save it as a png on illustrator?
Do I begin by scanning my artwork as pdf and then saving it as a png on illustrator?
Depends on what you want to do with the file. Most scanning software can scan as tiff, png, jpg and sometimes pdf. In each of these cases the resulting file is usually a raster file. The exception is software that can convert text into edible text known as OCR, or have some time of auto trace feature for converting artwork into vector objects. This is where pdf would shine compared to the other formats. Tiff is the only remaining one that can also save live editable text.
As I said once the pdf is imported into illustrator, what format you choose to save from there will depend on what you plan on doing next with it. Ai, pdf, psd or tiff would make good candidates for master files. (A file you can re-edit at a later date with no worry of degradation) And then each of these formats have their pros and cons. -
Do I begin by scanning my illustrator in a pdf and then save it as a png on illustrator?
Do I begin by scanning my artwork as pdf and then saving it as a png on illustrator?
Depends on what you want to do with the file. Most scanning software can scan as tiff, png, jpg and sometimes pdf. In each of these cases the resulting file is usually a raster file. The exception is software that can convert text into edible text known as OCR, or have some time of auto trace feature for converting artwork into vector objects. This is where pdf would shine compared to the other formats. Tiff is the only remaining one that can also save live editable text.
As I said once the pdf is imported into illustrator, what format you choose to save from there will depend on what you plan on doing next with it. Ai, pdf, psd or tiff would make good candidates for master files. (A file you can re-edit at a later date with no worry of degradation) And then each of these formats have their pros and cons. -
I have created a pdf and then want to send it to my boss. When he recieves it it is saved in the 14 X 8.5 inches version. How can I saved it on my end as a 11 x 8.5 inch so he doesn't have to uncheck "Choose paper source by PDF page size"?
Hi heathers,
You would need to print the file to a new PDF with the appropriate page size.
Best,
Sara -
How do i convert mac pages to pdf and then edit
How do I covert a mac pages document to a pdf and then edit it?
It can't be done using Adobe Reader.
I'm not sure what "Mac Pages" is but typically, you would make changes to those original documents and THEN create a pdf. Editing a pdf can be anything from tedious to impossible depending on what you are trying to edit.
Maybe you are looking for
-
Can't get plug-in for Acrobat to work in Safari (boy I've tried!)
I've spent literally hours in the discussion group looking for an answer to this and can't find one that works, so I finally decided to post a new topic. I just moved from a Powerbook G4 to a MBP. On the G4, when I brought up a PDF file from a web pa
-
in numbers I type Command-o in the search field i type "numbers" without the quotes. no numbers files are found in that directory. .xls and .csv files are found, including .xls versions of previously created .numbers files typing the full filename al
-
Get the starting date and end date of all weeks of a given month and year
hey Guys so far I have this.. but I am having difficulty limiting it by month. I am using Oracle 11 release 1 Select year, week, next_day( to_date( '04-jan-' || year, 'dd-mon-yyyy' ) + (week-2)*7, 'sun' ) as weekStartDate, next_day( to_date( '04-jan-
-
I have a document that has been saved not to allow any changes. I am now trying to resave the document so that chages are allowed. For some reason, no matter what security settings I choose, it will not allow changes to the document. Does anyone have
-
Why do we have to call SwingUtilities.invokeLater()??
Hello, i am not understanding the concept of SwingUtilities.invokeLater() i read the documentation but still couln't get why it is needed and when it is needed?do we have to call this function everytime some event is generated and some action is perf