‎2005 Aug 19 10:00 AM
i am using rstxpdft4 to convert the smartform to pdf. it is working fine. when i am giviing test-> print the spool id is been created. only one id has been created so all the next forms are appended to the same spool id. so for every run i want to have one spool id and i want to pass this spool id to the selection screen of the rstxpdft4. how this can be solved. waiting for ur replies.
instead i want to delete the previous spool id and generate new. can this is be possible thru this procedure
Message was edited by: Ateeq K
‎2005 Aug 19 10:34 AM
Hi Ateeq,
Did you select the 'New spool request' check box?
Also give different name of each print in the field 'Spool request name'. E.g 1,2,3 etc.
Pls let me know from where you are printing?
Thanks
Vinod
‎2005 Aug 19 11:06 AM
hai vinod,
thanks for the reply.
first of all i am going to the print preview. i am clicking test-> print and after that i am selecting f3 button (or) back button. here the spool prog rstxpdft4 has been called. now i am giving the generated spool id in this selection screen and executing.
previously i haven't given the new spool req. now i had given that.
including this i want to send the spool id to the selection screen of rstxpdf4, how to do this.
Message was edited by: Ateeq K
‎2005 Aug 19 11:24 AM
Hi Ateeq,
Check whether it is creating new spool request for each print out? Because now you have selected the 'New spool request'. Was this your problem?
If it is generating new spool request, then the program rstxpdft4 will generate pdf file for each print out.
Thanks
Vinod
‎2005 Aug 19 11:55 AM
thanx for ur reply.
it is working fine now.
how to catch the generated spoolid in a variable programatically. plz respond its urgent
also without giving the spoolid can we send the otf to pdf and save it in the system.
Message was edited by: Ateeq K
‎2005 Aug 19 11:58 AM
Hi,
Use FM 'CONVERT_OTF'.
call function 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = NUMBYTES
TABLES
OTF = ZOFTDATA
LINES = ZPDF
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = NUMBYTES
FILENAME = FILEPDF
FILETYPE = 'BIN'
IMPORTING
ACT_FILENAME = FILEPDF
FILESIZE = NUMBYTES
TABLES
DATA_TAB = ZPDF
EXCEPTIONS
OTHERS = 9.
Svetlin
‎2005 Aug 19 2:43 PM
hai Rusev,
i had used this code but it is not working.
when i debug, the zoftdata and zpdf including the numbtypes is also zero when the func. module is returned.
so these null values are passed to the download func, so it is not working. any suggestions regarding this are welcome.
‎2005 Aug 19 2:49 PM
Hi Ateeq,
What technique are you using for the ouput generation?
SAPScript or Smartform?
Follow these steps if you are using SAPScript.
1. Mark 'X' in the field TDGETOTF of the structure ITCPO of the FM: OPEN_FORM.
2. You will get the OTF data of the form in tables parameter of the FM: CLOSE_FORM.
3. The OTF data may be converted to PDF data by FM: CONVERT_OTF_2_PDF.
4. This PDF data may be downloaded by Function module GUI_DOWNLOAD.
For Smartforms
-
s_control_parameters-no_dialog = 'X'.
s_control_parameters-getotf = 'X'.
CALL FUNCTION v_func_name
EXPORTING
output_options = s_output_options
control_parameters = s_control_parameters
IMPORTING
job_output_info = s_job_output_info
......
......
call function 'CONVERT_OTF_2_PDF'
tables
otf = s_job_output_info-otfdata
lines = t_pdf
Thanks
Vinod
Message was edited by: Vinod C
‎2005 Aug 19 2:50 PM
Hi,
This is part of my code.
data: fm_name type rs38l_fnam,
I_SSFCTRLOP type SSFCTRLOP,
I_ssfcompop type ssfcompop,
E_ssfcrescl TYPE ssfcrescl.
if EPDF = 'X'.
I_SSFCTRLOP-getotf = 'X'.
I_SSFCTRLOP-no_dialog = 'X'.
I_ssfcompop-tdnoprev = 'X'.
endif.
.......
DESCRIBE TABLE T_BKPF LINES T_LINES.
loop at T_BKPF into S_BKPF.
....
if T_LINES > 1.
I_SSFCTRLOP-NO_OPEN = 'X'.
I_SSFCTRLOP-NO_CLOSE = 'X'.
at first.
I_SSFCTRLOP-NO_OPEN = SPACE.
I_SSFCTRLOP-NO_CLOSE = 'X'.
endat.
at last.
I_SSFCTRLOP-NO_OPEN = 'X'.
I_SSFCTRLOP-NO_CLOSE = SPACE.
endat.
endif.
...
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = I_SSFCTRLOP
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = I_ssfcompop
USER_SETTINGS = 'X'
S_BKPF = S_BKPF
S_FWBAS = S_FWBAS
S_FWSTE = S_FWSTE
S_FWTOT = S_FWTOT
S_WORDS = S_WORDS
S_PAYM = S_PAYM
V_BSEG = S_BSEG
P_TYPE = copy
I_USER = PUNAME
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = E_ssfcrescl
JOB_OUTPUT_OPTIONS =
TABLES
T_BSEG = T_BSEG
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
endloop.
if EPDF = 'X'.
PERFORM SAVE_TO_PDF TABLES E_ssfcrescl-OTFDATA.
endif.
FORM SAVE_TO_PDF TABLES ZOFTDATA STRUCTURE ITCOO.
data:
ZPDF LIKE TLINE OCCURS 100 WITH HEADER LINE,
NUMBYTES TYPE I.
call function 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = NUMBYTES
TABLES
OTF = ZOFTDATA
LINES = ZPDF
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = NUMBYTES
FILENAME = FILEPDF
FILETYPE = 'BIN'
IMPORTING
ACT_FILENAME = FILEPDF
FILESIZE = NUMBYTES
TABLES
DATA_TAB = ZPDF
EXCEPTIONS
OTHERS = 9.
endform.
I hope it will help you.
Svetlin
Message was edited by: Svetlin Rusev
Message was edited by: Svetlin Rusev
‎2005 Aug 19 3:47 PM
rusev,
i had tried as u had defined but it didn;t work. the smartform is not convrrted to the pdf here.
i had defined as u had defined, is there any need to increase 132 to 255 maxlinewidth.
plz respond
‎2005 Aug 19 3:52 PM
‎2005 Aug 19 4:49 PM
See this sample code. It partly covers the pdf coversion from smartform.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap-co... with code sample on smart forms.pdf
Svetlin
‎2005 Aug 19 9:02 PM
‎2005 Aug 19 10:39 AM
Hi Atteq
In my knowledge, we use Txn SCOT to do the same.
Right now, i'm not having access. I'm not sure for the program RSTXPDTT4, wheteher it is the same program behind SCOT. If different, try Txn SCOT for changing the format (default format for sending forms is OTF)
Regards
Ashish Jain
‎2005 Aug 19 11:18 AM
Hi,
It's possible to create pdf files directly from the ABAP program,where you call the smartform. There are a lot of threads to this topic. You should fill the following structures ( input parameters 😞
SSFCOMPOP ( field TDNEWID - new spool request )
SSFCTRLOP ( fields NO_OPEN, NO_CLOSE, GETOTF )
Svetlin