How to send generated form in PDF form through email
hi,
i am working on interactive form in Webdynpro Java, when i am trying to send pdf form as an attachment. i kept Email Submit button in the form and when i am clickink on send email button it is taking local outlook user in default and attachment as .XML attachment. i want attachment as .PDF form.
can any body please help.
thanks,
kishore.
hi,
Read the following blog it is explaining nicely about this scenario.
Sending mail with an online interactive form(pdf) as an attachment.
Thanks and Regards
shanto aloor
Similar Messages
-
Sending Adobe forms through Email and Fax
Hi ,
I have created an Adobe Form i.e. PO Form,
whose print/driver program is customised / based on SAPFM06P and routine used is ADOBE_ENTRY_NEU.
So , now I use the transaction ME22N and use the External Send option i.e sending Email , but the Email is getting sent to Spool instead of SOST.
So what changes do I need to make .
Can anyone tell me how do we send an Adobe Form through email * in which routine is based on Adobe_entry_neu .
Thanks in advance,
RohitHi,
Thanks for reply
The link u mentioned utilises Objects.. but can we send internet mail using this?
As we cannot change RECIPIENT TYPE in this case in the object.
I used this format in the program but the attachment is going to EXpress inbox. and goes to my SAP Inbox instead of Email .
So what changes we need to do for this.
Alternatively, can we use FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' for this purpose?
Edited by: Rohit Pareek on Feb 3, 2009 3:36 PM -
Sending sapscript form through Email
Hi,
I modifyed a std sapscript form for customer statement and that output i want to send to the customer through Email.So now i need a help for further what are the steps need to be do for sending that form by email.Pls be in details so that for me easy to solve this.
Thanks,
Rajendra.Hi ,
I am using the below code to send the form output by mail but it is not working for me.pls correct my code where i want to change so that i can solve my issues.
DATA: itcpo LIKE itcpo,
tab_lines LIKE sy-tabix.
Variables for EMAIL functionality
DATA: maildata LIKE sodocchgi1.
DATA: mailpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: mailbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailrec LIKE somlrec90 OCCURS 0 WITH HEADER LINE.
DATA: solisti1 LIKE solisti1 OCCURS 0 WITH HEADER LINE.
parameter: p_email1 like somlreci1-receiver .
PERFORM send_form_via_email.
FORM SEND_FORM_VIA_EMAIL *
FORM send_form_via_email.
CLEAR: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
REFRESH: mailtxt, mailbin, mailpack, mailhead, mailrec.
Creation of the document to be sent File Name
maildata-obj_name = 'TEST'.
Mail Subject
maildata-obj_descr = 'Subject'.
Mail Contents
mailtxt-line = 'Here is your file'.
APPEND mailtxt.
Prepare Packing List
PERFORM prepare_packing_list.
Set recipient - email address here!!!
mailrec-receiver = p_email1.
mailrec-rec_type = 'U'.
APPEND mailrec.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = maildata
put_in_outbox = ' '
TABLES
packing_list = mailpack
object_header = mailhead
contents_bin = mailbin
contents_txt = mailtxt
receivers = mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
ENDFORM.
Form PREPARE_PACKING_LIST
FORM prepare_packing_list.
CLEAR: mailpack, mailbin, mailhead.
REFRESH: mailpack, mailbin, mailhead.
DESCRIBE TABLE mailtxt LINES tab_lines.
READ TABLE mailtxt INDEX tab_lines.
maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
Creation of the entry for the compressed document
CLEAR mailpack-transf_bin.
mailpack-head_start = 1.
mailpack-head_num = 0.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'RAW'.
APPEND mailpack.
Creation of the document attachment
This form gets the OTF code from the SAPscript form.
If you already have your OTF code, I believe that you may
be able to skip this form. just do the following code, looping thru
your SOLISTI1 and updating MAILBIN.
PERFORM get_otf_code.
LOOP AT solisti1.
MOVE-CORRESPONDING solisti1 TO mailbin.
APPEND mailbin.
ENDLOOP.
DESCRIBE TABLE mailbin LINES tab_lines.
mailhead = 'TEST.OTF'.
APPEND mailhead.
Creation of the entry for the compressed attachment
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'OTF'.
mailpack-obj_name = 'TEST'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
APPEND mailpack.
ENDFORM.
Form GET_OTF_CODE
FORM get_otf_code.
DATA: BEGIN OF otf OCCURS 0.
INCLUDE STRUCTURE itcoo .
DATA: END OF otf.
DATA: itcpo LIKE itcpo.
DATA: itcpp LIKE itcpp.
CLEAR itcpo.
itcpo-tdgetotf = 'X'.
Start writing OTF code
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'Z2006FICSE'
language = sy-langu
options = itcpo
dialog = ' '
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'START_FORM'
EXCEPTIONS
error_message = 01
OTHERS = 02.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MAIN'
EXCEPTIONS
error_message = 01
OTHERS = 02.
Close up Form and get OTF code
CALL FUNCTION 'END_FORM'
EXCEPTIONS
error_message = 01
OTHERS = 02.
MOVE-CORRESPONDING itcpo TO itcpp.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
result = itcpp
TABLES
otfdata = otf
EXCEPTIONS
OTHERS = 1.
Move OTF code to structure SOLI form email
CLEAR solisti1. REFRESH solisti1.
LOOP AT otf.
solisti1-line = otf.
APPEND solisti1.
ENDLOOP.
ENDFORM.
Hope i can expect the feedback soon from you guys.
Thanks,
Rajendra. -
How to send offline forms as email in Portal level.
hello friends,
i am struck with a task.I need to send adobe forms as attachment to email to non sap users(i,e offline mode).this task has to be configured for managers using mss service(i.e through portal)...
how this can be done?
any material will be highly appreciated.Hi,
Try to use this one
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
Hope it can solve your problem!
Good luck!
Tao -
How to send an ouput as PDF attachment to email
Hi,
We have a 'Z' output for a delivery document. The output has the standard RLE_DELNOTE driver program and a Zsmart form assigned to it. We need to send the output as an attachment to email. Can some one please adivice how this can be achieved?
Thanks in advance
KatHi,
Plz try following steps.
1. Note the spool request No.
2. In T/code SE38, Enter The programme and execute.
3. In sub Object- Click Documentation and then do debuggung.
4.Enter spool request no and desired location and execute.
5. In ABAP Debugger- Use F8 key.
6. Select the desired location and file name and save.
View the desired output in PDF and can be sent through mail.
Hope this helps.
Regards,
Jaiprakash.P.T -
Unable send ADOBE form through email as attachment
Hello experts,
I was trying the [tutorial |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ee8a84ea-0c01-0010-5691-accfb0a172ed] on ADOBE interactive form through GP.
I am not able to send a form as an attachment as specifies in the document.
I have checked for all the required settings mentioned in the document and all seems to be ok.
Can anyone please provide a ray of help on how do I enable a ADOBE form to be passed as an attachment through email.
Thank you.
AshutoshHi,
just use a "Standard button", select it and go to the "Object" -> "Field" tab. Set the control type to "Submit". Go to the "Submit" tab. Set the submit format (e.g. PDF) and set the URL to "mailto:<receiver's email address>".
This will work fine without any JavaScript.
Take care,
Thomas -
How to send smart form as mail?
Hello everybody,
I have used the following code to send a smartform in PDF format through email.
I m able to view the contents of the mail in SAP Bussiness Workplace but UNABLE TO TRANSFER THE MAIL to an INTERNET ID (like gmail id or yahoo id).
Can anybody suggest me about what might have gone wrong?
Helpful answers will surely be rewarded.
code
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, " L_FM_NAME
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.
DATA: l_fm_name TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = p_l_formname
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = l_fm_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.
IF g_it3 = 'M'.
g_it3 = 'Mr'.
ENDIF.
IF g_it3 = 'F'.
g_it3 = 'Ms'.
ENDIF.
CALL FUNCTION l_fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
it = g_it
it1 = g_it1
it3 = g_it3
it4 = g_it4
it5 = g_it5
it6 = g_it6
it7 = g_it7
it8 = g_it8
it10 = g_it10
it14 = g_it14
it15 = g_it15
it36 = g_it36
it18 = g_it18
it37 = g_it37
it19 = g_it19
it9 = g_it9
it11 = g_it11
it13 = g_it13
it39 = g_it39
it40 = g_it40
it20 = g_it20
it21 = g_it21
it22 = g_it22
it23 = g_it23
it25 = g_it25
it26 = g_it26
it27 = g_it27
it28 = g_it28
it29 = g_it29
it30 = g_it30
it31 = g_it31
it32 = g_it32
it33 = g_it33
total = g_total
it34 = g_it34
it35 = g_it35
it2 = pa0006-begda
it12 = pa0001-begda
it16 = pa0015-begda
it17 = pa0001-endda
it24 = pa0002-endda
it38 = pa0002-begda
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
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.
g_semail = 'X'.
IF g_semail = 'X'.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION l_fm_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
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
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
otf = i_otf
lines = i_tline
lines = i_tline
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.
*convert PDF from 132 to 255
LOOP AT i_tline.
*Replacing space by '~'.
TRANSLATE i_tline USING '~'.
CONCATENATE wa_buffer i_tline INTO wa_buffer.
ENDLOOP.
*Repalacing '~' by space.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
*Appending 255 characters as a record.
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.
*Object with PDF.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES v_lines_bin.
Create Message Body
Title and Description
*Object with main text of the mail.
i_objtxt = 'Find attached the output of the smartform'.
APPEND i_objtxt.
i_objtxt = 'Regards'.
APPEND i_objtxt.
i_objtxt = 'Lokesh'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
*Document information.
wa_doc_chng-obj_name = 'Offer Letter'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'Offer Letter'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
*Pack to main body as RAW.
*Object to be transported not in binary form.
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
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.
Attachment
(pdf-Attachment)
*Packing as PDF
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = '[email protected]'.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'.
APPEND i_reclist.
*CALL FUNCTION 'LXE_SEND_MAIL_ATTMNT'
EXPORTING
description =
SENSITIVITY = 'O'
IN_OUTBOX = ' '
tables
receivers =
document_text =
DOCUMENT_ATTMNT =
DOCUMENT_ATTMNT_ATTR =
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
NO_AUTHORIZATION = 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.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = '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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
MESSAGE 'success' TYPE 'I'.
ENDIF.
ENDIF.
ENDFORM. " GET_OFFER_LETTERHere is the code to send the Smartform to mail as PDF attachment.
*& Report ZTEST_PDF_MAIL
REPORT ZTEST_PDF_MAIL.
Internal Table declarations
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.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST'
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'
IMPORTING
JOB_OUTPUT_INFO = W_RETURN
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
IMPORTING
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 <> 0.
ENDIF.
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.
Attachment
REFRESH: I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
CLEAR WA_OBJHEAD.
I_OBJBIN[] = 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 = 'RAW'.
APPEND I_OBJPACK.
Attachment (pdf-Attachment)
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
READ TABLE I_OBJBIN INDEX V_LINES_BIN.
I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
I_OBJPACK-BODY_NUM = V_LINES_BIN.
I_OBJPACK-DOC_TYPE = 'PDF'.
I_OBJPACK-OBJ_NAME = 'smart'.
I_OBJPACK-OBJ_DESCR = 'test'.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = '[email protected]'.
I_RECLIST-REC_TYPE = 'U'.
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.
If you want to send some text as Body of the Mail then follow this once
when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
I_OBJPACK-TRANSF_BIN = ' '.
I_OBJPACK-HEAD_START = 000000000000001.
I_OBJPACK-HEAD_NUM = 000000000000001.
I_OBJPACK-BODY_START = 000000000000002
I_OBJPACK-BODY_NUM = 000000000000010.
I_OBJPACK-DOC_TYPE = 'RAW'.
append I_OBJPACK-.
by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = '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.
regards,
srinivas -
Send XSTRING as a PDF attchament in Email
Dear Experts,
I have RFC which is retuning XSTRING as a PDF, by converting XSTRING to Sttring i'm able to display the PDF on portal
Now my requirement is to send the PDF in attached email, can any one help me out how to send XSTRING data(Formally PDF) in attachement email.
Thanks for you help.
Thanks
ABGot the soluation...By convering Xstign to Byte
Byte [] a = RFC return Xstring context attributes.();
Thanks -
Sending smartform as PDF attachment through email
Hi,
I have used the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send the smartform as PDF attachment through email.In SOST transaction I can see that the mail has been sent to the reciepient,but the mail is not going to the mail box.What would be the reason for this?
Regards,
HemaThat should be the basis issue. They needs to do some settings. Please ask them to do so.
Pranav -
Send oracle table to pdf file through forms 6i
please dear sirs,
I want to send oracle table to pdf file through forms 6i
waiting help
thanks in advance
Yasserdear Francois
i use this code which sarah give it to me
and i write as the following put not give me the pdf file
DECLARE
PL_ID PARAMLIST;
BEGIN
PL_ID := GET_PARAMETER_LIST('TEMPDATA');
IF NOT ID_NULL(PL_ID) THEN
DESTROY_PARAMETER_LIST(PL_ID);
END IF;
PL_ID := CREATE_PARAMETER_LIST('TEMPDATA');
ADD_PARAMETER(PL_ID, 'PARAMFORM', TEXT_PARAMETER, 'NO');
ADD_PARAMETER(pl_id, 'DESTYPE', TEXT_PARAMETER, 'FILE');
ADD_PARAMETER(pl_id, 'DESFORMAT', TEXT_PARAMETER, 'PDF');
ADD_PARAMETER(pl_id, 'DESNAME', TEXT_PARAMETER, 'D:\YASSER');
RUN_PRODUCT(REPORTS, 'D:\YASSER\crm02002.rep', ASYNCHRONOUS, RUNTIME, FILESYSTEM, PL_ID, NULL);
END;
pls help me and tell me where is the error which i did
thanks in advance dear -
Need to send Smart form via email through Driver program
Hi All,
We need to send smart form via email through a new driver program (z program). Can you please guide me on this.
I have used the following code to achieve this. We are getting message saying 'Mail request has created' when executed, but the mail is not sent.
lvs_comm_type = 'INT'.
lvs_comm_values-adsmtp-SMTP_ADDR = e_mail.
lvs_comm_values-adsmtp-R3_USER = 'X'.
lvs_comm_values-adsmtp-ENCODE = '0'.
call function 'CONVERT_COMM_TYPE_DATA'
exporting
pi_comm_type = lvs_comm_type
pi_comm_values = lvs_comm_values
pi_screen = ' '
pi_newid = 'X'
importing
pe_itcpo = lvs_itcpo
pe_device = lvf_device
pe_mail_recipient = p_mail_recipient
pe_mail_sender = p_mail_sender
exceptions
comm_type_not_supported = 1
recipient_creation_failed = 2
sender_creation_failed = 3
others = 4.
if sy-subrc ne 0.
raise COMMUNICATION_ERROR.
endif.
control_parameters-device = 'MAIL'.
output_options-TDIMMED = 'X'.
output_options-TDDELETE = 'X'.
CALL FUNCTION fm_name
exporting
CONTROL_PARAMETERS = control_parameters
MAIL_RECIPIENT = mail_recipient
MAIL_SENDER = mail_sender
OUTPUT_OPTIONS = output_options
USER_SETTINGS = space
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
Thank youHi,
For sending smartform output into mail you first have to generate spool request and convert it into PDF and then
only it can be sended into mail, please find the sample code in the mail below:
http://wiki.sdn.sap.com/wiki/display/sandbox/ConversionofSpoolRequestDataintoPDFandExcelFormatandSenditintoMail
Mansi
Edited by: Matt on Jan 29, 2010 8:25 AM - removed code, instead point to wiki that Mansi authored. -
How to send the output to PDF format in reports 6i?
Hi,
How to send the output to PDF format in reports 6i? I given Mode = BITMAP.
DESTYPE = File, DESFORMAT = PDF, DESNAME = C:\x.pdf.
Report is running fine. But PDF file not generated. I don't know what i missed. Any one can help this?
Thanks
KavithaHello,
Do you get this problem only for DESFORMAT=PDF ?
Test with :
DESFORMAT = RTF, DESNAME = C:\x.rtf
or
DESFORMAT = HTMLCSS, DESNAME = C:\x.html
does it work ?
Check if DESNAME is modified in the reports itself.
Regards -
Sending the adobe interactive form as non-interactive form through email
Hi ,
I am trying to send the interactive adobe form as non-interactive form through email.The interactive form size is very large because of the interactivity.
Can anybody suggest how to do this.
Regards,
DebasisDear Antony,
Thanks for the reply.
I got you but can you pls guide me how to go about it.
I need to send the email while submiting the form.So when and how i will be mapping each data node /attibutes of the main form with the intermediate form.My interactive form is of 30 pages and it may grow upto 40 pages.My response is with the to the main form where i am showing the success message.
Regards,
Debasis Nayak -
How to close infopath form through code?
Hi All,
How to close infopath form through code, thanks in advance!Hi Sam,
Please check if the articles below can be help:
http://www.bizsupportonline.net/browserforms/programmatically-submit-infopath-form-sharepoint-send-email-close-form.htm
http://www.bizsupportonline.net/blog/2009/01/how-to-programmatically-run-code-close-infopath-web-form/
Regards,
Rebecca Tu
TechNet Community Support -
Sending sapscript form by email
dear experts
i want to send sapscript forms by email from sap. how is it done. is there any configuration that needs to be doneHello,
I have done in case where we are sending to an external mail id.
Check the code it may help u.
REPORT Z_SCRIPT .
DATA: itcpo LIKE itcpo,
tab_lines LIKE sy-tabix.
Variables for EMAIL functionality
DATA: maildata LIKE sodocchgi1.
DATA: mailpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: mailbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailrec LIKE somlrec90 OCCURS 0 WITH HEADER LINE.
DATA: solisti1 LIKE solisti1 OCCURS 0 WITH HEADER LINE.
PERFORM send_form_via_email.
FORM SEND_FORM_VIA_EMAIL *
FORM send_form_via_email.
CLEAR: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
REFRESH: mailtxt, mailbin, mailpack, mailhead, mailrec.
Creation of the document to be sent File Name
maildata-obj_name = 'TEST'.
Mail Subject
maildata-obj_descr = 'Subject'.
Mail Contents
mailtxt-line = 'Here is your file'.
APPEND mailtxt.
Prepare Packing List
PERFORM prepare_packing_list.
Set recipient - email address here!!!
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
APPEND mailrec.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = maildata
put_in_outbox = ' '
TABLES
packing_list = mailpack
object_header = mailhead
contents_bin = mailbin
contents_txt = mailtxt
receivers = mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
ENDFORM.
Form PREPARE_PACKING_LIST
FORM prepare_packing_list.
CLEAR: mailpack, mailbin, mailhead.
REFRESH: mailpack, mailbin, mailhead.
DESCRIBE TABLE mailtxt LINES tab_lines.
READ TABLE mailtxt INDEX tab_lines.
maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
Creation of the entry for the compressed document
CLEAR mailpack-transf_bin.
mailpack-head_start = 1.
mailpack-head_num = 0.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'RAW'.
APPEND mailpack.
Creation of the document attachment
This form gets the OTF code from the SAPscript form.
If you already have your OTF code, I believe that you may
be able to skip this form. just do the following code, looping thru
your SOLISTI1 and updating MAILBIN.
PERFORM get_otf_code.
LOOP AT solisti1.
MOVE-CORRESPONDING solisti1 TO mailbin.
APPEND mailbin.
ENDLOOP.
DESCRIBE TABLE mailbin LINES tab_lines.
mailhead = 'TEST.OTF'.
APPEND mailhead.
Creation of the entry for the compressed attachment
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'OTF'.
mailpack-obj_name = 'TEST'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
APPEND mailpack.
ENDFORM.
Form GET_OTF_CODE
FORM get_otf_code.
DATA: BEGIN OF otf OCCURS 0.
INCLUDE STRUCTURE itcoo .
DATA: END OF otf.
DATA: itcpo LIKE itcpo.
DATA: itcpp LIKE itcpp.
CLEAR itcpo.
itcpo-tdgetotf = 'X'.
Start writing OTF code
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'Z08V3_COLLI'
language = sy-langu
options = itcpo
dialog = ' '
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'START_FORM'
EXCEPTIONS
error_message = 01
OTHERS = 02.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MAIN'
EXCEPTIONS
error_message = 01
OTHERS = 02.
Close up Form and get OTF code
CALL FUNCTION 'END_FORM'
EXCEPTIONS
error_message = 01
OTHERS = 02.
MOVE-CORRESPONDING itcpo TO itcpp.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
result = itcpp
TABLES
otfdata = otf
EXCEPTIONS
OTHERS = 1.
Move OTF code to structure SOLI form email
CLEAR solisti1. REFRESH solisti1.
LOOP AT otf.
solisti1-line = otf.
APPEND solisti1.
ENDLOOP.
ENDFORM.
I am sending to [email protected].
So proceed in similar manner and let me know if u face any problem.
Regards
Maybe you are looking for
-
when re connecting the power and pushing the on button, the typical start up sound is produced but the screen stays white. After a few moments the 'file' icon appears in the middle of the white screen with a question mark flashing in this icon.
-
IPod service repair...
I sent my U2 iPod last week for a battery checkup; I had trouble with it, anyway, I called Apple regarding the status of this and they confirmed me that they sent me a "new one"... Will I get the same iPod with another battery, a refurbished iPod or
-
Lumia 735 problems with email accounts
Hi! I've bought Lumia 735 for my mum. I've set up 2 email accounts for her, one as "Other", 2nd one, work account by using Exchange settings. It worked alright then. Now I cannot check emails on both accounts, there is information that both accounts
-
Alternative of Between Operator
BETWEEN Operator basically follows (>= AND <=) Logic I need to implement (> and <=) condition on some specific range data Remember: My range is grouped by some products what should i do???
-
I have been trying to make a directory chooser but I made a multiple files one. I need to have a directory chooser. Do you know whether it is possible that to be done in Flex? Thanks