Converting a smartform to adobeform
Hi ,
i have already developed a smartform.but due to some changes in the client requirement we are making it into an adobe form
so i need a few clarification on the same
1)how can i import a smartform file which is in PDF format to the sfp layout
2) how can i ge the data from diferent internal tables to the layout
3)how can i colour the different tables to the colour we want
Hai,
Gothrough the following links,
Smartform to PDF
smartform to pdf conversion`
Regards,
Harish
Similar Messages
-
Content Not Coming Properly after converting a Smartform to PDF.
I am converting a smartform into PDF format using CONVERT_OTF .
This smart form will be triggered from the portal at the occurance of an event .After Conversion some texts are properly outputted in the PDF but some texts which are in arabic are not coming properly ( shows some junk data in a language other than Arabic).
Can any give a Solution ??
Thanks
Chaitanya Sharma
Edited by: chaitanya sharma on Jan 28, 2009 2:15 PMhi
try using this fm CONVERT_OTF_2_PDF
hope this helps
regards
Aakash Banga -
Hi, I have converted different smartforms to pdf format.How to combine pdf?
Hi All,
I have converted different smartforms to pdf format. How to combine all the pdf's into single pdf.
I need all the smartforms to be in single pdf.
Please help me in this regard.
Thanks in advance.Hi Keshu,
Individual pdf should be sent to individual user.
And at last all the pdfs of the smartform should be combined into one.
And admin have the provision to download it .
I mean the requirement is
For example.
For the month of september i will generate Pay Slip to each employee. And each pdf will be send to corresponding employee.
And finally all the pay slips of all the employees will be combined into single PDF and admin will download it and keep it for reference.
So as of now. I have generated individual pdfs and mailed it accordingly.
But how to combine it into one PDF is my question.
Please help me in this regard.
Thanks in advance. -
Difference between smartforms and adobeform
hi all,
can you tell me what are the differences between smartforms and adobeform?
Thanks,Search with your Subject line.
-
Converting a Smartform to ZPL format
Hi,
i'm facing the following Problem: i need to convert a smartform into zpl format.
I don't need to print the smartform on a ZPL printer by using SAP standard procedure, i need the Smartform in ZPL as a "string" to send it by RFC to a specified destination (where the ZPL will be printed, finally).
Thanks for your support,
greeting HannesHello Hannes,
there is actually a Smart Forms driver for Zebra label printers built into SAP. Device types LZEB2, LZEB3, LZEB6 use it (there are also other LZEBx device types, check out SAP notes for the differences).
You should first try if you can generate suitable output for your Zebra label printer from the Smart Form, via "normal" printing from SAP (i.e. via the SAP spooler and a connected Zebra printer).
If this works, then there is a way to solve this. What you need to do is: create the spool request from your print program via SMart Forms, but not print it (i.e. immediate print = FALSE). Remember you do need a valid printer definition in SAP for this, because Smart Forms needs one to generate the spool request.
Function module RSPO_PROCESS_DIALOG_JOB allows you to have your current ABAP program process the spool request (as if it was an SPO spool process), but not send anything to the printer but instead write the print data into a file on the application server. You can then use OPEN DATASET ... READ DATASET...CLOSE DATASET to retrieve the print data (make sure you use binary mode, so as to not modify the print data) and do whatever you want with it.
Best regards,
Alexander -
Problem in Language Convertion in Smartform
HI,
i have converted smartform text from EN to Spanish using SE63. Coversion is ok .
but My problem is in english the charater format is BOLD. in Spanish it is not displaying in BOLD.
if i execute the only Form it is Giving BOLD both in English and spanish.
but while executing with printprogram it is not displaying in BOLD in spanish?
Thanks
satyaHi,
In the text editor of the SE63 in spanish copy the exact format of english and write the translated language. It should be look like
RA - <B1>&W_NAME1&</>.
Where RA - Paragraph format
B1 - Character format
W_name1 is translated language in spanish.
Hope this will help you.
Thanks,
Abhijit Mandal -
Chinese characters can not be converted from Smartform to PDF
Hi gurus,
There are some smartform programs containing chinese and english in my R/3 system. Preview and printing are both OK.
But when I convert them into PDF using program RSTXPDFT2, all chinese display as ### or /// and so on in PDF files. But english characters are OK.
Here's some information:
1. I have checked settings in SCOT and use CNPDF for Chinese language as SAP recommend.
2. The font in smartform is CNSONG.
3. My R/3 is a unicode system.
4. My acrobat reader can read other chinese PDF files. Thus it's not my PC's problem.
Do you have any suggestions?
Thanks very much in advance!
Regards,
FrankI got the similar problem but with Japanese characters(runs windows japanese edition), I solved it with the help of our user but couldn't remember the exact solution(around 2 year back I did this), but I'm sure that she maintained some parameter ID in User profile and it solved our problem.
I am just passing this info as it may be useful to solve your problem.
Regards,
Sairam -
Vendor Payment Advices - Convert to SmartForms
My customer is currently changing all their SAPScripts to SmartForms to use a new fax service called Fax Maker (apparently Fax Maker won't accept SAP Script).
They run SAP 4.6C.
They want to change the Vendor Payment Advice but this doesn't seem to be able to accept SmartForm entry in the configuration (SPRO >> Financial Accounting >> Accounts Rec & Accounts Pay >> Business Transactions >> Outgoing Payment >> Auto Outgoing Payment >> Payment Method >> Setup Pay Comp Codes for Payment Trans).
How do I get Fax Maker to accept the Vendor Payment Advice?
I thought I could get the SAPScript to produce a pdf file and send this, but I'm not sure on how to do this.
Regards,
LouiseDear Pernille,
please kindly check the following hints to help you:
1) Please check whether you selected the check box in the variant
configuration "print payment advice". The variant is of the variant
that you maintain in the printout/data medium tab of transaction F110.
2) Unfortunately it's technically not possible to send remittance
advices per e-mail and to spool at the same time. You can only either
send advices per e-mail or send them to spool. This is the standard
system design.
3) Please check FBZP to the desired company code and payment method to
see if the customer has selected the flag "NoPaymentAdv.". It must be
set as "Always payment Advice" and afterwards the advices via e-mail is
executed.
4) Please refer the documentation on the sample function module:
'SAMPLE_PROCESS_00002040' in FIBF by following the Menu Path:
FIBF > Environment > Infosystem (Processes) > Click 'Execute' >
Select: 00002040 Autom. pmnt transactns: Output of pmnt advice note
5) To send a business partner a payment advice note by fax or email,You
must use the process interface 00002040 (Business Transaction Events)
define the selection of the message type (printout, fax or email).
Before you can do this, however, you must have carried out the
necessary technical (Basis) settings for faxing or sending emails.
6) Also consider the SAP note 836169.
Thanks.
Mauri -
Problem With Converting PO Smartform into PDF
Hi All,
I am trying to email the Smartform PO. I developed the program after reading several discuusions and blogs in forum. The PO is successfully created in PDF format and stored in the local directory. When i tried to view the pdf the PO is creatd twice in the PDF. I mean the original pdf is of 3 pages with PO and terms and conditons. But in the pdf which was created it has 6 pages. I am unable to understand why it has 2 copies of same PO.
When i tried to email the pdf as attachement the email is delivered successfully. But when i tried to view the pdf its given an error that "the file is corrupted (For example the attachemnt is not coded properly)or the fle type is not supported. Even in the attachment also i have the two files one is of pdf another is also of the .pdf but the image is showing as Unknown file format.
Any suggestions to resolve these issues.
ThanksMy code is as follows:
FORM print_form .
*Calling FM to retrieve the function module associated with the Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZMMS_MEDRUCK_LS'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = v_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.
control_parameters-langu = sy-langu.
control_parameters-no_dialog = 'X'.
control_parameters-getotf = 'X'.
Excuting the FM associated with the SmartForm by input required internal tables
CALL FUNCTION v_form_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = control_parameters
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = output_options
USER_SETTINGS = 'X'
IS_NAST = it_nast
IS_PEKKO = it_pekko
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = output_data
JOB_OUTPUT_OPTIONS =
TABLES
IT_EKPO = it_ekpo
IT_EKET = it_eket
IS_EKKO = it_ekko
IT_DRAW = it_draw
IT_BUYER = it_buyer
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.
tab_otf_final[] = output_data-otfdata[].
**removing the initial and final markers from the OTF data*********
DELETE output_data-otfdata WHERE tdprintcom = '//'.
searching for the end-of-page in OTF table************
DATA : my_tabix TYPE sy-tabix.
READ TABLE tab_otf_final WITH KEY tdprintcom = 'EP'.
my_tabix = sy-tabix + 1.
appending the modified OTF table to the final OTF table****
INSERT LINES OF output_data-otfdata INTO tab_otf_final INDEX my_tabix.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
bin_filesize = bin_filesize
TABLES
OTF = tab_otf_final
LINES = lt_lines
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 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.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = bin_filesize
FILENAME = 'D:TEST.PDF'
FILETYPE = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_EOL = ABAP_TRUE
IMPORTING
FILELENGTH = file_size
TABLES
DATA_TAB = lt_lines
FIELDNAMES =
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.
loop at LT_LINES INTO wa_lines.
translate wa_LINES using '~'.
concatenate WA_BUFFER wa_LINES into WA_BUFFER.
endloop.
translate WA_BUFFER using '~'.
do.
I_RECORD = WA_BUFFER.
append I_RECORD.
shift WA_BUFFER left by 255 places.
if WA_BUFFER is initial.
exit.
endif.
enddo.
Attachment
refresh:
I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
clear WA_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
APPEND I_RECORD.
Create Message Body Title and Description****************
I_OBJTXT = 'test with pdf-Attachment!'.
append I_OBJTXT.
describe table I_OBJTXT lines V_LINES_TXT.
read table I_OBJTXT index V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text*****************************
clear I_OBJPACK-TRANSF_BIN.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_TXT.
I_OBJPACK-DOC_TYPE = 'PDF'.
append I_OBJPACK.
Attachment (pdf-Attachment)*************
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 1.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_BIN.
I_OBJPACK-DOC_TYPE = 'PDF'.
I_OBJPACK-OBJ_NAME = 'smartform'.
concatenate I_OBJPACK-OBJ_NAME I_OBJPACK-DOC_TYPE into I_OBJPACK-OBJ_DESCR separated by '.'.
I_OBJPACK-OBJ_DESCR = 'test'.
I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
append I_OBJPACK.
Länge des Attachment ermitteln
clear I_RECLIST.
I_RECLIST-RECEIVER = '[email protected]'.
I_RECLIST-REC_TYPE = 'U'.
I_RECLIST-EXPRESS = 'X'.
data: TAB_LINES like SY-TABIX.
describe table I_OBJBIN lines TAB_LINES.
append I_RECLIST.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
tables
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_RECLIST
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.
if SY-SUBRC <> 0.
write:/ 'Error When Sending the File', SY-SUBRC.
else.
write:/ 'Mail sent'.
endif.
ENDFORM. " print_form -
Problem to convert a Smartform a PDF
Hello everybody,
I revised the forum and found several solutions to this. But I have the following problem: when execute the functions that transforms Smartforms to PDF in R3 this generates BinField good. But when I run the model from WebDynpro and attempted access to the field BinFile (returns for model) I get this error:
java.lang.ArrayIndexOutOfBoundsException: -1
It's as if the data is not in the field, as if the function dont get it. But when I run into R3 works fine.
I'm doing next to initialize the model structure:
Zbapi_Wty_Print_Claim_Input BapiWtyPrintClaim =
new Zbapi_Wty_Print_Claim_Input();
wdContext.nodeZbapi_Wty_Print_Claim_Input().bind(BapiWtyPrintClaim);
Someone knows how to solve this?Hello everybody,
I revised the forum and found several solutions to this. But I have the following problem: when execute the functions that transforms Smartforms to PDF in R3 this generates BinField good. But when I run the model from WebDynpro and attempted access to the field BinFile (returns for model) I get this error:
java.lang.ArrayIndexOutOfBoundsException: -1
It's as if the data is not in the field, as if the function dont get it. But when I run into R3 works fine.
I'm doing next to initialize the model structure:
Zbapi_Wty_Print_Claim_Input BapiWtyPrintClaim =
new Zbapi_Wty_Print_Claim_Input();
wdContext.nodeZbapi_Wty_Print_Claim_Input().bind(BapiWtyPrintClaim);
Someone knows how to solve this? -
PDF Error while converting from SMARTFORM
Hi ,
While opening the PDF file in Outlook, I am getting the error 'An unrecognized token '0RG' was found and the data is not appended to PDF .
Can anyone please tell me what may be the problem.
Thanks in advance,
Regards,
ShankarHi,
Chk the below code to download to pdf and crosscheck with ur code.
REPORT zpdf_g.
DATA: form_name TYPE rs38l_fnam, " Used to get the function module of Smartform
wa_ctrlop TYPE ssfctrlop, " Smart Forms: Control structure
wa_outopt TYPE ssfcompop, " SAP Smart Forms: Smart Composer (transfer) options
t_otfdata TYPE ssfcrescl. " Smart Forms: Return value at end of form printing
Data: t_pdf_tab type table of tline, " SAPscript: Text Lines
t_otf TYPE table of itcoo. " OTF Structure
Variables used to pass to GUI_DOWNLOAD
DATA: w_filesize TYPE i,
w_bin_filesize TYPE i.
Variables used for Save Dialog Box
DATA : file_name TYPE string,
file_path TYPE string,
full_path TYPE string.
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZPDF_G' "p_name
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.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_outopt-tdnoprev = 'X'.
CALL FUNCTION form_name
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_outopt
user_settings = 'X'
IMPORTING
job_output_info = t_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.
END-OF-SELECTION.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = w_bin_filesize
TABLES
otf = t_otf
lines = t_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 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.
----TAKING THE DOWNLOAD FILE PATH AS USER INPUT*
CALL METHOD cl_gui_frontend_services=>file_save_dialog
CHANGING
filename = file_name
path = file_path
fullpath = 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.
Download the file to the selected path
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = w_bin_filesize
filename = full_path "fname1
filetype = 'BIN'
IMPORTING
filelength = w_filesize
TABLES
data_tab = t_pdf_tab
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 i000(zpdf). "File not downloaded
ELSE.
MESSAGE i001(zpdf). "File downloaded
ENDIF. -
Convert the smartform output to PDF when giving print from vf31
Hi Gurus,
I am facing one problem.I developed the program to chnage smartform output to PDF file when giving invoice print from VF02/VF03.
The same functionality i want to appy when i am giving print for the invoice through VF31.
I put the break-point in the driver program.But it is not stopping there when i am giving print from VF31.
How can i do this one..
Please Help Me.
Thanks &Regards,
R.P.SastryWhich Program you are putting the Breakpoint?
-
Lock a PDF file when converted from Smartform
Hello Experts,
In our current project we have an urgent requirement to apply a Lock to a PDF document
so it cannot be amended. This is a PDF document and not an Adobe interactive
form, which currently cannot be used on the project. We are seeking help from
other colleagues who have had successful experience in achieving the creation
of a lock to the PDF document which is generated as an output from a SAP Smart
Form and then e-mailed to the recipient, in this case end Customers, therefore
integrity of information to prevent changes is a legal requirement. We are
aware of an encrypted password option but in this case we need to apply a lock
to the PDF document.
Many Thanks in advance,
Kind Regards,
NikhilDoes your pdf reader plugin need updating, are you on version 7, whilst current version is v10
* see [[opening pdf files within firefox]]
* and [[using the adobe reader plugin with firefox]] -
Process to Migrage or convert SmartForms to Adobe Forms
Hello Friends,
Could you please let me know the process(steps) to convert smartforms to AdobeForms.
I got to know there will be some formatting issues(by reading other Threads). But iam querious to convert the smartforms into adobeforms and i really dont know how.
Thanks..Hello!
Please, check this link -> [SAP Library|http://help.sap.com/saphelp_nw70/helpdata/EN/16/a369b1800e4bdda978ee0fe3b7bd2c/frameset.htm]
There are some (many?) constraints for the process. It is not going to be easy.
Regards,
Petr Perstnev
P.S. Use SEARCH -
Convert Smartform to PDF and send to SAP Workplace user
Hi to all.
I need help of somebody expert in SMARTFORM's.
I need to convert a smartform into PDF format and to send as attachement for SAP workplace
of the user.
I developed the next code.
IT is to function and to send the mail for SAP workplace, but it happens that smartform
contains images (logos) and tables, when the user tries to open the file pdf in inbox gives
to error - "An unrecognized token ' q0 ' was found".
I tried to call a smartform only with text and functioned well.
Somebody can help me?
My code:
Begin ***********************************************
REPORT zteste_nsa_send_pdf_sap_office.
DATA: t_print LIKE zeps_fm04 OCCURS 0 WITH HEADER LINE,
v_size TYPE i.
DATA: ls_bil_invoice TYPE lbbil_invoice.
TABLES: nast.
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZFPS_FICHA_VALORIZACAO'
IMPORTING
fm_name = v_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.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
is_bil_invoice = ls_bil_invoice
is_nast = nast
is_repeat = 'X'
IMPORTING
job_output_info = w_return
TABLES
t_list = t_print
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.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc EQ 0.
ENDIF.
Convert PDF from 132 to 255.
LOOP AT i_tline.
TRANSLATE i_tline USING '~'.
CONCATENATE wa_buffer i_tline INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
APPEND i_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
SEND MAIL
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
Object with PDF.
i_objbin[] = i_record[].
Object with main text of the mail.
i_objtxt = 'Fichas de Valorização e Esquemas Tipo'.
APPEND i_objtxt.
Document information.
wa_doc_chng-obj_name = 'SMART'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'Ficha de Valorização'.
wa_doc_chng-sensitivty = 'F'. "Functional object
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
Pack to main body as RAW.
Obj. to be transported not in binary form
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
Obj. to be transported in binary form
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'SMART'.
CONCATENATE 'Ficha_Valorizacao' '.pdf' INTO i_objpack-obj_descr.
i_objpack-doc_size = ( v_lines_bin - 1 ) * 255 + STRLEN( i_objbin ).
APPEND i_objpack.
e-mail receivers.
CLEAR i_reclist.
i_reclist-receiver = sy-uname.
i_reclist-rec_type = 'B'.
i_reclist-express = 'X'.
APPEND i_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = ' '
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
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.
IF sy-subrc EQ 0.
ENDIF.
End *************************************************
Thanks very much to all and Happy New year...
NelsonHi
See this report as example:
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
I believe before converting the print to pdf, you should print your document, get the spool and convert it.
Max
Maybe you are looking for
-
6 months of iphoto pics now missing. Where are they and how can I get them back?
Yesterday I was downloading some photos from my camera. When I finished I looked at my events and every photo and event from the last months were gone. The most recent download was preceded by pictures from last August and everything else was gone! I
-
When first launching Calendar in Month view, events are missing
On my iPad 1 running iOS 5.0.1, when I launch Calendar in Month view, the entire calendar is blank (no events). I have to either select a different view or create a new event in order for events to show up. This has been the case since upgrading to i
-
[solved] Cflags for AMD Athlon x4 750K
Hello there! I'm not sure if I've posted in right place. If not, please forgive me. Does anyone is familiar with proper cflags for AMD Athlon X4 750K B.E. ? I've searched around and opinions differ. Some people apply =athlon, some =amdfam10... I'm no
-
Hi all, When i am trying to import the data from oracle 8.0.3 to Oracle 9.2 in another machine, i am facing problem. As, i am having total 7 users in 8.0.3 and out of that i have successfullly imported 6 users without any problem. But for one user i
-
Hello, Hello I have XSAN with 4 MacPro's. Two of them are MDC and two clients. Suddenly the volumes disappeared from one of the clients. I checked on one of the mdc and the volumes were visible but in Xsan admin there was a message No visible luns. I