‎2009 Jul 25 1:47 PM
Hi All ,
i want to convert sapscript to pdf .
this is standart code , i don't know very good sapscript.
Thanks..
LOOP AT it7trg01 WHERE mark EQ 'X'.
CLEAR l_counter.
READ TABLE sirket WITH KEY begda = it7trg01-begda
sskis = it7trg01-isskno.
CALL FUNCTION 'START_FORM'
EXPORTING
startpage = 'PAGE1'.
PERFORM write_form.
LOOP AT fpper WHERE isskno EQ sirket-sskis
AND begda EQ sirket-begda.
ADD 1 TO l_counter.
PERFORM write_window USING 'MAIN' 'MAIN'.
ENDLOOP.
CLEAR fpper.
IF l_counter LT 12.
l_counter = 12 - l_counter.
DO l_counter TIMES.
PERFORM write_window USING 'MAIN' 'MAIN'.
ENDDO.
ENDIF.
CALL FUNCTION 'END_FORM'.
ADD 1 TO itcpo-tdcopies.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'.
‎2009 Jul 25 1:55 PM
Hi,
Use otfdata tables parameter of Close form to convert sapscript to PDF..check the code below..
CALL FUNCTION 'CLOSE_FORM'
TABLES
OTFDATA = OTF.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
BIN_FILESIZE = BIN_SIZE
TABLES
OTF = otf
DOCTAB_ARCHIVE = DOC
LINES = TLINES.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = BIN_SIZE
FILENAME = 'C:\anees\test.pdf'
FILETYPE = 'BIN'
TABLES
DATA_TAB = TLINES.
‎2009 Jul 25 1:51 PM
Hi,
To convert the sapscript output to pdf you will have to take the spool number and pass it to the program RSTXPDFT4.
This will convert the sapscript output into PDF.
Regards,
Ankur Parab
‎2009 Jul 25 1:55 PM
Hi,
Use otfdata tables parameter of Close form to convert sapscript to PDF..check the code below..
CALL FUNCTION 'CLOSE_FORM'
TABLES
OTFDATA = OTF.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
BIN_FILESIZE = BIN_SIZE
TABLES
OTF = otf
DOCTAB_ARCHIVE = DOC
LINES = TLINES.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = BIN_SIZE
FILENAME = 'C:\anees\test.pdf'
FILETYPE = 'BIN'
TABLES
DATA_TAB = TLINES.
‎2009 Jul 25 2:33 PM
hi
Ankur Parab yes it's true with spool number , but i don't find spool number in program .
Are you know how can i find it ?
avinas kodarapu i don't have a otfdata how can i find sapscript's otfdata ?
Thanks.
‎2009 Jul 25 2:39 PM
Hi,
In the CLOSE FORM FM you have the Tables Parameter OTFDATA .
CALL FUNCTION 'CLOSE_FORM'
TABLES
OTFDATA = OTF. " Use thisLater use CONVERT_OTF_2_PDF to convert PDF to OTF and Using GUI_DOWNLOAD download the PDF data.
‎2009 Jul 25 2:52 PM
‎2009 Jul 25 3:09 PM
‎2009 Jul 25 2:41 PM
Hi,
From the print program Call function 'END_FORM' ,the import parameter 'result' structure having "TDSPOOLID" field ,this is nothing but ,spool request no.,you have to pass this value to these function module...
plz,you can try this function module....
1.CONVERT_ABAPSPOOLJOB_2_PDF
2.CONVERT_OTFSPOOLJOB_2_PDF
3.CONVERT_OTF_2_PDF
4.CONVERT_OTF_2_PDF_ARCHIVELINK
Also,you can call the program "RSTXPDFT4" in Background Job in your print program.
I hope,it will help you...
<=<< Sharing Knowledge is a way to Innovative >=>>
By,
Yoga
‎2009 Jul 25 3:13 PM
‎2009 Jul 25 3:21 PM
Hi,
You need to pass this in Open_form FM..
* Setting the options
options-tdcopies = 1 ."Number of copies
options-tdnoprev = c_x."No print preview
options-tdgetotf = c_x."Return of OTF table
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 = options
IMPORTING
RESULT = w_res.
‎2009 Jul 25 3:36 PM
hi
i'm do it but error type : "for hr_fee_en absent CLOSE_FORM "
but i'm write at the bottom open form .
"hr_fee_en" my form name .
‎2009 Jul 25 4:08 PM
Hi,
Refer to this link..http://www.scribd.com/doc/454814/SAPSCRIPT-to-PDF
explained with example..
‎2009 Jul 25 5:12 PM