Reg: Script Output in PDF form
Hai..
Can anybody tell me how we will get script output
(P.order output) in PDF format and we need to downlaod this PDF to our local drives. plz tell me the function modules to be used for this requirement and paste the code if any of you worked on this earlier..
Regards
Check this link for sample program.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/downloadSAPScriptoutputtoPDF+file.&
Function Module: CONVERT_OTF
Regards,
Maha
Similar Messages
-
To convert Sap Script output to PDF format and send it via email.
Hi Friends,
Could any one please tell me, how to convert the Sap Script output to PDF format and send it via email. If any one have the code, kindly mail me to [email protected]
Thanks & Regards,
JohnPlese check this sample code from other thread.
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.
The extension is put the it_mailpack-obj_name parameter of 'SO_NEW_DOCUMENT_ATT_SEND_API1'. -
Converting sap script output into pdf format?
Hi all,
I have modified the standard purchase order script form MEDRUCK . Now i need to generate the output into pdf format.
This is not only limited to spool requests , But also when the user creates the purchase order and clicks on print or print preview the output should be in pdf format.
Please help on where and what code has to be written for this requirement?
Thanks,
Aravind.Hi
I don't know which is your release, but I don't think it's possible to create a preview in pdf format, but u can create a pdf file instead of the spool and then open it automatically, this is an example:
- A) Open form
IF P_PDF = 'X'.
XDEVICE = 'PRINTER'.
* Get OTF
ITCPO-TDGETOTF = 'X'.
ENDIF.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DEVICE = XDEVICE
DIALOG = 'X'
FORM = 'ZFI_CL_EC_MOVI'
OPTIONS = ITCPO
MAIL_SENDER = LVS_SENDER
MAIL_RECIPIENT = LVS_RECIPIENT
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
B) Close FORM
CALL FUNCTION 'CLOSE_FORM'
TABLES
OTFDATA = T_OTF
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE I208(00) WITH 'Errore chiusura stampa'(A02).
ELSE.
PERFORM DOWNLOAD_PDF.
ENDIF.
C) Create PDF and open it:
FORM DOWNLOAD_PDF.
DATA: BIN_FILESIZE TYPE I.
DATA: T_FILE_PDF TYPE STANDARD TABLE OF TLINE,
DOCTAB_ARCHIVE TYPE STANDARD TABLE OF DOCS.
DATA: FILE_TABLE TYPE FILETABLE WITH HEADER LINE.
DATA: RC TYPE I,
USER_ACTION TYPE I.
DATA: TITLE TYPE STRING,
FILENAME TYPE STRING.
CHECK P_PDF = 'X'.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
BIN_FILESIZE = BIN_FILESIZE
TABLES
OTF = T_OTF
DOCTAB_ARCHIVE = DOCTAB_ARCHIVE
LINES = T_FILE_PDF
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE I208(00) WITH 'Errore conversione PDF'(A03).
EXIT.
ENDIF.
TITLE = 'Creare File'(T02).
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = TITLE
DEFAULT_EXTENSION = '*.pdf'
CHANGING
FILE_TABLE = FILE_TABLE[]
RC = RC
USER_ACTION = USER_ACTION
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE I208(00) WITH 'Errore creazione PDF'(A04).
EXIT.
ELSE.
IF USER_ACTION = 9. EXIT. ENDIF.
IF RC = 1.
READ TABLE FILE_TABLE INDEX 1.
ENDIF.
ENDIF.
MOVE FILE_TABLE-FILENAME TO FILENAME.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
BIN_FILESIZE = BIN_FILESIZE
FILENAME = FILENAME
FILETYPE = 'BIN'
CHANGING
DATA_TAB = T_FILE_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 I208(00) WITH 'Errore creazione PDF'(A04).
EXIT.
ELSE.
MESSAGE S208(00) WITH 'File creato con successo'(S01).
ENDIF.
CHECK P_OPEN = 'X'.
CALL FUNCTION 'CALL_BROWSER'
EXPORTING
URL = FILE_TABLE-FILENAME
EXCEPTIONS
FRONTEND_NOT_SUPPORTED = 1
FRONTEND_ERROR = 2
PROG_NOT_FOUND = 3
NO_BATCH = 4
UNSPECIFIED_ERROR = 5
OTHERS = 6.
IF SY-SUBRC <> 0.
MESSAGE S208(00) WITH 'Impossibile aprire file'(A05).
ENDIF.
ENDFORM. " DOWNLOAD_PDF
Max -
Hi All,
I have one report prg wich gives op in sap script.
I want same output in pdf and have to save on hard disk.
please suggest me wat procedure i have to follow.
It's urgentA very common requirement for programmers writing ABAP code for printing using SAPScript Forms is to redirect output to a PDF (Adobe Acrobat) file. I struggled for a few days trying to find a solution to this. Though I found quite a few examples on the web, it was difficult figuring out which technique was optimal. This tip is borne out of these struggles.
This is an example of how to use ABAP code to save output of a print routine using a SAPScript form into PDF format and also display it within the SAP frontend itself. This routine proves extremely useful to provide users the ability to save local copies of output and preview it within the user-friendly Acrobat Reader control, all without leaving the SAP frontend or your program. Since function modules are used, the code is portable and this technique can be used in any other ABAP program as well.
Two function modules, Z_DS_CREATE_LOCAL_PDF_FILE and Z_DS_CALL_PDF_VIEWER need to be created. I have used a function group called Z5_DS_PDF for this purpose. The function group contains the ABAP objects code for declaration and implementation of a class that encapsulates the Acrobat application functionality. The function group also contains a screen '0901', that epresents our PDF viewer and one PBO and one PAI block for the same screen.
Note: The following example has been stripped of essential error-handling for the sake of simplicity and the programmer is assumed to possess knowledge of creation of function groups, function modules, screens and SAPScript forms. ABAP objects or custom controls knowledge is not mandatory. Be patient when trying this out and follow all instructions thoroughly. The results will be worth the effort.
Steps to follow to get this example running:
1) Create a function group (Example : Z5_DS_PDF)
2) Define the top include and place the code listed below into it (LZ5_DS_PDFTOP)
3) Create screen '0901' in function group with three elements:
a) Pushbutton CLOSE at the top with function code 'CLO' (this is to exit preview screen)
b) Custom control container (Large- spanning entire screen) named MY_CONTAINER
c) The customary OK code field called OK_CODE
Note: The names of the elements should be exactly as described above
4) Create one output and one input module in the flow logic of screen '0901' for which the code is provided below
5) Define two function modules with the following signatures:
a) FUNCTION Z_DS_CREATE_LOCAL_PDF_FILE
EXPORTING
REFERENCE(AFILENAME) LIKE RLGRAP-FILENAME
TABLES
OTF_LINES STRUCTURE ITCOO
b) FUNCTION Z_DS_CALL_PDF_VIEWER
IMPORTING
VALUE(FILENAME) TYPE STRING
Code is provided below.
6) Compile and activate the function group
7) Create a simple SAPScript form with one page and one window
8) Define one element in the text for the main window called 'HELLO' and some static text in it
9) Check and activate the form
10) Create the example program (Example : Z5_DS_SCRIPT2PDF) with the below code
11) Run the example
NOTES: I tested this code in R/3 version 4.6C but it should work in all 4.6 setups. I'm pretty sure some of the ABAP objects code I have used may not work with R/3 4.0 versions and earlier. Also, it works perfectly only when Acrobat Reader is installed on the presentation server. I have checked it with Acrobat versions 4 and 5 but I haven't had the opportunity to check it with Acrobat Reader 6.
Code
Code inside top include LZ5_DS_PDFTOP of function group Z5_DS_PDF
FUNCTION-POOL Z5_DS_PDF. "MESSAGE-ID ..
CLASS CL_GUI_PDF DEFINITION *
CLASS CL_GUI_PDF DEFINITION
INHERITING FROM CL_GUI_CONTROL.
PUBLIC SECTION.
TYPES:
COL_TYPE TYPE INT4.
METHODS:
CONSTRUCTOR
IMPORTING
!PARENT TYPE REF TO CL_GUI_CONTAINER
VALUE(SHELLSTYLE) TYPE I OPTIONAL
VALUE(DISP_MODE) TYPE I OPTIONAL
VALUE(LIFE_TIME) TYPE I OPTIONAL
VALUE(NAME) TYPE STRING OPTIONAL
EXCEPTIONS
CNTL_ERROR
CNTL_INSTALL_ERROR.
METHODS:
LOADFILE
IMPORTING
VALUE(FILENAME) TYPE STRING
EXCEPTIONS
FILE_NOT_FOUND.
METHODS:
REFRESH.
METHODS:
DISPATCH REDEFINITION.
ENDCLASS.
DATA: MY_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA: MY_PDF TYPE REF TO CL_GUI_PDF.
data: ok_code like sy-ucomm.
data: file_name type string.
custom control class implementation
CLASS CL_GUI_PDF IMPLEMENTATION.
METHOD CONSTRUCTOR.
DATA:
CTRL_NAME(80) TYPE C.
IF NOT CL_GUI_OBJECT=>ACTIVEX IS INITIAL.
CTRL_NAME = '{CA8A9780-280D-11CF-A24D-444553540000}'.
ELSE.
RAISE CNTL_ERROR.
ENDIF.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
CLSID = CTRL_NAME
SHELLSTYLE = SHELLSTYLE
PARENT = PARENT
LIFETIME = LIFE_TIME
NAME = NAME
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
OTHERS = 2.
CASE SY-SUBRC.
WHEN 1.
RAISE CNTL_INSTALL_ERROR.
WHEN 2.
RAISE CNTL_ERROR.
ENDCASE.
CALL METHOD CL_GUI_CFW=>SUBSCRIBE
EXPORTING
REF = ME
SHELLID = ME->H_CONTROL-SHELLID
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC NE 0.
RAISE CNTL_ERROR.
ENDIF.
ENDMETHOD.
METHOD LOADFILE.
CALL METHOD ME->CALL_METHOD
EXPORTING
METHOD = 'LoadFile'
P_COUNT = 1
P1 = FILENAME.
ENDMETHOD.
METHOD REFRESH.
CALL METHOD ME->CALL_METHOD
EXPORTING
METHOD = 'Refresh'
P_COUNT = 0.
ENDMETHOD.
METHOD DISPATCH.
CALL METHOD CL_GUI_CFW=>FLUSH.
IF SY-SUBRC NE 0.
RAISE CNTL_ERROR.
ENDIF.
ENDMETHOD.
ENDCLASS.
End of code for LZ5_DS_PDFTOP
Code for Function Module Z_DS_CREATE_LOCAL_PDF_FILE
FUNCTION Z_DS_CREATE_LOCAL_PDF_FILE .
""Local interface:
*" EXPORTING
*" REFERENCE(AFILENAME) LIKE RLGRAP-FILENAME
*" TABLES
*" OTF_LINES STRUCTURE ITCOO
DATA: PDF_LINES
LIKE TLINE OCCURS 1000 WITH HEADER LINE,
ARCH LIKE TOA_DARA, NO_LINES TYPE I.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = NO_LINES
TABLES
OTF = OTF_LINES
LINES = PDF_LINES.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
BIN_FILESIZE = NO_LINES
FILENAME = 'c:test.pdf'
FILETYPE = 'BIN'
IMPORTING
ACT_FILENAME = AFILENAME
TABLES
DATA_TAB = PDF_LINES.
ENDFUNCTION.
End of Code for Z_DS_CREATE_LOCAL_PDF_FILE
Code for Function Module Z_DS_CALL_PDF_VIEWER
FUNCTION Z_DS_CALL_PDF_VIEWER .
""Local interface:
*" IMPORTING
*" VALUE(FILENAME) TYPE STRING
FILE_NAME = FILENAME.
IF MY_CONTAINER IS INITIAL.
CREATE OBJECT MY_CONTAINER
EXPORTING
CONTAINER_NAME = 'MY_CONTAINER'.
CREATE OBJECT MY_PDF
EXPORTING
NAME = 'MY_PDF'
PARENT = MY_CONTAINER.
ENDIF.
CALL SCREEN 901. " Ensure screen is created as per instructions
ENDFUNCTION.
End of Code for Z_DS_CALL_PDF_VIEWER
Flow Logic for screen '0901'
PROCESS BEFORE OUTPUT.
MODULE INIT.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0901.
End of Flow Logic for screen '0901'
PBO module INIT for screen '0901'
MODULE init OUTPUT.
call method my_pdf->loadfile
exporting filename = file_name.
ENDMODULE. " init OUTPUT
End of PBO module INIT for screen '0901'
PAI module USER_COMMAND_901 for screen '0901'
MODULE USER_COMMAND_0901 INPUT.
case ok_code.
when 'CLO'.
set screen 0.
endcase.
ENDMODULE. " USER_COMMAND_0901 INPUT
End of PAI module USER_COMMAND_901 for screen '0901'
Example program Z5_DS_SCRIPT2PDF
*& Report Z5_DS_SCRIPT2PDF *
*& This report works only if the function modules *
*& Z_DS_CREATE_LOCAL_PDF_FILE and Z_DS_CALL_PDF_VIEWER already exist *
*& Also use an already existing simple SAPScript Form that contains a *
*& window "MAIN" and rework printing code if necessary, remember to *
*& change the output device name in OPTIONS-TDDEST *
REPORT Z5_DS_SCRIPT2PDF.
PARAMETERS: FORM LIKE RSSCF-TDFORM DEFAULT 'Z5_DS_HELLO2'. "your form
DATA: OTF_LINES LIKE ITCOO OCCURS 1000 WITH HEADER LINE,
OPTIONS TYPE ITCPO, FILENAME LIKE RLGRAP-FILENAME,
FILENAME_S TYPE STRING.
START-OF-SELECTION.
OPTIONS-TDDEST = 'LP01'.
Replace 'LP01' above with your default output device
OPTIONS-TDCOPIES = 1.
OPTIONS-TDGETOTF = 'X'. " the key to returning OTF data
Open the SapScript Form with the name "form" *
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = FORM " name of form (SE71)
OPTIONS = OPTIONS
DIALOG = ' '.
Execute the element "HELLO" in window MAIN
- Nothing happens if /E HELLO is not declared in MAIN
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HELLO' "execute element /E HELLO
TYPE = 'BODY'. "normal output
Close the current SapScript Form
CALL FUNCTION 'CLOSE_FORM'
TABLES
OTFDATA = OTF_LINES. " Retrieve all the OTF so far
Code for PDF Formatting and creation of local File
CALL FUNCTION 'Z_DS_CREATE_LOCAL_PDF_FILE'
IMPORTING
AFILENAME = FILENAME
TABLES
OTF_LINES = OTF_LINES.
FILENAME_S = FILENAME.
Code to launch Adobe Acrobat inplace in SAPGUI
CALL FUNCTION 'Z_DS_CALL_PDF_VIEWER'
EXPORTING
FILENAME = FILENAME_S.
End of example program Z5_DS_SCRIPT2PDF -
Multi-Layer Document Script Triggers in PDF Form
I have a PDF form that has a total of 5 pages with text fields and navigation buttons. I would like the form to hide/unhide pages based on user input. For instance, the user will start on page 1. Once the user completes all the fields on page 1 the user will click on a button I laid out at the button of the page called "Next" and at this point a validation script should be triggered when the users clicks on the button to make sure all fields are completed before showing the information to be completed in Page 2. Basically I'd like my form to guide the user to the next page as long as the previous required fields are completed before the next page is shown (unhidden). If the fields from the previous page are not completed then the next page(s) will remain hidden.
How can I go about designing my form to do just that? Any and all your advise, input and help is greatly apreciated!You can use templates for this:
http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/wwhelp/wwhimpl/common/html/wwhel p.htm?context=Acrobat9_HTMLHelp&file=JS_Dev_Templates.80.1.html -
Hi,
Can anyone point me in the right direction with this problem?
I am using Dreamweaver CS3. Is there a php script I can use
to have the data that a user inputs into a form extracted and put
on a PDF form that pops up when the user clicks a button so the
user can then print and fax the completed form?
I would really appreciate any help.
Thanks,Why go to a PDF? Why not just print from a webpage?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Captain825" <[email protected]> wrote in
message
news:g707ol$3b8$[email protected]..
> Hi,
>
> Can anyone point me in the right direction with this
problem?
>
> I am using Dreamweaver CS3. Is there a php script I can
use to have the
> data
> that a user inputs into a form extracted and put on a
PDF form that pops
> up
> when the user clicks a button so the user can then print
and fax the
> completed
> form?
>
> I would really appreciate any help.
>
> Thanks,
> -
How to save sap script output in pdf document
hi abapers
how to save the output of sap script in sap so that can retrieve the saved document later.
i have to save the rcia output from sap script in pdf document in sap so that it can be retrieved later
how to use dmsPDF Creation + connection to DMS
cheers
Aveek -
Convert Script output into PDF and save into Unix Directory
Hi,
I had Sales Order Acknowledgement Output and wants to converted to PDFs and then these PDFs to be placed in Unix Directory
on their way to Docs Library.
I am using the following code
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = itcpp
TABLES
otfdata = lt_otf " OTF Data
EXCEPTIONS
unopened = 1
OTHERS = 2.
After this form , table ltf_otf is empty, So i am not converting into PDF .
So i need the logic to convert to PDF , and most importantly logic to save into UNIX Directory.
ThanksHi,
If you are using the Function Module "OPEN_FORM" to open the form for printing then in this function module there is an IMPORTING parameter OPTIONS which is of type ITCPO to this parameter "OPTIONS-TDGETOTF" needs to be passed as 'X' which will give you the OTF output in the FM "CLOSE_FORM".
After this call the FM "CONVERT_OTF" and pass the FORMAT as "PDF" which will give you the PDF output in LINES table Parameter. Most important please pass some dummy variable to BIN_FILESIZE variable.
Now by using OPEN DATASET file name FOR OUTPUT IN BINARY MODE and the LOOP the PDF table and use the TRANSFER statement to place the data in the UNIX File and then Finally use the CLOSE DATASET file name.
Hope will help to address your issue.
Regards,
SRinivas -
Improving performance of scripts in a PDF form
Hello there. I'm a bit new to the scripting in Acrobat and find myself with a complex form that has a number of instances (about 70) of the following script (specific to individual fields):
event.value=this.getField("Ranks").value + this.getField("Mod").value + this.getField("MiscMod").value;
var trained = "Untrained";
var skill = "Ranks";
if ( (this.getField(trained).value != "On" ) && (this.getField(skill).value < 1)) {
event.target.textColor = ["G", 1]; }
else {event.target.textColor = ["G", 0];}
The code works fine, but with this many instances, performance of form is sluggish while updating. In addition, there are approximately 200 simple addtion fields being used.
I'm looking for any advice, scripting or otherwise, to help improve performance.
Thanks so much in advance.If you create a function in the document scripts :
function updateField() {
event.value=this.getField("Ranks").value + this.getField("Mod").value + this.getField("MiscMod").value;
var trained = "Untrained";
var skill = "Ranks";
if ( (this.getField(trained).value != "On" ) && (this.getField(skill).value < 1)) {
event.target.textColor = ["G", 1]; }
else {event.target.textColor = ["G", 0];}
you could replace the code in each field with the following function call, and they would all use the same code:
updateField()
Without knowing exactly what 'slightly different code'' entails, you can add parameters to the function call:
function updateField(Rank, Mod, MiscMod) {
event.value= Rank + Mod + MiscMod;
var trained = "Untrained";
var skill = "Ranks";
if ( (this.getField(trained).value != "On" ) && (this.getField(skill).value < 1)) {
event.target.textColor = ["G", 1]; }
else {event.target.textColor = ["G", 0];}
and you could call it in each field with different values for 'Rank', 'Mod', and 'MiscMod' (or whatever parameters you use) like this:
updateField(getField("Ranks").value, this.getField("Mod").value, this.getField("MiscMod").value )
or
updateField(getField("aDifferentRanks").value, this.getField("aDifferentMod").value, this.getField("aDifferentMiscMod").value )
or
updateField(47, 12, 45)
If you need to make changes, you only need to change the 'updateField' function once, and any field which calls it will use the updated code. -
Reg: Script Output from Spool and Printer
Hello All,
I'm running ME22N TCode for a PO.
Now when I select Print Preview for a PO the Output is as desired.
But when I take the output from a Spool it's different.
Can any one tell me wht's the Problem is ?
Regards,
Deepu.KHello,
There are 2 Windows for Address of the sender and receiver.
Eg: Left side of the page ADDR1 and Right side of the Page ADDR2.
IN Print Preview I get the content of addr1 on the left side and the content of addr1 on the right hand side.
But in the SPool Output I get the Content of addr1 on the right side of the page and the content of the addr2 on the left side of the page.
Hope I'm clear in my explanation.
Regards,
Deepu.K -
Displaying a PDF form output in another Static PDF form
Hi ,,
I have developed a PDF form in Web Dynpro. The form is Working fine.
Now i want that after pressing the button "Submit" it should Navigate to the Next View(Display) and Displays the Output in PDF form(Static).
Is it possible to do this??
In short is it possible to have two views containing PDF forms in the same application and is navigation possible between them?
Regards
Pranayhi,
Create the data source for both views and map Interactiveform UI element
And you can give the plugs in as usual.
thanks,
Lohi. -
Is there a way to merge 3 or more report output in PDF into one
Hi All,
I know about the report sectioning. I am wondering is there any other way to merge 3 or more report output in pdf form to a single document.
I have seen that there are many thrid party tools. Wondering is there anything from Oracle reports feature or any Oracle product for this?
Thank You
Rajesh ALexIf not changing the reports design, third party tools is the only options. AFAIK, there is no Oracle proprietary tool for merging PDF files..
-
I am wanting to create a script in a PDF form format with Adobe 8.0 (or 5.0 if necessary, what I want it to do is when I fill out a form box "name" on page 3 I have the same thing "name" is there a way for it to bring the information from the first box to the second without me retyping it? I will be using this form A LOT. I am working for a hospice center and have to fill out a ton of paperwork and some of it is very repetitive. Any help would be great, I know a little javascript and I think it can be done with it, any ideas?
NoraIf you are using Acrobat and the Form Tool, just use the same name for the field name.
If you are using LiveCycle Designer, use the same name for the field name select "global" for the field's binding. -
Hi Experts,
I have copied the standard print program RFKORD50 to custom program ZRFKORD50 and changed the script as per our client requirement.
My issue is the after executing ZRFKORD50 the output needs to be displayed as PDF. Kindly help me how to displayed the current output to PDF and where i need to add the code to display as PDF.
Waiting for your valuable reply.
Thanks.
SunithaHi Team,
Please let me know what are the ways to display the script output to PDF.
Thanks,
Regards
Suni -
PDF format of script output in irregular format
Hi All,
I am getting script output in OTF format in 'CLOSE_FORM'
of standard sales order script.
This,I am able to send in PDF format as mail attachment by using function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
But the alignment and format of data in the attachment doesn't exactly match with original script output.
Can anyone help me in this regard? Thanks in advance
- jawaharHi,
disregard my earlier mail.
fill itcpo structure and try
<b> itcpo-tdgetotf = 'X'.
xdevice = 'PRINTER'. </b>
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = TNAPR-FONAM
LANGUAGE = NAST-SPRAS
<b> OPTIONS = ITCPO</b>
ARCHIVE_INDEX = TOA_DARA
ARCHIVE_PARAMS = ARC_PARAMS
DEVICE = XDEVICE
DIALOG = ' '
IMPORTING
RESULT = ITCPP
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
FORMAT_SRC = 'OTF'
FORMAT_DST = 'PDF'
DEVTYPE = 'HPLJ5SI'
TABLES
CONTENT_IN = CONTENT_IN
CONTENT_OUT = CONTENT_OUT
EXCEPTIONS
ERR_CONV_FAILED = 1
OTHERS = 2.
OBJBIN[] = CONTENT_OUT[].
endif.
DOC_CHNG-OBJ_NAME = TEXT-003.
doc_chng-obj_descr = text-001.
CONCATENATE TEXT-002 VBDKR-VBELN "zinvoice14-vessel
INTO DOC_CHNG-OBJ_DESCR SEPARATED BY SPACE.
IF SY-SYSID NE 'S4P'.
CONCATENATE DOC_CHNG-OBJ_DESCR TEXT-004 INTO DOC_CHNG-OBJ_DESCR
SEPARATED BY SPACE.
ENDIF.
OBJTXT = 'This is an example of a Sapscript emailed out of SAP'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Fill the fields of the packing_list for the main document:
It is a text document
CLEAR OBJPACK-TRANSF_BIN.
The document needs no header (head_num = 0)
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
but it has a body
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
of type RAW
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Create the attachment (the list itself)
IF NAST-KSCHL NE 'ZSTT'.
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
Fill the fields of the packing_list for the attachment:
It is binary document
OBJPACK-TRANSF_BIN = 'X'.
we need no header
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
but a body
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
of type ALI
IF NAST-KSCHL NE 'ZSTT'.
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'Attachment'.
OBJPACK-OBJ_DESCR = 'PDF file'.
READ TABLE OBJBIN INDEX TAB_LINES.
DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJBIN ).
OBJPACK-DOC_SIZE = DOC_SIZE.
APPEND OBJPACK.
ENDIF.
get E-mail address
loop at t_tvbdkr. "S4DK966284
w_name = t_tvbdkr-tdname. "S4DK966284
W_NAME = VBDKR-TDNAME. "S4DK966284
IF NAST-KSCHL EQ 'ZLEE'." or nast-kschl eq 'ZPRE'.
PERFORM READ_TEXT USING W_NAME 'Z555' 'VBBK'.
ENDIF.
IF SY-SUBRC EQ 0.
DELETE TDLINES WHERE TDFORMAT EQ '/*'
OR TDLINE EQ SPACE.
LOOP AT TDLINES.
RECIPIENT_INT-ADDRESS = TDLINES-TDLINE.
RECLIST-RECEIVER = RECIPIENT_INT.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
ENDLOOP.
if sy-subrc eq 0. "S4DK966284
exit. "S4DK966284
endif. "S4DK966284
ENDIF.
endloop.
LOOP AT T_TVBDPR.
CHECK T_TVBDPR-TDNAME+0(10) = VBDKR-TDNAME. "S4DK966284
W_NAME = T_TVBDPR-TDNAME.
IF NAST-KSCHL EQ 'ZLEE'.
PERFORM READ_TEXT USING W_NAME 'Z558' 'VBBP'.
ENDIF.
IF SY-SUBRC EQ 0.
DELETE TDLINES WHERE TDFORMAT EQ '/*'
OR TDLINE EQ SPACE.
LOOP AT TDLINES.
RECIPIENT_INT-ADDRESS = TDLINES-TDLINE.
RECLIST-RECEIVER = RECIPIENT_INT.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
ENDLOOP.
if sy-subrc eq 0. "S4DK966284
exit. "S4DK966284
endif. "S4DK966284
ENDIF.
ENDLOOP.
SEND THE DOCUMENT BY CALLING THE SAPOFFICE API1 MODULE
FOR SENDING DOCUMENTS WITH ATTACHMENTS
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
IMPORTING
SENT_TO_ALL = SENT_TO_ALL
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
Regards
amole
Maybe you are looking for
-
Problems with the videos in the gallery
Hi guys, I am experiencing problems viewing the videos from the gallery on my Nokia N8-00. Turns out I have 24 recorded videos, but these do not appear in the gallery of images, only in the menu "Videos". Before I could see them in the gallery, but d
-
Server Specs for crystal reports server
Hi, I am a prospect Crystal Reports Server customer. I am looking to find out Server Specs for a typical 10 CAL Crystal Reports Server deployment. The information for minimum spec seems to be widely available but not for a Spec for good performance.
-
XSLT stylesheet template for Endeca Records
Endeca Forge provides a Record Adapter which can load XML data, transformed (if required) to Endeca's XML record format by an XML Stylesheet Template (XSLT). This provides a way of getting XML into Endeca with a minimum of fuss, for data analysis, Po
-
Dear Friends, My client has the below scenario : Scenario 1: Step 1 : Customer supplies Raw Material A Step 2 : Client does goods inwards Step 3 : Processing happens at Clients Shop floor (RAW MATL "A" become
-
Why does my flash and shockwave player crash
Whenever I run anything in google chrome with my flash player or shockwave player it says flash or shockwave has crashed. Why?