How to download PDF output forms to presentation server without display
Hi All,
My requirement is to download the Sales Order forms and save it in local system.
I have created a custom program where I am passing a range of Sales Order no, Partner Function, Output type and Application as my input in selection screen.
Logic:
I am calling my Sales Order Abodeform using the FM: 'FP_FUNCTION_MODULE_NAME' and thereby I got the function module name of my form.
Then I am calling the FM:
Input to the FM:
ls_outputparams-nodialog = abap_true.
ls_outputparams-authority = 'X'.
ls_outputparams-getpdf = 'X'.
ls_outputparams-dest = 'LP03'.
ls_outputparams-nopreview = abap_true.
ls_outputparams-reqimm = abap_true.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
followed by, CALL FUNCTION (FM name)
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_output_param
user_settings = ' '
is_nast = nast
is_vbdka = vbdka
is_addres = addr_key
IMPORTING
document_output_info = document_output_info
job_output_info = job_output_info
job_output_options = job_output_options
TABLES
it_vbdpa = tvbdpa "Item information
it_vbdpau = tvbdpau "Subitem numbers
it_vedpa = tkomservp "Contract Item Validity
it_vedka = tkomservh "Contract Header Validity
it_vedpn = tkomservpn "Contract Item Cancellation Data
it_vedkn = tkomservhn "Contract Header Cancellation DA
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
then , CALL FUNCTION 'FP_JOB_CLOSE'
IMPORTING
e_result = ls_result
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
then i am using the below FM to get the OTF data if any available.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lv_binfilesize
bin_file = lv_bin_file
TABLES
otf = ls_output_info-otfdata-> i am not sure which data to pass here. i am getting sy-subrc value as 4.
lines = lt_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
Now I dont no how to link the PDF forms to below method.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = v_size
filename = D://x.pdf
filetype = 'BIN'
CHANGING
data_tab = lt_pdf.
Because in smartforms, we will convert the OTF output to PDF and that value is passed to GUI_DOWNLOAD FM as input (lt_pdf) , whereas in adobeforms the output itself is in PDF so i dont how to retreive the values from adobeforms and pass it to the above FM, so that I can save 'N' no. of sales order outputs in one PDF file.
Kindly help me out in this.
Thanks & Regards,
Karthikeyan G.
Hi Vishnu,
I read the GUI_DOWNLOAD FM documentation, if I am trying to download binary type of file, It is mandatory to pass file size.
In my case, since I am having PDF file, so i don't no how to get the size of the pdf file.
As you said, if i use Convert_OTF FM, i don't have data to pass to the OTF and LINES tables.
I am having values of PDF in xstring format in ls_output1-pdf, which i got using the below FM.
CALL FUNCTION lv_funcname (FM name)
EXPORTING
/1bcdwb/docparams = ls_docparams
is_vbdka = vbdka
IMPORTING
/1bcdwb/formoutput = ls_output1
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
Kindly tell me what values i need to pass to the FM you mentioned in order to get the size of the file.
Thanks & Regards,
Karthikeyan G.
But still I am not sure, how the pdf output is coming for single input whereas if i give in a range, its failing. In single input, i am not giving binary file size still the output is coming.. but for range its not. Kindly help me out in this.
Similar Messages
-
How to downlaod adobe from output to presentation server without display
Hi Experts,
How to download the adobe form output without displaying the output on the screen. Do we have some concept of OTF data in adobe forms ??? I checked the all the function modules which starts from FP*, but could not find it. Please let me know how to download the output of the form without displaying the output.
Thanks in advance.
Jackhi,
when you get data in binary format, append it to the following internal table of type TLINE and then use following code to modify ur binary adta. tehn you can try to convert it into PDF format.
inernal table declaration:
* Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
data : gd_buffer TYPE string,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE.
code to modify binary data obtained :
* 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 '~ '.
* Prepare PDF attachment table : it_mess_att
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.
regards, -
How to get pdf file from sap presentation server using java connector
Hi Friends,
with the below code i am able to get po details in pdf in presentation server.
DATA : w_url TYPE string
VALUE 'C:\Documents and Settings\1011\Solutions\web\files\podet.pdf'.
CALL FUNCTION 'ECP_PDF_DISPLAY'
EXPORTING
purchase_order = i_ponum
IMPORTING
PDF_BYTECOUNT =
pdf = file " data in Xsting format
*Converting Xstring to binary_tab
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = file
APPEND_TO_TABLE = ' '
IMPORTING
OUTPUT_LENGTH =
TABLES
binary_tab = it_bin " data in binary format
**Downloading into PDF file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = w_url
filetype = 'BIN'
TABLES
data_tab = it_bin
when i am using java connector , to retirve the file from presentation server , the follwoing error i am getting...
init:
deps-jar:
compile-single:
run-single:
com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in Control Framework
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
at PdfGen.<init>(PdfGen.java:35)
at PdfGen.main(PdfGen.java:78)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
i debugged too, problem with <b>gui_download......</b>
I am very glad to all with your suggestions!!
Regards,
Madhu..!!Hi
You can try to create an external command (transaction SM69).......sorry I've forgotten,,,,they works on application
How do you call CL_GUI_FRONTEND_SERVICES=>EXECUTE?
Max
Edited by: max bianchi on Oct 13, 2011 10:27 AM -
How to download the output of two reports in WebTemplate into excel sheet?
How to download the output of webtemplate which consists of two reports in one Web Template into same Excel sheet?
hi sunil,
here is the HTML code for 'export to excel'
<!-- Display Export Excel--->
<td class="SAPBEXNavLine"> <SAP_BW_TEXT program="SAPLRRSV" key="T72">" src="Mime/BEx/Icons/S_X_XLS.gif" border=0 ></td>
you can also use BEx download scheduler to download the precalculated webtemplate report to excel sheet.
Check the link below.
https://websmp104.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700000401962004E
i think this will help u
regards,
sindhu. -
How to download interactive adobe form with filled data
Hi Experts,
i have created a module pool program that is showing interactive adobe form, i created a button 'SAVE' to download the interactive adobe form to the presentation server.
but the problem is that i am unable to save the interactive adobe form with filled data. Please provide me the code how to download interactive adobe form with filled data.
Please provide me valuable information to clear the issue.
Thank you,
B. Raghu Prasad.Hi Raghu,
is this adobe form in web dynpro ? if so, I suggest to go to [Web Dynpro |Web Dynpro ABAP; forum to get more advice because it seems to be more specific topic.
Regards,
Vincent -
How to download interactive adobe form
Hi Experts,
could you please tell me how to download interactive adobe form with filled data through report program (not by WebDynpro ABAP).
Note:- The downloaded form should be static.
Thankyou,
B. RaghuHi,
look at the example report FP_TEST_00 in the workbench.
Steps to generate an adobe form:-
First get name of the generated function module
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
*open the form for printing
CALL FUNCTION 'FP_JOB_OPEN'
Now call the generated function module
CALL FUNCTION fm_name
Close spool job
CALL FUNCTION 'FP_JOB_CLOSE'
Steps to download the adobe form on your PC:-
convert the pdf into a binary file
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
*download the form on your PC
CALL METHOD cl_gui_frontend_services=>gui_download
Regards
Manisha -
HOW TO DOWNLOAD SAP OUTPUT TO EXCEL FILE
Hi SAP Gurus,
I would like to ask if you have any Function Module or codes on how to download SAP Output into Excel file. Thanks! Hope you could help me.You can transfer the contents of internal table to excel using this code..
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
posnr like vbap-posnr,
end of itab.
select vbeln
posnr
from vbap
up to 20 rows
into table itab.
* EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
* handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_WORK TYPE OLE2_OBJECT,
H_SHEET TYPE OLE2_OBJECT,
H_CELL TYPE OLE2_OBJECT,
V_COL LIKE SY-TABIX. " column number of the cell
DATA:
V_STEP(30),
V_FILE LIKE RLGRAP-FILENAME.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Creating Excel...'
EXCEPTIONS
OTHERS = 1.
* start Excel
V_STEP = 'Starting Excel'.
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
* CALL METHOD OF H_EXCEL 'OPEN' EXPORTING #1 = 'C:DMC_REC.XLS'.
* PERFORM ERR_HDL.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Adding Data to Excel...'
EXCEPTIONS
OTHERS = 1.
* Get the list of workbooks
V_STEP = 'Preaparing Excel'.
CALL METHOD OF H_EXCEL 'WORKBOOKS' = H_WORK.
PERFORM ERR_HDL.
** Add new workbook (create a file)
CALL METHOD OF H_WORK 'ADD'.
PERFORM ERR_HDL.
* Get the created worksheet
************************Sheet Number
CALL METHOD OF H_EXCEL 'WORKSHEETS' = H_SHEET EXPORTING #1 = 3.
************************Sheet Number
PERFORM ERR_HDL.
* Activate (select) the first sheet
CALL METHOD OF H_SHEET 'ACTIVATE'.
PERFORM ERR_HDL.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Adding Data to Excel...'
EXCEPTIONS
OTHERS = 1.
* output column headings to active Excel sheet
V_STEP = 'Adding data to Excel'.
LOOP AT ITAB.
V_COL = SY-TABIX.
PERFORM FILL_CELL USING 1 V_COL ITAB-vbeln.
PERFORM FILL_CELL USING 2 V_COL ITAB-posnr.
ENDLOOP.
V_STEP = 'Releasing Excel'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
H_EXCEL-HANDLE = -1.
*& Form ERR_HDL
* text
* --> p1 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Error in processing Excel File:', V_STEP.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
*& Form FILL_CELL
* text
* -->P_1 text
* -->P_1 text
* -->P_1 text
FORM FILL_CELL USING ROW COL VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_CELL
EXPORTING #1 = ROW #2 = COL.
PERFORM ERR_HDL.
SET PROPERTY OF H_CELL 'Value' = VAL .
PERFORM ERR_HDL.
ENDFORM. " FILL_CELL -
How to download the output of a report along with column header
Hi,
Could someone please tell me on how to download the output of a report along with column header to .txt format. A download option needs to be given to the user using physical and logical file names .The report basically contains header details and item details and requirement is to download the same format into an .txt format.Hello,
Try this FM:
Data: being of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
end of itab.
data:begin of fld_tab occurs 0,
fld_name(20),
end of fld_tab.
fld_tab = 'Material'.
append fld_tab.
fld_tab = 'Material Desc'.
append fld_tab.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME = 'C:\1.txt '
FILETYPE = 'DAT'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = itab
FIELDNAMES = fld_tab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 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.
Regards,
Naimesh -
How to download PDF attachment from gmail on iphone 5S
Hi,
How to download PDF attachment from gmail on iphone 5S
Regards
RamHello Ram2910
You should be able to view them natively within iOS. If you can view them in safari and want to save them, then download iBooks or search for other apps that can view and save them.
iBooks
https://itunes.apple.com/us/app/ibooks/id364709193?mt=8
iBooks: Viewing, syncing, saving, and printing PDFs on iPhone, iPad, and iPod touch
http://support.apple.com/kb/ht4227
Regards,
-Norm G. -
How to download pdf on mac OS X 10.8.3
How to download pdf on mac OS X 10.8.3, i have installed adobe reader but still doesnt open
Thanks
Bobsorry for hijacking but I have a related question to do with certificates.
I had to set up virtual domains manually instead of through the GUI and the server ssl site is now locked to a certificate that is about to expire and no longer needed, I can't change the certificate in the web gui because it was created manually, I can't delete the certificate because it is assigned to the server ssl website and I can't manually edit the conf files to point to a different certificate becasue it breaks it, any ideas? -
How to create PDF with Form Builder (T-Code:SPF) and how to use it?
How to create PDF with Form Builder (T-Code:SPF) and how to use it? Is there anyone can show me some doc. or PA material ? << removed >> Thank you very much!!
Edited by: Rob Burbank on Nov 11, 2010 1:04 PMPDF forms also known as Adobe From or Interactive Forms.
Check this link -
Interactive Forms
REG:ADOBE FORM
Adobe forms
Regards,
Amit -
How to downlad a string to the Presentation server
Hi all
How we can download a string to the presentation server <b>without</b> converting it to the internal table.
Am having a XML data as string. I want to bring that to the presentation server without converting it to internal table.
I have tried that by converting to table and downloaded the same as BIN file ......since we are disturbing the string while converting to itab am getting error while executing that XML file.
<b>Error as shown below.
Multiple colons are not allowed in a name. Error processing resource 'file:///D:/XXXXX.xml'. Line 705, Position 588
</w:fldData></w:fldChar></w:r><aml:annotation aml:id="3" w:type="Word.Bookmark.Start" w:name="Text9"/&g...</b>
Kindly help me in this regards.
Thanks in advance
Meikandanus the following code to convert the xml to itab which can then be use with gui_download with file type 'BIN'
data: coutput type string ,
xl_content type xstring ,
binary_content type solix_tab .
call transformation (`ID`)
source flights = flights[]
result xml output.
clear: xl_content .
* xl_content = output .
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = output
* MIMETYPE = ' '
* ENCODING =
importing
buffer = xl_content
exceptions
failed = 1
others = 2
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
refresh binary_content .
call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = xl_content
tables
binary_tab = binary_content.
Regards
Raja -
Hello All,
i created pdf form in livecycle.i am populating this pdf form and submit.when i am submiting form ,i will get the data in xfa(xml forms architecture).now i want to import this xml to indesign.when i importing this xml to indesign,it imported without rich text format.this means in indesign formate is not preserved when importing xfa(xml forms architecture).
how to import xfa(XML Forms Architecture) to indesign without losing rich text format.
please help me,its urgent.
thanks
HumayooI really have no idea what kind of file that is and how is the structure, but if it´s valid XML, I guess you could use InDesigns Tags to Styles mapping engine to format incoming stuff....
-
Save interactive adobe form in presentation server through report program
Hi All,
We have developed a interactive adobe form in SFP transaction and we are calling this form
from report program and we are able to save the form in presentation server.
But my scenario is that user provides input in interactive adobe form and i need to save the interactive adobe form
in display mode that to in presentation server with input values provided by the user.
could any help to achieve this or guide me if i am moving in a wrong path.
Thank you,
Harsha PIt all depends on what you want to do.
If you are planning on users to fill out on-line form only and submit to SAP, it is pretty easy to do (that is once you understand how to create web dynpro and interactive form).
You can also have users fill a form offline and upload to online and save it to SAP.
You do need to know little bit about coding (ABAP or JAVA),
but can be done w/ very minimum coding.
If you are planning on doing in Web Dynpro ABAP,
go to SE 80 and select WebDynpro and create form.
To save data/form to SAP, you probably want to use BAPI or Function module already available so that you don't have to do much coding to save data.
See some of these links for helpful tutorials. Thomas Jung has several good tutorials, but none of them probably have all the information you need... you just have to pick some from here and some from other places... If you have specific question, I will be happy to guide you...
Practical tips for developing with ABAP WebDynpro
Practical tips for developing with ABAP WebDynpro
http://help.sap.com/saphelp_nw2004s/helpdata/en/7c/3545415ea6f523e10000000a155106/frameset.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/c766e918-0b01-0010-99b1-c2b78cd059b3 -
Downloading .xml/.tx data to presentation server while running background.
Hi experts,
I have a requiremnt to downloading .xml/.txt data to presentation server while running background.
when i run the program in foreground with use of GUI_upload/ Gui_download its working fine but not working in background.
i can't use email/data download to database file and than get it option as data can be huge.
Can anybody help me out regarding this.
Thanks
Anuj jainHi anjui,
it'snt possible to download a file in background using gui_download.
You could try to create a Shell Command (transaction SM69) to transfer data in a shared directory.
You can execute Os Commands using function module SXPG_COMMAND_EXECUTE
Alessandro
Maybe you are looking for
-
Can I use iCloud for backup?
Can I use iCloud for backup?
-
Another User modified Table (ODBC -2039) - Sales order
Via a button on sales order form I delete some of the order lines with oMatrix.DeleteRow(rowNr). It works fine but the DocTotal is not updated as it will be if I delete the row manually with the right-click Delete Row command. When saving the order v
-
How do I tell firefox to stop saving a saved password
I had Firefox saved a password that I needed to change and now it won't let me put in a new password so I cannot get into the web site that I need to get into.
-
Bookmarks and Address Book don't sync in my iPAD
I have an iPad and Address Book and Safari Bookmarks stopped syncing. Any idea what to do. I have deleted my mobileme account twice, rebuilt it and reset also mobileme data twice. nothing helps.
-
Validate through Reg Expression
Hi, I have following requirement to be achieved through reg expressions. Need to write a boolean method which takes a String parameter that should satisfy following conditions. o 20 character length string. o First 9 characters will be a number o Nex