Upload pdf and print to spool
Hi,
I have a requirement to upload a pdf file and print the pdf file together with a smartform in 1 spool.
I am not sure how to read and print the pdf file. Tried using GUI_UPLOAD type BIN, but how do you send it to spool in pdf format?
Will definitely reward.
Cheers.
Wong
You have to use print controls and pass the print controls to smartform function module ..
get the pdf file using gui_upload FM ,File type should be 'BIN'.
use below logic :
DATA: p_out LIKE ssfcompop,
p_ctrl LIKE ssfctrlop.
CLEAR: p_out,
p_ctrl.
p_ctrl-no_dialog = 'X'.
p_ctrl-device = 'PRINTER'.
p_out-tdnoprev = 'X'.
p_out-tdnoprint = 'X'.
p_out-tdnoarch = 'X'.
p_out-tddelete = 'X'.
p_out-tddest = p_dest.
p_out-tdnewid = ''.
p_out-tdimmed = ' '.
p_out-tdcopies = 1.
p_out-tddataset = sy-repid.
p_out-tddelete = ' '.
d_suffix1 = t_inv-zztrkno+2(4).
CONCATENATE sy-datum+2 sy-uzeit INTO d_suffix2.
p_out-tdsuffix1 = d_suffix1.
p_out-tdsuffix2 = d_suffix2.
<b> p_out-tdfinal = 'X'.</b> " When you use this parameter ,it creates the only one spool and it may contain more than one information
assume that Smart form FM
CALL FUNCTION fm_name
EXPORTING
inv_header = tmp_header
output_options = p_out
control_parameters = p_ctrl
user_settings = ' '
TABLES
t_item = tmp_item
t_price = tmp_price
t_partner = tmp_partner
t_docflow = tmp_docflow
t_beer_item = tmp_beer_item
t_wine_item = tmp_wine_item.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Similar Messages
-
Convert a web report into pdf and print (in BW 3.5)
Hello gurus,
i have few web reports ( created using WAD). i am looking for a possibility to convert a web report (viewed in a browser by a user) into pdf and print them and this should be done by pressing a button.
Is it possible in BW 3.5 version?.
could anyone please help me?
Any how to docs. would be really helpful.
thanks and regards
kumarHere it is
<HTML>
<!-- BW data source object tags -->
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="SET_DATA_PROVIDER"/>
<param name="NAME" value="DATAPROVIDER_1"/>
<param name="DATA_PROVIDER_ID" value=""/>
DATA_PROVIDER: DATAPROVIDER_1
</object>
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="SET_PROPERTIES"/>
<param name="TEMPLATE_ID" value="ZPD_ADHOC_PAGE"/>
<param name="MENU_BACK" value=""/>
<param name="MENU_BACK_TO_START" value=""/>
<param name="SUPPRESS_WARNINGS" value="X"/>
<param name="MENU_FILTER" value=""/>
<param name="MENU_FILTER_ON_AXIS" value=""/>
<param name="MENU_SELECT_FILTER" value=""/>
<param name="MENU_FILTER_ON_AXIS_CHART" value=""/>
<param name="MENU_FILTER_CHART" value=""/>
<param name="MENU_FILTER_DRILL_DOWN" value=""/>
<param name="MENU_DRILL_UP_GIS" value=""/>
<param name="MENU_DRILL_DOWN" value=""/>
<param name="MENU_EXCHANGE_OBJECTS" value=""/>
<param name="MENU_REMOVE_DRILL_DOWN" value=""/>
<param name="MENU_SWITCH_AXIS" value=""/>
<param name="MENU_HIERARCHY_NODE_DRILL" value=""/>
<param name="MENU_HIERARCHY_DRILL" value=""/>
<param name="MENU_HIERARCHY_STATE" value=""/>
<param name="MENU_SORT" value=""/>
<param name="MENU_CALCULATE_RESULT" value=""/>
<param name="MENU_CALCULATE_VALUE" value=""/>
<param name="MENU_CUMULATE_VALUE" value=""/>
<param name="MENU_DISPLAY_DOCUMENTS" value=""/>
<param name="MENU_DOCUMENT_CREATE" value=""/>
<param name="MENU_DISPLAY_DOCUMENT_PROP" value=""/>
<param name="MENU_DISPLAY_DOCUMENT_SELEC" value=""/>
<param name="MENU_RRI" value=""/>
<param name="MENU_EXPORT_TO_CSV" value=""/>
<param name="MENU_EXPORT_TO_XLS" value=""/>
<param name="MENU_BOOKMARK" value=""/>
<param name="MENU_CHARACTERISTIC_PROPERTIES" value=""/>
<param name="MENU_VALUE_PROPERTIES" value=""/>
<param name="MENU_QUERY_PROPERTIES" value=""/>
<param name="MENU_VARIABLE_SCREEN" value=""/>
<param name="MENU_CURRENCY_CONVERSION" value=""/>
<param name="MENU_ENHANCED" value=""/>
TEMPLATE PROPERTIES
</object>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">
<TITLE>SAP BW Reporting Print Page</TITLE>
<link href="/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>
<script type"text/javascript">
<!--
// Global Variable Definition
var dataTable = "";
var pageRowCnt = 0;
var prevPage = 0;
var ColumnCnt = 0;
var PrintDateTimeStamp = new Date();
var rptWidth = 0;
//DATE STAMP FUNCTION
function datestamp(){
var Today = new Date()
document.write(Today);
function getReportTitle() {
var myQueryString = window.location.search;
var startOfRptTitle = myQueryString.indexOf("QTITLE=");
if (startOfRptTitle != -1)
var endOfRptTitle = myQueryString.indexOf("&", startOfRptTitle + 7);
var myTitle = unescape(myQueryString.substring(startOfRptTitle + 7, endOfRptTitle));
var rpttitle = "";
for(i=0;i<myTitle.length;i++){
if (myTitle.substring(i,i+1) == "+"){
rpttitle = rpttitle + ' ';
else
rpttitle = rpttitle + (myTitle.substring(i,i+1));
else
var rpttitle = "Unspecified Query Title";
return rpttitle;
queryTitle=getReportTitle();
function getHeading2() {
var myQueryString = window.location.search;
var startOfHdr2 = myQueryString.indexOf("HDR2=");
if (startOfHdr2 != -1)
var endOfHdr2 = myQueryString.indexOf("&", startOfHdr2 + 5);
var myHdr2 = unescape(myQueryString.substring(startOfHdr2 + 5, endOfHdr2));
var hdr2 = "";
for(i=0;i<myHdr2.length;i++){
if (myHdr2.substring(i,i+1) == "+"){
hdr2 = hdr2 + ' ';
else
hdr2 = hdr2 + (myHdr2.substring(i,i+1));
else
var hdr2 = "#";
return hdr2;
header2=getHeading2();
function getHeading3() {
var myQueryString = window.location.search;
var startOfHdr3 = myQueryString.indexOf("HDR3=");
if (startOfHdr3 != -1)
var endOfHdr3 = myQueryString.indexOf("&", startOfHdr3 + 5);
var myHdr3 = unescape(myQueryString.substring(startOfHdr3 + 5, endOfHdr3));
var hdr3 = "";
for(i=0;i<myHdr3.length;i++){
if (myHdr3.substring(i,i+1) == "+"){
hdr3 = hdr3 + ' ';
else
hdr3 = hdr3 + (myHdr3.substring(i,i+1));
else
var hdr3 = "#";
return hdr3;
header3=getHeading3();
function getAsOfDate() {
var myQueryString = window.location.search;
var startOfRelevance = myQueryString.indexOf("ASOFDATE=");
if (startOfRelevance != -1)
var endOfRelevance = myQueryString.indexOf("&", startOfRelevance + 9);
var myRelevance = unescape(myQueryString.substring(startOfRelevance + 9, endOfRelevance));
var asof = "";
for(i=0;i<myRelevance.length;i++){
if (myRelevance.substring(i,i+1) == "+"){
asof = asof + ' ';
else
asof = asof + (myRelevance.substring(i,i+1));
else
var asof = "";
return asof;
asofDateTime=getAsOfDate();
function getPaperSize() {
var myQueryString = window.location.search;
var startOfPaperSize = myQueryString.indexOf("PSIZE=");
if (startOfPaperSize != -1)
var endOfPaperSize = myQueryString.indexOf("&", startOfPaperSize + 6);
var myPaperSize = unescape(myQueryString.substring(startOfPaperSize + 6, endOfPaperSize));
var psize = "";
for(i=0;i<myPaperSize.length;i++){
psize = psize + (myPaperSize.substring(i,i+1));
else
var psize = "0"; // default if none supplied (normal 8x11)
return psize;
varPaperSize=getPaperSize();
var PaperSizeParamString='&PSIZE=' + escape(varPaperSize);
switch(varPaperSize){
case "0": // Landscape - Letter
var WidthMax = 910;
var RowsPerPageMax = 38;
break;
case "1": // Landscape - Legal
var WidthMax = 1190;
var RowsPerPageMax = 38;
break;
case "2": // Portrait - Letter
var WidthMax = 660;
var RowsPerPageMax = 54;
break;
function getTotalColumns() {
var myHTML = dataTable.rows[1].innerHTML;
var TotalTDs = 0;
var nextTD = 0;
for (i=0;i<myHTML.length;i++) {
nextTD = myHTML.indexOf("<TD", i);
if (nextTD != -1) {
i=nextTD;
TotalTDs++;
else break;
return TotalTDs;
function GetPageHeadings() {
var headingHTM = "";
var leftspancnt = 0;
var rightspancnt = 0;
var headingspancnt = 2;
if (header2 != '#') headingspancnt = headingspancnt + 1; // adjust for extra headings
if (header3 != '#') headingspancnt = headingspancnt + 1;
if (currPage > 1) {
headingHTM += '<TR style="page-break-before:always; display:none; visibility:hidden; "><TD Colspan="' + ColumnCnt + '"></td></tr>';
else {
headingHTM += '<TABLE id="THEREPORT" name="MYREPORT" cellSpacing=0 cellPadding=0 width=' + WidthMax + ' border=0>';
if (ColumnCnt == 1) {
headingHTM += '<TR><TD vAlign=top align=left nowrap><font Size=3><STRONG>';
headingHTM += queryTitle;
headingHTM += '</STRONG></font></TD><TD Rowspan="' + headingspancnt + '" align="right" vAlign="top"><input type="image" border="0" name="SAPLogo" src="/sap/bw/Mime/Customer/Images/images.jpg" alt="SAP Logo"></TD></TR>';
if (header2 != '#') headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + header2 + '</FONT></TD></TR>';
if (header3 != '#') headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + header3 + '</FONT></TD></TR>';
headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + asofDateTime + '</FONT></TD></TR>';
headingHTM += '<TR><TD vAlign="top" align="left" Colspan="2"><hr size=2 color=black align=left></TD></TR>';
headingHTM += '<tr>' + dataTable.rows[0].innerHTML + '<TD> </TD></TR>';
else {
leftspancnt = Math.floor(ColumnCnt/2);
rightspancnt = ColumnCnt - leftspancnt;
headingHTM += '<TR><TD vAlign=top align=left nowrap Colspan="' + leftspancnt + '"><font Size=3><STRONG>';
headingHTM += queryTitle;
headingHTM += '</STRONG></font></TD><TD Rowspan="' + headingspancnt + '" Colspan="' + rightspancnt + '" align="right" vAlign="top"><input type="image" border="0" name="SAPLogo" src="/sap/bw/Mime/Customer/Images/images.jpg" alt="SAP Logo"></TD></TR>';
if (header2 != '#') headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + header2 + '</FONT></TD></TR>';
if (header3 != '#') headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + header3 + '</FONT></TD></TR>';
headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + asofDateTime + '</FONT></TD></TR>';
headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + ColumnCnt + '"><hr size=2 color=black align=left></TD></TR>';
headingHTM += '<tr>' + dataTable.rows[0].innerHTML + '</TR>';
return headingHTM;
function GetPageFooting() {
var footingHTM = "";
var leftspancnt = 0;
var rightspancnt = 0;
if (ColumnCnt == 1) {
footingHTM += '<TR><TD vAlign="top" align="left" Colspan="2"><hr size=2 color=black align=left></TD></TR>';
footingHTM += '<TR><TD vAlign="top" align="left" nowrap><FONT Size=1>Prepared: ';
footingHTM += PrintDateTimeStamp;
footingHTM += '</FONT></TD><TD vAlign="top" align="right"><FONT Size=1>';
footingHTM = footingHTM + 'Page ' + currPage.toString() + ' of ' + varPageTotal.toString();
footingHTM += '</FONT></TD></TR>';
else {
leftspancnt = Math.floor(ColumnCnt/2);
rightspancnt = ColumnCnt - leftspancnt;
footingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + ColumnCnt + '"><hr size=2 color=black align=left></TD></TR>';
footingHTM += '<TR><TD vAlign="top" align="left" nowrap Colspan="' + leftspancnt + '"><FONT Size=1>Prepared: ';
footingHTM += PrintDateTimeStamp;
footingHTM += '</FONT></TD><TD vAlign="top" align="right" Colspan="' + rightspancnt + '"><FONT Size=1>';
footingHTM = footingHTM + 'Page ' + currPage.toString() + ' of ' + varPageTotal.toString();
footingHTM += '</FONT></TD></TR>';
return footingHTM;
function GetReportFooting() {
var footingHTM = "";
footingHTM += '</TABLE>';
return footingHTM;
function formatToPrint() {
var PrintHTM = "";
PrintHTM += GetPageHeadings();
if (ColumnCnt != 1) {
for (var i=1;i<dataTable.rows.length;i++) {
(currPage > prevPage)?prevPage=currPage:""; //increment current page count
if ((pageRowCnt + 1)>RowsPerPageMax){
PrintHTM += GetPageFooting();
pageRowCnt = 0;
currPage++;
if (prevPage != currPage) {
PrintHTM += GetPageHeadings();
else
PrintHTM += '<tr>' + dataTable.rows<i>.innerHTML + '</tr>';
pageRowCnt++;
PrintHTM += GetPageFooting();
PrintHTM += GetReportFooting();
return PrintHTM;
function DisplayPrintNotice() {
// Paper Size "0" is Letter with Landscape
// Paper Size "1" is Legal with Landscape
// Paper Size "2" is Letter with Portrait
if (varPaperSize == "0") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Printer Orientation to Landscape n 2) select Print menu, then select the Print button.";}
if (varPaperSize == "1") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Paper Size to Legal n 2) Adjust the Printer Orientation to Landscape n 3) select Print menu, then select the Print button.";}
//if (varPaperSize == "2") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Paper Size to Letter n 2) Adjust the Paper Source (if necessary) n 3) Adjust the Orientation to Portrait (default) n 4) Select the Okay button nn Again select the File Menu, select Print, then select the Print button.";}
alert(varMessage);
//window.print()
/* SAP BW Reporting Stylesheet Revisions */
function writeStyleRevisions() {
function writeDynamicFontRevisions(dynafont) {
//Writes the Dynamic Stylesheet
-->
</script>
</HEAD>
<BODY>
<TABLE id="tp1" cellSpacing=0 cellPadding=0 width=660 border=0 >
<TR>
<TD vAlign=top align=left nowrap>
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="MYQUERY"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="GENERATE_CAPTION" value=""/>
<param name="GENERATE_LINKS" value=""/>
<param name="WIDTH" value="660"/>
<param name="BORDER_STYLE" value="NO_BORDER"/>
<param name="SUPPRESS_REPETITION_TEXTS" value=""/>
<param name="BLOCK_SIZE" value="3500"/>
<param name="SHOW_PAGING_AREA_TOP" value="X"/>
<param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_1"/>
ITEM: MYQUERY
</object>
</TD>
</TR>
</TABLE>
<SCRIPT type="text/javascript">
<!--
var tbls = document.body.getElementsByTagName("TABLE");
for (var i=0;i<tbls.length;i++) {
if (tbls<i>.name == "MYQUERY"){
var dataTable = tbls<i>;
break;
document.title = queryTitle;
rptWidth = dataTable.clientWidth;
rptHeight = dataTable.clientHeight;
originalRptWidth = rptWidth;
originalRptHeight = rptHeight;
originalRowHeight = Math.floor(rptHeight/(dataTable.rows.length+1));
rptPageHeightMax = 580; //660 less basic header and footer of 80
if (header2 != '#') rptPageHeightMax = rptPageHeightMax - 20; // adjust for extra headings
if (header3 != '#') rptPageHeightMax = rptPageHeightMax - 20;
if (dataTable.rows.length == 1) {
ColumnCnt = 1; //No Applicable Data found message
else {
ColumnCnt = getTotalColumns();
startingFont = 65;
varFontSize = startingFont;
if (rptWidth > WidthMax) {
while ((rptWidth > WidthMax) && (varFontSize > 15))
writeDynamicFontRevisions(varFontSize);
rptWidth = dataTable.clientWidth;
rptHeight = dataTable.clientHeight;
varFontSize = varFontSize - 5;
// calculate max rows per page
rowHeight = Math.floor(rptHeight/(dataTable.rows.length+1)) + 1; // add 1 for 2 row heading, add 1 for padding
RowsPerPageMax = Math.floor(rptPageHeightMax/rowHeight) - 2; // adjust for column headings
if (dataTable.rows.length == 1) {
varPageTotal = 1; //No Applicable Data found message
else {
totalRows = dataTable.rows.length-1; // total rows less headings
varPageTotal = Math.floor(totalRows/RowsPerPageMax); // compute total pages
if (totalRows != (varPageTotal * RowsPerPageMax)) {
varPageTotal = varPageTotal + 1; // if not a complete last page, add 1 for partial page
currPage = 1;
document.write(formatToPrint());
document.all.tp1.style.display = "none";
document.all.tp1.style.visibility = "hidden";
// DisplayPrintNotice();
-->
</SCRIPT>
<STYLE>
input.ie55 { display: none }
</STYLE>
<!-- special style sheet for printing -->
<STYLE media=print>
.noprint { display: none }
</STYLE>
<script defer>
function window.onload() {
if (!factory.object) {
return
else {
// factory.printing.header = "SAP"
// factory.printing.footer = "SAP"
if ( varPaperSize == "2" ) { factory.printing.portrait = true; }
else { factory.printing.portrait = false; }
factory.printing.Print(true);
// enable control buttons
/* var templateSupported = factory.printing.IsTemplateSupported();
var controls = idControls.all.tags("input");
for ( i = 0; i < controls.length; i++ ) {
controls<i>.disabled = false;
if ( templateSupported && controls<i>.className == "ie55" )
controls<i>.style.display = "inline";
</script>
<P>
<div id=idControls class="noprint" style="VISIBILITY: hidden">
<input disabled type="button" value="Print this page"
onclick="factory.printing.Print(true)">
<input disabled type="button" value="Page Setup..."
onclick="factory.printing.PageSetup()">
<input class=ie55 disabled type="button" value="Print Preview..."
onclick="factory.printing.Preview()">
<input class=ie55 disabled type="button" value="Landscape"
onclick="factory.printing.portrait=false">
<input class=ie55 disabled type="button" value="Portrait"
onclick="factory.printing.portrait=true">
</div>
</BODY>
</HTML> -
PDF and Print Control in Reports.
Dear All,
I want to set particular format for every report in PDF and Print control option like want to place client's logo in header and page number and date in fotter , how can i achive this,is there any way we can set it globally coz doing on every report is very time consuming.
Regards,
Tarang JainYou need Firebug....to know how your Dashboard works!!!!!!
Check these 2 blogs and play.....
http://oraclebizint.wordpress.com/2008/01/03/oracle-bi-ee-101332-customizing-download-links/
http://oraclebizint.wordpress.com/2007/10/26/oracle-bi-ee-101332-styles-and-skins-firebug-to-your-rescue/
i hope i helped....
http://greekoraclebi.blogspot.com/
Close the question.....and add a new thread...
Give if you wish the appropriate points... -
How do I get a PDF document put into an attachment form that I can drag to an e-mail. Usually I get an icon showing an spiral note book which then becomes an attachment when I drag it to the e-mail, but occasionally it stays in PDF and prints out on the e-mail. What have I done differently?
Thanks again for the detailed instructions Srini!
And I really hate to be a pest . . . but . . .
Using your example and not modifying it, I get the e-mail form filled out correctly and the pdf attached, however, I'm not prompted to sign it.
Any more clues? -
AcroPDF in VB6 - Find text in PDF and print that page.
Okay, so I'm certain that this question has been asked and answered a hundred times, but for some reason my googling skills are seriously failing me today...
I have a legacy application built in VB6 that generates PDF documents of a particular form letter. Each PDF contains all of the form letters that were printed on that particular day. I actually have it all working rather decently, but something came up a little while ago that set me on a new programming obsession. I want to enable the following functionality from my application:
The user provides a text string that should be unique among all pages of all PDF's (customer ID).
The application then finds the PDF that contains that text string and identifies which page number contains that text string.
Finally, send only that page to the printer.
Currently I can easily create, display and print the PDF from my application. While the creation of the document is done through a third-party reporting system, all display and printing functions are basically handled using AcroPDF.dll. Going through the available properties and methods for an AcroPDF object, I see that I can tell it to print only specified pages, which gives me the last part of my requirements, and I've got the user input part down pat. I'm just totally stumped at finding a solution for "step 2".
Any suggestions, ideas or comments would be greatly appreciated. I'm kinda tired of banging my head against a wall. Thank you for your time.If you are only using Adobe Reader, then that feature isn't available.
If you have Adobe Acrobat, then you have a few options.
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Wed, 26 Oct 2011 08:15:12 -0700
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: AcroPDF in VB6 - Find text in PDF and print that page.
AcroPDF in VB6 - Find text in PDF and print that page.
created by GHosaPhat<http://forums.adobe.com/people/GHosaPhat> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/3991293#3991293 -
How to upload pdf and doc/docx with ADF?
I am using 11.1.2.3.0,
I want to be able to upload pdf and/or word documents in my web application. Can anyone help me with a tutorial or a sample example because all what I am finding till now are related to processing photos but it is not my case.
Thank you in advance.I was just reading this, but this guy didn't fix his problem till the end of the thread.. However can you help me on how to implement at least the "uploadBean" class because he in his post showed only the jspx file and the "backing_uploadfile" bean. I understand I annoying you but I am new to this kind of stuff :) Thank you
-
Export to PDF and Print to Postscript (in one step)
I am seeking a script that will do the following consecutively:
* Export to PDF (PDF settings never changes, output directory never changes)
* Print to PS (printer preset that is used never changes, output directory never changes)
It would save us a lot of time in our workflow having to do this in one step, with a single keyboard shortcut.
Since the same PDF and Printer presets are always used, as well as the output directories, It would
probably be easy to include those settings in the script itself, as opposed to some preference file, I'm guessing.
If anyone can help me write this, I'd much appreciate it.
Thanks,
DestinThanks Gerald for the suggestion.
Looks like some powerful software there... and a bit pricey for what I need to do (over $500 US dollars, yikes).
Surely the script I am seeking is much less involved than that. I suppose I'll have to try to do some Javascript myself,
which will be a learning experience... -
If I buy Pages, will I be able I upload pdf and word files to websites?
If I buy Pages, will I be able I upload pdf and word files to websites?
Pages can export to PDF and .doc formats and send those via email, but it has no "upload" function. That is something you normally do with a browser or an ftp app.
-
Convert OTF to PDF and print PDF from Spool
Hi,
I have searched all the forums and service market place but could not find solution to my problem.
I am using Function module
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = p_spool
no_dialog = 'X'
dst_device = 'ISJB'
pdf_destination = 'S'
IMPORTING
pdf_bytecount = lv_bytecount
pdf_spoolid = lv_spoolid
otf_pagecount = lv_pagecount
btc_jobname = lv_jobname
btc_jobcount = lv_jobcount
TABLES
pdf = gt_pdf
EXCEPTIONS
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 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.
this generates spool in SP01. Ideally it should generate a PDF spool file but it generates a BIN file of Format G_RAW. When I display the spool it displays all kinds of japanese characters which does not make sense,.
I setup printer ISJB with device type JPPDF (PDF converted for Japanese characters). Does any one know where the problem could be? Why I could not print the Spool in PDF?
Thank you,
JagadishHi,
check out this program which will convert spool to pdf
REPORT zsmartform_spool_g.
*************Types Declaration ****************************
TYPES : BEGIN OF gty_tab, " Spool Requests
rqident TYPE tsp01-rqident, " Spool request number
rqdoctype TYPE tsp01-rqdoctype, " Spool: document type
rqo1name TYPE tsp01-rqo1name, " TemSe object name
END OF gty_tab.
*********Work Area ****************************************
DATA: form_name TYPE rs38l_fnam, " Used to get the function module of Smartform
wa_outopt TYPE ssfcompop, " SAP Smart Forms: Smart Composer (transfer) options
gs_tab TYPE gty_tab. " Spool Requests
*******Internal Table Declarations ************************
DATA: gt_tab TYPE STANDARD TABLE OF gty_tab, " Spool Requests
gt_pdf TYPE STANDARD TABLE OF tline, " SAPscript: Text Lines
gt_spoolid TYPE tsfspoolid, " Table with Spool IDs
gt_otfdata TYPE ssfcrescl. " Smart Forms: Return value at end of form prnt
*********Variable Declarations ****************************
DATA: gv_bytecount TYPE i, "#EC NEEDED " PDF Byte Count
gv_file_name TYPE string, " File name
gv_file_path TYPE string, " File Path
gv_full_path TYPE string, " Path
gv_binfilesize TYPE i, " Bin File size
gv_rqident TYPE tsp01-rqident, " Spool request number
gv_name TYPE tst01-dname, " TemSe object name
gv_objtype TYPE rststype-type, " TemSe: Object type name
gv_type TYPE rststype-type. " TemSe: Object type name
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZPDF_G'
IMPORTING
fm_name = form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*Get Spool IDs
wa_outopt-tdnewid = 'X'.
wa_outopt-tddest = 'LP01'.
CALL FUNCTION form_name
EXPORTING
output_options = wa_outopt
user_settings = 'X'
IMPORTING
job_output_info = gt_otfdata
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 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.
*Assign the spool id
gt_spoolid = gt_otfdata-spoolids.
Generate spool and pdf for the output of the form
PERFORM sub_generate_spool_pdf.
END-OF-SELECTION.
*& Form sub_generate_spool_pdf
Generate Spool and PDF output
FORM sub_generate_spool_pdf .
DATA: ls_spoolid LIKE LINE OF gt_spoolid.
*----Get the Spool Number
CLEAR ls_spoolid.
READ TABLE gt_spoolid INTO ls_spoolid INDEX 1.
IF sy-subrc = 0.
gv_rqident = ls_spoolid.
ENDIF.
CLEAR gt_tab.
SELECT rqident rqdoctype rqo1name INTO TABLE gt_tab
FROM tsp01 WHERE rqident = gv_rqident.
IF sy-subrc = 0.
CLEAR gs_tab.
Get the TemSe: Object name into variable gv_name
READ TABLE gt_tab INTO gs_tab INDEX 1.
IF sy-subrc = 0.
gv_name = gs_tab-rqo1name.
ENDIF.
ENDIF.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = sy-mandt
name = gv_name
part = 1
IMPORTING
type = gv_type
objtype = gv_objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 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.
Check if temse object name type is 'OTF' or 'LIST'
IF gv_objtype(3) = 'OTF'.
PERFORM get_otf_spool_in_pdf.
ELSE.
PERFORM get_abap_spool_in_pdf.
ENDIF.
Generate F4 functionality from spool to pdf
PERFORM write_pdf_spool_to_pc.
ENDFORM. " sub_generate_spool_pdf
*& Form get_abap_spool_in_pdf
Generate the Spool number
FORM get_abap_spool_in_pdf .
REFRESH gt_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gv_rqident
IMPORTING
pdf_bytecount = gv_bytecount
TABLES
pdf = gt_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 NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " get_abap_spool_in_pdf
*& Form get_otf_spool_in_pdf
Generate OTF data from the Spool Number
FORM get_otf_spool_in_pdf .
REFRESH gt_pdf.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gv_rqident
IMPORTING
pdf_bytecount = gv_bytecount
TABLES
pdf = gt_pdf
EXCEPTIONS
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 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.
ENDFORM. " get_otf_spool_in_pdf
*& Form write_pdf_spool_to_pc
Generate PDF format
FORM write_pdf_spool_to_pc .
CALL METHOD cl_gui_frontend_services=>file_save_dialog
CHANGING
filename = gv_file_name
path = gv_file_path
fullpath = gv_full_path
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
----DOWNLOADING THE PDF DATA***
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = gv_binfilesize
filename = gv_full_path
filetype = 'BIN'
TABLES
data_tab = gt_pdf
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.
ENDFORM. " write_pdf_spool_to_pc -
Hello everyone,
I have a problem using the class CL_GUI_PDFVIEWER with the method PRINT, I always triggering a termination with a short dump.
Can anyone help me or have sample program how to print a PDF file into the spool. I already check the demo program SAP_PDF_VIEWER_DEMO, but the PRINT method is not included.
Thanks in advance...Hello everyone,
I have a problem using the class CL_GUI_PDFVIEWER with the method PRINT, I always triggering a termination with a short dump.
Can anyone help me or have sample program how to print a PDF file into the spool. I already check the demo program SAP_PDF_VIEWER_DEMO, but the PRINT method is not included.
Thanks in advance... -
CONVERTING SMARTFORM INTO PDF AND PRINTING DIRECTLY
Hai guys,
I got a problem.
First the Smartform I created doesnt show all TABLE LINES(the rows coloumns)...
so I have converted the SMART FORM to ADOBE FORM PROGRAMITICALY ...
now in order to PRINT ..
one has to first SAVE the FORM(adobe form) onto desktop(or whereever) and give it to PRINT...
unfortunately my CLIENT doeasnt like the EXTRA STEP..
so i best i can SAVE the file to a hardcoded location and
OPEN it ..
But then CAN I
a)PRINT DIRECTLY without SAVING??
b)ISSUE PRINT PROGRAMITICALY
c)I learnt that a SMARTFORM can be GENERATED INTO PDF only at RUNNTIME(from SMARTFORMS>UTILITIES etc)..i briefly tried that..can I use that to GET THE PDF to PRINT when one gives PRINT from SPOOL REQUEST(sp01)
hoping to give some quick pointsHi,
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
or
*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
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.
PERFORM process_email.
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 process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
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.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
Regards,
Kumar -
Retrieve Archived PDF and print
Hi Folks,
I have certificates which have been archived. Once I get the Archiv Id of the document from TOA01, how do I use this data to print?
The Archived Document is a PDF Document. Could you please advise steps on how this data can be retrieved and printed?
Information I have presently is that I can get the archived data in Binary Format with FM ARCHIVOBJECT_GET_TABLE
How do you process this binary data to get it printed?
Greatly appreciate any help.
Thanks!Hi Venkat
I am looking back on my program now, its been a whild since I finished it, and I am using it to merge two pdf fields into one pdf spool.
i am using the global directory I will attach the updated code for you.
you can also check out the code in this method. CL_SALV_WD_C_TABLE_V_TABLE->ON_PDF_SEND_TO_PRINTER
<p>
return.
l_wa_old_spool-rqident = 30096.
APPEND l_wa_old_spool
TO l_i_old_spools.
l_wa_old_spool-rqident = 30094.
APPEND l_wa_old_spool
TO l_i_old_spools.
BREAK-POINT.
DATA:
l_handle TYPE sy-tabix,
l_spoolid TYPE tsp01-rqident, "#EC NEEDED
l_partname TYPE adspart, "#EC NEEDED
l_new_partname TYPE adspart, "#EC NEEDED
l_filename(128) TYPE c.
data: lv_append type char1.
l_v_partname = 'darrenTest1'.
* Create a new spool order for the PDF'S
CALL FUNCTION 'ADS_SR_OPEN'
EXPORTING
dest = l_v_prdest
immediate_print = abap_false
* append = ' ' "append
doctype = l_c_doctype
titleline = 'Darren Merge Test'
IMPORTING
handle = l_v_handle
spoolid = l_v_spoolid
partname = l_v_partname
EXCEPTIONS
device_missing = 1
no_such_device = 2
operation_failed = 3
wrong_doctype = 4
wrong_devicetype = 5
OTHERS = 6.
CALL FUNCTION 'ADS_GET_PATH'
IMPORTING
ads_path = l_v_globaldir.
BREAK-POINT.
PERFORM get_statements.
READ TABLE gt_return INTO ls_doc INDEX 1.
CLEAR l_filename.
*CONCATENATE l_v_globaldir l_v
*l_v_partname = 'darrenTest1'.
*l_filename = |{ l_v_globaldir }/{ l_v_partname }.pdf |.
l_filename = |{ l_v_partname }.pdf |.
LOOP AT gt_return INTO ls_doc.
if sy-tabix > 1.
lv_append = 'X'.
else.
clear lv_append.
endif.
CALL FUNCTION 'ADS_WRITE_TO_FILE'
EXPORTING
filename = l_filename
buffer = ls_doc-bindoc
append = lv_append
useglobaldir = 'X'
EXCEPTIONS
cannot_open_file = 1
open_dataset_no_authority = 2
open_dataset_internal_error = 3
open_dataset_too_many_files = 4
dataset_cant_close = 5
close_dataset_internal_error = 6
cannot_close_file = 7
cannot_transfer_data = 8
transfer_internal_error = 9
dataset_write_error = 10
OTHERS = 11.
ENDLOOP.
CALL FUNCTION 'ADS_SR_CONFIRM'
EXPORTING
handle = l_v_handle
partname = l_v_partname
size = 0
pages = 0
* NO_PDF = ' '
IMPORTING
new_partname = l_new_partname
EXCEPTIONS
handle_not_valid = 1
operation_failed = 2
OTHERS = 3.
CALL FUNCTION 'ADS_SR_CLOSE'
EXPORTING
handle = l_v_handle
final = abap_true
EXCEPTIONS
handle_not_valid = 1
operation_failed = 2
OTHERS = 3. -
To upload pdf and ms word document in VA01 header menu -TEXT tab
I want to upload local file (PDF and Word) in R/3-VA01-Text Header..
Can any one tell me the solution for that.Can any body tell me how search text in PDF
and MS Word document through Java code, any
body has code or any suggestion to giveYes.
First, you need to work out how to read each document type from Java.
E.g, for MS Word you could use Apache Jakarta POI - HWPF: http://jakarta.apache.org/poi/hwpf/index.html
Then, you use Apache Lucene to index and search.
See http://lucene.apache.org/java/docs/index.html
~D -
Load a PDF and Print it Without User Seeing the PDF
I have a client who has a need to allow users via a web browser to print PDFs wihtout gaining direct access to them. Ignoring all the flaws in this logic , I am new to Flex and am having difficulty determining if this is possible. So, here are the details:
1) This is a web browser application.
2) The files reside on a server.
3) The user will view a list of available PDF files in their browser.
4) There will be a print icon next to each one.
5) When they click on the print icon we need to pull in the PDF from the server and initiate a print, all without the user seeing the PDF. So once they click the print icon the next thing they see is thier browser's print dialog box.
I have 1-4 done, I just need help with the most important one, #5.
So, can Flex (without AIR) load a PDF in without displaying it and print it?
I am using Flash Builder 4.6, if it matters.
Thanks in advance for any input.Well, that's going to be difficult. Before everything else, a silent printing in general, is not what Browser is all about. A print dialog is thrown by the browser when a user selects a print option. Same thing if an application is trying to print using built into it conventional methods of printing - you get Print dialog. It gets even harder if you want to print PDF files silently. You will need to make sure that a file is available to print in case it's generated on the fly. The following code will print your PDF without dialogs to a selected (var printer) printer:
var WshShell = new ActiveXObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
var fi = "AcroRd32.exe /N /T " + '"c:\\temp\\' + "filename" + '" ' + printer;
WshShell.Run(fi, 0, false);
As you notice, the file is on the local system. Or you can try printing over the network.
This code will be a part of a JS function in your html wrapper. You will call this function from Flex using ExternalInterface.
AcroRd32.exe is an Adobe free PDF reader. I would suggest starting from the end - have a file on the local system and working on everything esle.
HTH -
Convert external documents to PDF and print
Hi,
I have a SAP script and with some help from SDN I am at point where I can convert this SAP script to PDF using the function module below
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
* MAX_LINEWIDTH = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' '
* PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = BINFILESIZE
* BIN_FILE =
TABLES
otf = DATAB[]
lines = PDFTAB[].
Now my requirement is, let's say I have an external doc(word or excel) residing on my PC. I have complete path of this file in my hand. I want to convert this file to PDF and append it to the above PDFTAB[] and print to the printer 'TDDEST' as a single document.
Thanks,Hi,
use this code passing in v_url the complete path
START-OF-SELECTION.
SET SCREEN 100.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'T1'.
*running down the pbo for the first time,
*create the controls and their containers
IF my_main_container IS INITIAL.
CREATE OBJECT my_main_container
EXPORTING
container_name = 'CUSTOM_CNTL'
EXCEPTIONS
cntl_error = 1
OTHERS = 2.
*create PDF Viewer object
CREATE OBJECT my_pdf_viewer
EXPORTING
parent = my_main_container
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
*could not create PDF Viewer
ENDIF.
*my_pdf_viewer->LANGU = 'IT'.
DATA: view_buttons_active TYPE char01 VALUE 'X',
v_url TYPE char255.
IF my_pdf_viewer->acrobat_vs_reader = ''.
view_buttons_active = 'X'.
ENDIF.
*create SAP toolbar for PDF Viewer
CALL METHOD my_pdf_viewer->create_toolbar
EXPORTING
tool_buttons = 'X'
view_buttons = view_buttons_active
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
*could not create toolbar
ENDIF.
*Open the PDF document
IF NOT my_pdf_viewer->html_viewer IS INITIAL.
CLEAR v_url.
v_url = file.
CALL METHOD my_pdf_viewer->open_document
EXPORTING
url = v_url.
IF sy-subrc <> 0.
SET SCREEN 1000.
MESSAGE i208(00) WITH 'Documento non presente: riprovare'.
ENDIF.
ELSE.
MESSAGE e208(00) WITH 'Impossibile aprire il documento'.
ENDIF.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module EXIT-PROCESSING INPUT
text
MODULE exit-processing INPUT.
fcode = ok_code.
CLEAR ok_code.
CASE fcode.
WHEN 'BACK' OR 'EXIT' OR 'CANC'.
SET SCREEN 0.
LEAVE SCREEN.
ENDCASE.
ENDMODULE. " EXIT-PROCESSING INPUT
Maybe you are looking for
-
How does the valuated stock & storage location/batch stock gets calculated from MSEG table in transaction MB5B? I need this to generate a customised report for my client....
-
Css layout problems - css and tables
Hi guys, Well as some of you suggested months ago, I've been trying to learn to layout with CSS... It's actually getting a bit rewarding now as I start to figure a few things out but there's still plenty of questions!!! If anyone can take a look at w
-
Ldif2db producing weird messages while trying to migrate from 5.1 to 5.2
I have a fresh install of DS 5.2 Patch 3...I took the 99user.ldif from my 5.1 SP3 instance and copied it over to my 5.2 instance. I did a db2ldif on the 5.1 instance and then took that ldif and performed an ldif2db on the 5.2 instance. I received a c
-
OS X 10.8.5 (12F45) Server application crashes with "A child action failed"
I installed this Server over my regular OS X last September. I worked with minimal services started (no email server or web services). Mostly users sharing resources. Was able to access it several times afterwards. Today in order to update more drive
-
CMDTUX_CAT:1113 Previleges to start tuxedo services ( Tuxedo 6.5)
I installed Tuxedo 6.5 on my windows NT w/s as workstation administrator. Now, I logged in as a network user ( who is not in the admin group) and tried to bring up Tuxedo services, I encountered the following error. CMDTUX_CAT:1113: ERROR: Must be th