Send the infopath form in email through code
Hi,
I have a custom list form and on button click I need to send email with the form in the body of the mail.
Since I want to change the From Address, I cant use the email dataconnection with the infopath form.
I need to write code to send mail. But how will I get the form view as the body of the mail.
Could anyone please help me?
Hi,
Are you trying to submit an Infopath form by email or are you dealing with a "List" in SharePoint that you want to email out? Would you be able to clarify?
Also, when you say you want to change the From address, will that be static or be different based on some condition/value?
Pman
http://www.pmansLab.com/
Similar Messages
-
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 do I make a button onj the form which will submit and send the pdf as an email?
how do I make a button on the form which will submit and send the pdf as an email?
You can set up a button with a "Submit a form" action and use a mailto type URL to specify the email address you want the forms sent do. If you want to send the entire PDF, select that option and not FDF or anything else. The mailto URL should not include any spaces and the "mailto" part should be lowercase, like:
mailto:[email protected]
This will attempt to initiate an email using the users default email client. If the user does not have one set up or there is some other problem, the email might not get initiated. If it needs to work with Reader versions prior to 11, then the form needs to be Reader-enabled, which you do in Acrobat 11 by selecting: File > Save As Other > Reader Extended PDF > Enable More Tools -
Problem in sending the smartform as an email in a country specific language
Hi,
I am facing a problem in sending a smartform as a email for all other Languages except english and another problem is its sending the email but the output status is still in RED in the messages tab.
the program is working fine for english.
Please do find the below code using which i would be sending the smartform as an email for a PO along with the line item attachments.
Please help.
Arun.
Determine smartform function module for purchase document
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
error handling
ent_retco = sy-subrc.
IF sy-subrc = 1.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF sy-subrc = 2.
MESSAGE e002(/smb40/ssfcomposer) WITH tnapr-sform.
ENDIF.
PERFORM protocol_update_i.
ENDIF.
*Start of changes <Arun K Singarapu> C082493 <04/28/2008>
*for print preview
IF sy-ucomm = 'PREVOUTPUT' OR sy-ucomm = 'VIEW'.
CALL FUNCTION lf_fm_name "'/1BCDWB/SF00000197'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
is_ekko = l_doc-xekko
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
IMPORTING
job_output_info = wa_return
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
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.
EXIT.
ELSE.
wa_ctrlop-LANGU = nast-spras.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_compop-tdnoprev = 'X'.
CALL FUNCTION lf_fm_name "'/1BCDWB/SF00000197'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
is_ekko = l_doc-xekko
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
IMPORTING
job_output_info = wa_return
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
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.
*Convert the data from OTF to PDF format
it_otf[] = wa_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = l_len_in
bin_file = lp_xcontent
TABLES
otf = it_otf
lines = it_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.
TRY.
---------- create persistent send request ----------------------
send_request = cl_bcs=>create_persistent( ).
len = XSTRLEN( lp_xcontent ).
transform to solix tab
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = lp_xcontent ).
Create Body to the E-mail.
APPEND Text-005 TO l_text.
Attachment Name
l_ponumber = text-004.
CONCATENATE l_ponumber l_doc-xekko-ebeln INTO l_ponumber.
Subject for the E-Mail.
l_subject = text-001.
CONCATENATE l_subject l_doc-xekko-ebeln INTO l_subject.
*create document E-Mail.
CALL METHOD cl_document_bcs=>create_document
EXPORTING
i_type = 'RAW'
i_subject = l_subject
i_length = '13'
i_text = l_text
RECEIVING
result = l_email_object.
*Create PDF Document
bcs_doc = cl_document_bcs=>create_document(
i_type = 'PDF'
i_subject = l_ponumber
i_length = len
i_language = nast-spras
i_hex = lt_solix
*Type casting
obj_pdf_file ?= bcs_doc.
Add PDF document as an attachment
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_pdf_file.
get the attachments of the PO for each line item
SELECT ebeln
ebelp
FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln = l_doc-xekko-ebeln.
concatenate PO and the Line Item Numebr to get the Object key
LOOP AT it_ekpo INTO wa_ekpo.
CONCATENATE wa_ekpo-ebeln wa_ekpo-ebelp INTO wa_temp-objky.
APPEND wa_temp TO it_temp.
CLEAR: wa_temp,wa_ekpo.
ENDLOOP.
*Get data from table DRAD
IF it_temp[] IS NOT INITIAL.
SELECT dokar
doknr
dokvr
doktl
objky
FROM drad
client specified
INTO TABLE it_drad
FOR ALL ENTRIES IN it_temp
WHERE mandt = sy-mandt
AND objky = it_temp-objky.
ENDIF.
IF NOT it_drad IS INITIAL.
SELECT * FROM dms_doc2loio
INTO TABLE it_dms_doc2loio
FOR ALL ENTRIES IN it_drad
WHERE dokar = 'SRM'
AND doknr = it_drad-doknr
AND dokvr = it_drad-dokvr
AND doktl = it_drad-doktl.
ENDIF.
Get the Physical object class and Object ID of the attachment
IF NOT it_dms_doc2loio IS INITIAL.
SELECT * FROM dms_ph_cd1
INTO TABLE it_dms_ph_cd1
FOR ALL ENTRIES IN it_dms_doc2loio
WHERE loio_id = it_dms_doc2loio-lo_objid.
ENDIF.
Get the file from the DMS server using the below function module.
LOOP AT it_dms_ph_cd1 INTO wa_dms_ph_cd1.
wa_object_id-class = wa_dms_ph_cd1-ph_class.
wa_object_id-objid = wa_dms_ph_cd1-phio_id.
CALL FUNCTION 'SDOK_PHIO_LOAD_CONTENT'
EXPORTING
object_id = wa_object_id
client = sy-mandt
TABLES
file_access_info = it_file_access_info
file_content_binary = it_sdokcntbin
EXCEPTIONS
not_existing = 1
not_authorized = 2
no_content = 3
bad_storage_type = 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.
READ TABLE it_file_access_info INTO wa_file_access_info INDEX 1.
IF wa_file_access_info-mimetype = 'application/msword'.
l_doc_type = 'DOC'.
CLEAR: a_xstring,len.
LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
CONCATENATE a_xstring wa_sdokcntbin-line
INTO a_xstring IN BYTE MODE.
ENDLOOP.
len = XSTRLEN( a_xstring ).
transform to solix tab - adding additional attachments
REFRESH lt_solix.
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = a_xstring ).
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_solix
*Type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for PDF document
ELSEIF wa_file_access_info-mimetype = 'application/pdf'.
l_doc_type = 'PDF'.
file_size = wa_file_access_info-file_size.
Convert the 1022 binary data to xstring
CLEAR a_xstring.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = file_size
IMPORTING
buffer = a_xstring
TABLES
binary_tab = it_sdokcntbin
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: w_output_length TYPE i.
Convert Xstring to 255 RAW
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = a_xstring
IMPORTING
output_length = w_output_length
TABLES
binary_tab = lt_content_bin.
len = w_output_length.
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_content_bin
type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for Excel Document
ELSEIF wa_file_access_info-mimetype = 'application/msexcel'.
l_doc_type = 'XLS'.
CLEAR: a_xstring,len.
LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
CONCATENATE a_xstring wa_sdokcntbin-line
INTO a_xstring IN BYTE MODE.
ENDLOOP.
len = XSTRLEN( a_xstring ).
transform to solix tab - adding additional attachments
REFRESH lt_solix.
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = a_xstring ).
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_solix
*Type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for text doxument
ELSEIF wa_file_access_info-mimetype = 'plain/text'.
l_doc_type = 'TXT'.
file_size = wa_file_access_info-file_size.
Get the file name
l_filename = wa_file_access_info-file_name.
CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
EXPORTING
input_length = file_size
TABLES
binary_tab = it_sdokcntbin
text_tab = file_data
EXCEPTIONS
failed = 1
OTHERS = 2.
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 METHOD cl_document_bcs=>create_document
EXPORTING
i_type = l_doc_type
i_subject = l_filename
i_text = file_data
RECEIVING
result = bcs_doc1.
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
ENDIF.
CLEAR:it_file_access_info,it_sdokcntbin.
CLEAR:wa_object_id,wa_file_access_info,file_size.
ENDLOOP.
CALL METHOD send_request->set_document( l_email_object ).
*Get the address number for the vendor
SELECT SINGLE adrnr
FROM lfa1
INTO l_adrnr
WHERE lifnr = l_doc-xekko-lifnr.
MOVE l_adrnr TO l_addrno.
Get the Email Address for the vendor using address number
CALL FUNCTION 'ADDR_GET_REMOTE'
EXPORTING
addrnumber = l_addrno
TABLES
adsmtp = it_adsmtp
EXCEPTIONS
parameter_error = 1
address_not_exist = 2
internal_error = 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.
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flg_nouse = 'X'.
IF sy-subrc = 0.
LOOP AT it_adsmtp INTO wa_adsmtp WHERE flg_nouse = 'X'.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = wa_adsmtp-smtp_addr
RECEIVING
result = recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDLOOP.
ELSE.
READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flgdefault = 'X'.
IF sy-subrc = 0.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = wa_adsmtp-smtp_addr
RECEIVING
result = recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDIF.
ENDIF.
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = l_sent_to_all ).
CATCH cx_bcs INTO bcs_exception.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), bcs_exception->error_type.
EXIT.
ENDTRY.
ENDIF.Hi,
I am facing a problem in sending a smartform as a email for all other Languages except english and another problem is its sending the email but the output status is still in RED in the messages tab.
the program is working fine for english.
Please do find the below code using which i would be sending the smartform as an email for a PO along with the line item attachments.
Please help.
Arun.
Determine smartform function module for purchase document
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
error handling
ent_retco = sy-subrc.
IF sy-subrc = 1.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF sy-subrc = 2.
MESSAGE e002(/smb40/ssfcomposer) WITH tnapr-sform.
ENDIF.
PERFORM protocol_update_i.
ENDIF.
*Start of changes <Arun K Singarapu> C082493 <04/28/2008>
*for print preview
IF sy-ucomm = 'PREVOUTPUT' OR sy-ucomm = 'VIEW'.
CALL FUNCTION lf_fm_name "'/1BCDWB/SF00000197'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
is_ekko = l_doc-xekko
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
IMPORTING
job_output_info = wa_return
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
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.
EXIT.
ELSE.
wa_ctrlop-LANGU = nast-spras.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_compop-tdnoprev = 'X'.
CALL FUNCTION lf_fm_name "'/1BCDWB/SF00000197'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
is_ekko = l_doc-xekko
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
IMPORTING
job_output_info = wa_return
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
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.
*Convert the data from OTF to PDF format
it_otf[] = wa_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = l_len_in
bin_file = lp_xcontent
TABLES
otf = it_otf
lines = it_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.
TRY.
---------- create persistent send request ----------------------
send_request = cl_bcs=>create_persistent( ).
len = XSTRLEN( lp_xcontent ).
transform to solix tab
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = lp_xcontent ).
Create Body to the E-mail.
APPEND Text-005 TO l_text.
Attachment Name
l_ponumber = text-004.
CONCATENATE l_ponumber l_doc-xekko-ebeln INTO l_ponumber.
Subject for the E-Mail.
l_subject = text-001.
CONCATENATE l_subject l_doc-xekko-ebeln INTO l_subject.
*create document E-Mail.
CALL METHOD cl_document_bcs=>create_document
EXPORTING
i_type = 'RAW'
i_subject = l_subject
i_length = '13'
i_text = l_text
RECEIVING
result = l_email_object.
*Create PDF Document
bcs_doc = cl_document_bcs=>create_document(
i_type = 'PDF'
i_subject = l_ponumber
i_length = len
i_language = nast-spras
i_hex = lt_solix
*Type casting
obj_pdf_file ?= bcs_doc.
Add PDF document as an attachment
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_pdf_file.
get the attachments of the PO for each line item
SELECT ebeln
ebelp
FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln = l_doc-xekko-ebeln.
concatenate PO and the Line Item Numebr to get the Object key
LOOP AT it_ekpo INTO wa_ekpo.
CONCATENATE wa_ekpo-ebeln wa_ekpo-ebelp INTO wa_temp-objky.
APPEND wa_temp TO it_temp.
CLEAR: wa_temp,wa_ekpo.
ENDLOOP.
*Get data from table DRAD
IF it_temp[] IS NOT INITIAL.
SELECT dokar
doknr
dokvr
doktl
objky
FROM drad
client specified
INTO TABLE it_drad
FOR ALL ENTRIES IN it_temp
WHERE mandt = sy-mandt
AND objky = it_temp-objky.
ENDIF.
IF NOT it_drad IS INITIAL.
SELECT * FROM dms_doc2loio
INTO TABLE it_dms_doc2loio
FOR ALL ENTRIES IN it_drad
WHERE dokar = 'SRM'
AND doknr = it_drad-doknr
AND dokvr = it_drad-dokvr
AND doktl = it_drad-doktl.
ENDIF.
Get the Physical object class and Object ID of the attachment
IF NOT it_dms_doc2loio IS INITIAL.
SELECT * FROM dms_ph_cd1
INTO TABLE it_dms_ph_cd1
FOR ALL ENTRIES IN it_dms_doc2loio
WHERE loio_id = it_dms_doc2loio-lo_objid.
ENDIF.
Get the file from the DMS server using the below function module.
LOOP AT it_dms_ph_cd1 INTO wa_dms_ph_cd1.
wa_object_id-class = wa_dms_ph_cd1-ph_class.
wa_object_id-objid = wa_dms_ph_cd1-phio_id.
CALL FUNCTION 'SDOK_PHIO_LOAD_CONTENT'
EXPORTING
object_id = wa_object_id
client = sy-mandt
TABLES
file_access_info = it_file_access_info
file_content_binary = it_sdokcntbin
EXCEPTIONS
not_existing = 1
not_authorized = 2
no_content = 3
bad_storage_type = 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.
READ TABLE it_file_access_info INTO wa_file_access_info INDEX 1.
IF wa_file_access_info-mimetype = 'application/msword'.
l_doc_type = 'DOC'.
CLEAR: a_xstring,len.
LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
CONCATENATE a_xstring wa_sdokcntbin-line
INTO a_xstring IN BYTE MODE.
ENDLOOP.
len = XSTRLEN( a_xstring ).
transform to solix tab - adding additional attachments
REFRESH lt_solix.
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = a_xstring ).
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_solix
*Type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for PDF document
ELSEIF wa_file_access_info-mimetype = 'application/pdf'.
l_doc_type = 'PDF'.
file_size = wa_file_access_info-file_size.
Convert the 1022 binary data to xstring
CLEAR a_xstring.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = file_size
IMPORTING
buffer = a_xstring
TABLES
binary_tab = it_sdokcntbin
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: w_output_length TYPE i.
Convert Xstring to 255 RAW
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = a_xstring
IMPORTING
output_length = w_output_length
TABLES
binary_tab = lt_content_bin.
len = w_output_length.
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_content_bin
type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for Excel Document
ELSEIF wa_file_access_info-mimetype = 'application/msexcel'.
l_doc_type = 'XLS'.
CLEAR: a_xstring,len.
LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
CONCATENATE a_xstring wa_sdokcntbin-line
INTO a_xstring IN BYTE MODE.
ENDLOOP.
len = XSTRLEN( a_xstring ).
transform to solix tab - adding additional attachments
REFRESH lt_solix.
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = a_xstring ).
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_solix
*Type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for text doxument
ELSEIF wa_file_access_info-mimetype = 'plain/text'.
l_doc_type = 'TXT'.
file_size = wa_file_access_info-file_size.
Get the file name
l_filename = wa_file_access_info-file_name.
CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
EXPORTING
input_length = file_size
TABLES
binary_tab = it_sdokcntbin
text_tab = file_data
EXCEPTIONS
failed = 1
OTHERS = 2.
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 METHOD cl_document_bcs=>create_document
EXPORTING
i_type = l_doc_type
i_subject = l_filename
i_text = file_data
RECEIVING
result = bcs_doc1.
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
ENDIF.
CLEAR:it_file_access_info,it_sdokcntbin.
CLEAR:wa_object_id,wa_file_access_info,file_size.
ENDLOOP.
CALL METHOD send_request->set_document( l_email_object ).
*Get the address number for the vendor
SELECT SINGLE adrnr
FROM lfa1
INTO l_adrnr
WHERE lifnr = l_doc-xekko-lifnr.
MOVE l_adrnr TO l_addrno.
Get the Email Address for the vendor using address number
CALL FUNCTION 'ADDR_GET_REMOTE'
EXPORTING
addrnumber = l_addrno
TABLES
adsmtp = it_adsmtp
EXCEPTIONS
parameter_error = 1
address_not_exist = 2
internal_error = 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.
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flg_nouse = 'X'.
IF sy-subrc = 0.
LOOP AT it_adsmtp INTO wa_adsmtp WHERE flg_nouse = 'X'.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = wa_adsmtp-smtp_addr
RECEIVING
result = recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDLOOP.
ELSE.
READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flgdefault = 'X'.
IF sy-subrc = 0.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = wa_adsmtp-smtp_addr
RECEIVING
result = recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDIF.
ENDIF.
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = l_sent_to_all ).
CATCH cx_bcs INTO bcs_exception.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), bcs_exception->error_type.
EXIT.
ENDTRY.
ENDIF. -
For this program i could send the smart form thru mail but in the inbox ..
*& Report ZSFOO
REPORT ZSFOO.
*& Report ZSFINV
TABLES : KNA1, " General Data In Customer Master
KNB1, " Customer Master(Company Code)
BSID, " Accounting: Secondary Index for Customers
ZSMARTFORM, " Custom table for Storing Bank Details
zsf_exp_inv, " Structure that stores required fields from all tables used
KNVK. " Customer Master Contact Partner
data : Begin of it_struct occurs 0.
include structure zsf_exp_inv01.
data : End of it_struct.
types : begin of ty_bsid,
kunnr like bsid-kunnr,
WAERS like bsid-WAERS,
XBLNR LIKE BSID-XBLNR,
BUDAT LIKE BSID-BUDAT,
WRBTR LIKE BSID-WRBTR,
BUKRS LIKE BSID-BUKRS,
end of ty_bsid.
types : begin of ty_kna1,
kunnr like kna1-kunnr,
NAME1 LIKE KNA1-NAME1,
STRAS LIKE KNA1-STRAS,
MCOD3 LIKE KNA1-MCOD3,
LAND1 LIKE KNA1-LAND1,
SORTL LIKE KNA1-SORTL,
end of ty_kna1.
types : begin of ty_knb1,
kunnr like knb1-kunnr,
ZTERM LIKE KNB1-ZTERM,
end of ty_knb1.
types : begin of ty_knVK,
kunnr like kNVK-kunnr,
NAME1 LIKE KNVK-NAME1,
end of ty_knVK.
types : begin of ty_ZSMARTFORM,
SNO LIKE ZSMARTFORM-SNO,
CURRENCY LIKE zsmartform-currency,
BANKNAME LIKE zsmartform-bankname,
ADDRESS1 LIKE ZSMARTFORM-ADDRESS1,
ADDRESS2 LIKE ZSMARTFORM-ADDRESS2,
ADDRESS3 LIKE ZSMARTFORM-ADDRESS3,
ADDRESS4 LIKE ZSMARTFORM-ADDRESS4,
ADDRESS5 LIKE ZSMARTFORM-ADDRESS5,
ADDRESS6 LIKE ZSMARTFORM-ADDRESS6,
VALIDFROM LIKE ZSMARTFORM-VALIDFROM,
VALIDTO LIKE ZSMARTFORM-VALIDTO,
end of ty_ZSMARTFORM.
data : it_bsid type table of ty_bsid,
it_kna1 type table of ty_kna1,
it_knb1 type table of ty_knb1,
it_zsmartform type table of ty_zsmartform,
it_knVK type table of ty_kNVK.
data : wa_bsid like line of it_bsid,
wa_kna1 like line of it_kna1,
wa_knb1 like line of it_knb1,
wa_zsmartform like line of it_zsmartform,
wa_knVK like line of it_knVK.
*****************Selection Screen**********************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR,
S_belnr FOR BSID-belnr,
S_BUKRS FOR BSID-BUKRS,
S_CURR FOR ZSMARTFORM-CURRENCY.
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF IT_PARAM OCCURS 0.
INCLUDE STRUCTURE ZPARAMETERS.
DATA : END OF IT_PARAM.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
SKIP 1.
Parameters : OPTION1 AS CHECKBOX,
P_POINF(300) type c,
OPTION2 AS CHECKBOX,
P_DESC(300) TYPE C,
OPTION3 AS CHECKBOX,
P_MONTH(200) TYPE C,
OPTION4 AS CHECKBOX,
P_RATE(100) TYPE C.
SELECTION-SCREEN END OF BLOCK B2.
**********************PARAMETERS***********************************
data : l type i,
Y(300) type c,
j type i,
k type i value 1,
s type i,
m(300) type c,
p type i,
z type i.
data : l1 type i,
Y1(300) type c,
j1 type i,
k1 type i value 1,
s1 type i,
m1(300) type c,
p1 type i,
z1 type i.
data : l2 type i,
Y2(300) type c,
j2 type i,
k2 type i value 1,
s2 type i,
m2(300) type c,
p2 type i,
z2 type i.
data : l3 type i,
Y3(300) type c,
j3 type i,
k3 type i value 1,
s3 type i,
m3(300) type c,
p3 type i,
z3 type i.
IF OPTION1 = 'X'.
concatenate P_POINF ',' into P_POINF.
l = strlen( P_POINF ).
do l times.
Y = P_POINF+j(k).
case Y.
when ','.
m = P_POINF+s(z).
s = j + 1.
z = -1.
p = p + 1.
if p = 1.
IT_PARAM-LINE1 = m.
endif.
if p = 2.
IT_PARAM-LINE2 = m.
endif.
if p = 3.
IT_PARAM-LINE3 = m.
endif.
when '.'.
if p = 4.
IT_PARAM-LINE4 = m.
endif.
endcase.
j = j + 1.
z = z + 1.
enddo.
ENDIF.
IF OPTION2 = 'X'.
concatenate P_DESC ',' into P_DESC.
l1 = strlen( P_DESC ).
do l1 times.
Y1 = P_DESC+j1(k1).
case Y1.
when ','.
m1 = P_DESC+s1(z1).
s1 = j1 + 1.
z1 = -1.
p1 = p1 + 1.
if p1 = 1.
IT_PARAM-LINE5 = m1.
endif.
if p1 = 2.
IT_PARAM-LINE6 = m1.
endif.
if p1 = 3.
IT_PARAM-LINE7 = m1.
endif.
when '.'.
if p1 = 4.
IT_PARAM-LINE8 = m1.
endif.
endcase.
j1 = j1 + 1.
z1 = z1 + 1.
enddo.
ENDIF.
IF OPTION3 = 'X'.
concatenate P_MONTH ',' into P_MONTH.
l2 = strlen( P_MONTH ).
do l2 times.
Y2 = P_MONTH+j2(k2).
case Y2.
when ','.
m2 = P_MONTH+s2(z2).
s2 = j2 + 1.
z2 = -1.
p2 = p2 + 1.
if p2 = 1.
IT_PARAM-LINE9 = m2.
endif.
if p2 = 2.
IT_PARAM-LINE10 = m2.
endif.
if p2 = 3.
IT_PARAM-LINE11 = m2.
endif.
when '.'.
if p2 = 4.
IT_PARAM-LINe12 = m2.
endif.
endcase.
j2 = j2 + 1.
z2 = z2 + 1.
enddo.
ENDIF.
IF OPTION4 = 'X'.
concatenate P_RATE ',' into P_RATE.
l3 = strlen( P_RATE ).
do l3 times.
Y3 = P_RATE+j3(k3).
case Y3.
when ','.
m3 = P_RATE+s3(z3).
s3 = j3 + 1.
z3 = -1.
p3 = p3 + 1.
if p3 = 1.
IT_PARAM-LINE13 = m3.
endif.
if p3 = 2.
IT_PARAM-LINE14 = m3.
endif.
if p3 = 3.
IT_PARAM-LINE15 = m3.
endif.
if p3 = 4.
IT_PARAM-LINe16 = m3.
endif.
endcase.
j3 = j3 + 1.
z3 = z3 + 1.
enddo.
ENDIF.
APPEND IT_PARAM.
select * from kna1 into corresponding fields of table it_kna1 where kunnr in s_kunnr.
select * from knb1 into corresponding fields of table it_knb1 for all entries in it_kna1 where kunnr = it_kna1-kunnr.
select * from bsid into corresponding fields of table it_bsid for all entries in it_kna1 where kunnr = it_kna1-kunnr and belnr in s_belnr and bukrs in s_bukrs..
SELECT * FROM KNVK INTO CORRESPONDING FIELDS OF TABLE IT_KNVK FOR ALL ENTRIES IN IT_KNA1 WHERE KUNNR = IT_KNA1-KUNNR.
select * from zsmartform into corresponding fields of table it_zsmartform .
DATA : AMT LIKE SPELL.
loop at it_bsid into wa_bsid.
read table it_kna1 into wa_kna1 with key kunnr = wa_bsid-kunnr.
read table it_knb1 into wa_knb1 with key kunnr = wa_bsid-kunnr.
read table it_zsmartform into wa_zsmartform with key CURRENCY = wa_bsid-WAERS.
READ TABLE IT_KNVK INTO WA_KNVK WITH KEY KUNNR = WA_BSID-KUNNR.
it_struct-name1 = wa_kna1-name1.
it_struct-stras = wa_kna1-stras.
it_struct-mcod3 = wa_kna1-mcod3.
it_struct-land1 = wa_kna1-land1.
it_struct-sortl = wa_kna1-sortl.
it_struct-zterm = wa_knb1-zterm.
it_struct-xblnr = wa_bsid-xblnr.
it_struct-currency = wa_zsmartform-currency.
it_struct-currency = wa_bsid-waers.
it_struct-budat = wa_bsid-budat.
it_struct-BANKNAME = wa_zsmartform-BANKNAME.
it_struct-ADDRESS1 = wa_zsmartform-ADDRESS1.
it_struct-ADDRESS2 = wa_zsmartform-ADDRESS2.
it_struct-ADDRESS3 = wa_zsmartform-ADDRESS3.
it_struct-ADDRESS4 = wa_zsmartform-ADDRESS4.
it_struct-ADDRESS5 = wa_zsmartform-ADDRESS5.
it_struct-ADDRESS6 = wa_zsmartform-ADDRESS6.
it_struct-CURR = WA_BSID-WRBTR.
IT_STRUCT-NAME = WA_KNVK-NAME1.
IT_STRUCT-AMOUNT = IT_SPELL-AMT.
append it_struct.
endloop.
data : x type i,
x1 type i,
a type string.
loop at it_struct.
x = strlen( it_struct-curr ).
x1 = x - 3.
a = it_struct-curr+0(x1).
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = a
CURRENCY = ' '
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = AMT.
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 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.
endloop.
DATA: ws_ucomm LIKE sy-ucomm.
DATA: form_name TYPE rs38l_fnam.
DATA: wa_ctrlop TYPE ssfctrlop,
wa_outopt TYPE ssfcompop.
data : i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: t_otfdata TYPE ssfcrescl,
t_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
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.
data : wa_objhead TYPE soli_tab,
wa_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,
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: t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE string.
DATA: w_bin_filesize TYPE i.
wa_ctrlop-getotf = 'X'.
CALL FUNCTION '/1BCDWB/SF00000001'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_outopt
user_settings = 'X'
IN_WORDS = amt
importing
job_output_info = t_otfdata
TABLES
I_ZSF_EXP_INV = it_struct
I_ZPARAMETERS = it_param.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
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.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
bin_filesize = w_bin_filesize
CODEPAGE = ' '
filename = 'c: est59.PDF'
filetype = 'BIN'
IMPORTING
filelength = w_filesize
TABLES
data_tab = t_pdf_tab
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10
IF sy-subrc <> 0.
*You should include message-id in the report heading
WRITE : sy-subrc.
ELSE.
WRITE : 'File Test.pdf downloaded succesfully'.
ENDIF.
loop at t_pdf_tab.
translate t_pdf_tab using '~'.
concatenate wa_buffer t_pdf_tab 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 = 'O'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
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.
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 'Hazard report-' p_load '.pdf' INTO i_objpack-obj_descr.
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-obj_descr = 'test'.
i_objpack-doc_size = v_lines_bin * 255.
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.
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 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
COMMIT_WORK = 'X'
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.
for this program i could send the smart form thru mail but in the inbox i could not
download it it says needed to be decoded properly.file not starting with pdf....
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Mail sent'(003)
txt1 = 'The report is sent via e-mail.'(004)
txt2 = ' '.
LEAVE PROGRAM.
ENDIF.hi krishna,
u r right. there is no error in sending the mail and the file but the problem is that file created and converted to pdf is not done properly.jst verify whether the file is created properly or not .thats the only problem that can occurs else ur program is absolutely right. -
Is possible to take the Infopath form with two repeat section in one SharePoint list
Is possible to take the Infopath form with two repeat section in one Sharepoint list
Take two repeat section and put them one bellow to other one in a SP list.
The motive is that the first repeat section is based in account own by the requestor and the second repeat section is when the requestor is doing backup time for some one else where need to log the amount of time that spend in the peer account.
I have basic logic in the form when requestor said Are you doing backup for some else? and press YES it is be able to use the second repeat section.
Le me know how much pain full is going tobe or not..
–Q1: Is possible to do this ? With codeless or not
–Q2:What steps I need to do to accomplish this? feasible or not
the following picture give a better idea of what I am looking to accomplish:
CRISTINA&amp MICROSOFT ForumHi,
Thank you for your question. I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience. Thank you for your understanding and support.
Thanks,
Linda Li
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Linda Li
TechNet Community Support -
How can i recover my security questions without the link to send the answers to my email?
how can i recover my security questions without the link to send the answers to my email?
You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
(125931) -
When I go to buy an app that isn't free it asks for my security question but I don't know what my security question is so I go to change it and it said it will send the info to this email that I don't even have. What do I do?
Alternatives for Help Resetting Security Questions and/or Rescue Mail
1. If you have a valid rescue email address, then use this procedure:
Rescue email address and how to reset Apple ID security questions.
2. Fill out and submit this form. Select the topic, Account Security. You must
have a Rescue Email to use this option.
3. This is the only option if you do not already have a valid Rescue Email.
These are telephone numbers for contacting Apple Support in your country.
Apple ID- Contacting Apple for help with Apple ID account security. Select
the appropriate country and call. Ask to speak to the Account Security Team.
4. Account security issues almost always require you to speak directly to an
Apple representative to securely establish your identity as the account holder.
You can set it up so that Apple calls you, either immediately or at a time
convenient to you.
1. Go to www.apple.com/support.
2. Choose Contact Support and click Contact Us.
3. Choose Other Apple ID Topics and choose the appropriate topic for
your issue.
4. Follow the onscreen instructions.
Note: If you have already forgotten your security questions, then you cannot
set up a rescue email address in order to reset them. You must set up
the rescue email address beforehand.
Your Apple ID: Manage My Apple ID.
Apple ID- All about Apple ID security questions. -
I have forgoten my questions which were made in fifth grade. I am sending the reset to my email, but I do not see it. I have 2 emails, but neither of them have it. I just want to be able to buy something on my new iphone
Unless the email is in a spam filter, you need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
(125971) -
Is there any way to click the System Message Box button through code?
Hi,
Is there any way to click the System Message Box button through code?
Is there any way to restrict the System Message Box ?
The requirement is, i need to open the MRP Wizard form in MRP.it s run automatically.after completion of the wizard is there finish button.after clicking of the finish button, there have a system message. i want to click on "Yes" button through coding.
when system message box open.my code is stopped.if i press yes code is running.
Thanks in advance.Thanks for replay
bellow given the code
i am using, when i call the finishMrp function its going to take the itemId from XML and click to the finish button.
There have a system message .when system message fair my debugging stopped. Please give me any idea.
Public Function Execuate() As Boolean
Dim strSQL As String
Dim objRS As SAPbobsCOM.Recordset
Dim intLoop As Integer
Dim objForm As SAPbouiCOM.Form
objForm = objAddOnCentral.objApplication.Forms.ActiveForm
objRS = objAddOnCentral.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
strSQL = "SELECT U_MRPCode From [@ACSYMRPLIST]"
objRS.DoQuery(strSQL)
If objRS.EoF Then
Throw New Exception("No MRP Scenario Scheudled")
Return False
End If
For intLoop = 1 To objRS.RecordCount
objForm.Freeze(True)
If intLoop = 1 Then
initializeMRPRun()
System.Windows.Forms.Application.DoEvents()
Else
reinitialize()
System.Windows.Forms.Application.DoEvents()
End If
MRPRun(objRS.Fields.Item("U_MRPCode").Value)
System.Windows.Forms.Application.DoEvents()
objForm.Freeze(False)
objRS.MoveNext()
Nex
finishMRPRun()
Return True
End Function
Private Sub finishMRPRun()
Dim strResource As String
Dim objXML As New XmlDocument
Dim objXMLNode As XmlNode
Dim objXMLNodeList As XmlNodeList
strResource = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name & "." & "AutoStart.xml"
objXML.Load(System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(strResource))
objXMLNodeList = objXML.SelectNodes("/AutoMRPScript/FinishMRP/Instruction")
For Each objXMLNode In objXMLNodeList 'objXML.ChildNodes.Item(1).ChildNodes
Select Case objXMLNode.Attributes("OPType").Value
Case "2"
systemMessageactiveFormButton(objXMLNode)
End Select
Next
End Sub
Private Sub systemMessageactiveFormButton(ByVal Instruction As XmlNode)
Dim objForm As SAPbouiCOM.Form
objForm = objAddOnCentral.objApplication.Forms.ActiveForm
objForm.Items.Item(Instruction.Attributes("ItemID").Value).Click()
End Sub
Edited by: Badulla Sk on Dec 31, 2009 11:24 AM
Edited by: Badulla Sk on Dec 31, 2009 11:25 AM -
How can I reset my security questions even when it doesn't give me the option to send the answers to my email??? I honestly dont even remember doing any security questions. This has just now become an issue since it has stop letting me purchases music on my Mac or IPhone.
To Reset Your Security Questions, You will need to call Apple (0800 048 0408) and Reset them, you'll need for verification access to the apple id web page (myappleid.apple.com) and it will ask for a temporary pin and also a iDevice on hand to recieve a code from Apple in order to reset your security questions
-
I have three iPads and one iPod and one iPhone. How can I message between them without sending the message to all of them. You send the message to your email address but all of them are set up under one account.
You can have a different receiving email in the Messages app on each device : Settings > Messages > Receive At . I'm not sure that there is a different way to have the message only go to one device.
-
Regarding Pages: I was writing using the app Pages when I left the page I was writting on but now I can't access it at all. I have tried to send the document to my email, I've tried to make a copy but nothing seems to work. The document still exists and I can see my writting as I can with all other documents but I can't open that page.
Try:
- Reset the iOS device. Nothing will be lost
Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Connect the iPad to your computer and try to get the document via File sharing
- Try getting the document from iCloud.com if you are using iCloud -
How to create Reports for the infopath form data
Hi All,
I have a requirement to generate reports in SharePoint based on InfoPath form data which is submitted into form library. Do I need to store each InfoPath form data into SQL Database/MS Access Database. if yes, can any one help me on this how
to save InfoPath form data into DB while submitting into "Form Library". based on the data stored in DB how to create and view the report in SharePoint?.
Thanks in Advance,
Satish
Thanks & Regards Satish DugasaniThank you for asking the questions for clarification, my requirement is like below
1. Need to insert all infopath form fields data into Access Database when i am submitting to the Form library
2. Create Access Reports like based on time period, based on submitter name, based on state, city, and combination of these etc.
3. Sync Access Database every time i am updating the form
4. View Access Reports in share point site
PS: I worked on this like below approch
1. Written Web Service to Sync Access Database for the Infopath form
2. Create Access Reports
3. Publish using "Publish to Access Services" by providing site URL it will create a subsite there i can able to see reports, tables, macros etc. but that is not an user friendly like i am not able to apply my branding because it is pointing to /_Layouts/accsrv/Modifyapplication.aspx.
could any one suggest me on this.
Thanks & Regards Satish Dugasani -
I forget my security questions and I couldn't find option to send the answer to my email please help
forget my security questions and I couldn't find option to send the answer to my email please help
If you can't remember the answers to the security questions, then go to Express Lane and select 'iTunes' from the list of 'products' in the middle of the screen.
Then select 'iTunes Store', and on the next screen select 'Account Management'
Next choose 'iTunes Store Account Security' and fill in that you'd like your security questions/answers reset.
You should get an email reply within about 24 hours (and check your Spam folder as well as your Inbox).
Maybe you are looking for
-
How do I transfer my personal videos and photos from Ipad to P.C. As they are taking up space. Also my apps I have bought... if I delete them, can I retrieve them again without paying again?
-
I know the Web Photo Gallery has been removed from PS CS4 and put into Bridge. However, I created a few templates I would like to keep. Is there any way besides using CS3 that I might do this in Bridge? Is there going to be a way in Bridge to create
-
Hi - I am trying to unjar a jar file by calling the jar command "jar -xvf". My code is calling the jar command but is not unjaring the jar file. This is my code: try{ Runtime r = Runtime.getRuntime(); Process p = r.exec("jar -xvf " + jardirectory + j
-
Exc in ev handl: Error: Bad NPObject as private data!
Every time a new website is accessed
-
Backend invoice err when trying to change PO
Hi, I am having a approved PO in SRM. We go to MIRO and do the invoicing .The payment block gets set to invoice verification. Now on changing the PO in srm its gives and error "Backend Error : A Blocked Invoice exsits" How to change the PO in srm and