2010 Jan 21 9:02 AM
I have no knowledge of ABAP Objects.
I have to put the table tab_destmail_f of a single field
(Mail address) in the recipient object
for processing the program and send all the mails.
DATA: BEGIN OF wa_destmail_f,
smtp_addr LIKE adr6-smtp_addr,
END OF wa_destmail_f.
DATA: tab_destmail_f LIKE TABLE OF wa_destmail_f.
* --------- añade dirección de mail -----------------------
* crea el receptor o destinatari (objecte recipient)
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
* añade objeto recipient a la petición de envío
send_request->add_recipient( recipient ).
THANKS A LOT !!!
I have no knowledge of ABAP Objects.
I have to put the table tab_destmail_f of a single field
(Mail address) in the recipient object
for processing the program and send all the mails.
DATA: BEGIN OF wa_destmail_f,
smtp_addr LIKE adr6-smtp_addr,
END OF wa_destmail_f.
DATA: tab_destmail_f LIKE TABLE OF wa_destmail_f.
* --------- añade dirección de mail -----------------------
* crea el receptor o destinatari (objecte recipient)
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
* añade objeto recipient a la petición de envío
send_request->add_recipient( recipient ).
THANKS A LOT !!!
2010 Jan 21 2:10 PM
Hi ivo agusti,
from the docu: ADD_RECIPIENT - You use this method to pass a recipient to the send request. You have to call this method for every recipient.
* ...
loop at tab_destmail_f into wa_destmail_f. "or assigning fs
recipient = cl_cam_address_bcs=>create_internet_address( wa_destmail_f-smtp_addr ).
send_request->add_recipient( recipient ).
endloop.
* ...
regards, Karsten
2010 Jan 21 4:03 PM
Karsten Korte thanks a lot for your response.
DATA: BEGIN OF wa_destmail_f,
smtp_addr LIKE adr6-smtp_addr,
END OF wa_destmail_f.
DATA: tab_destmail_f LIKE TABLE OF wa_destmail_f.
I writed your code and I had dump,
Err.tmpo.ejec. UNCAUGHT_EXCEPTION\par
Excep. CX_ADDRESS_BCS\par
Fecha y hora 21.01.2010 16:56:39\par
Where I must to put this code?
Must I to modify anything?
2010 Jan 21 4:35 PM
Where exactly in your code does this dump occur?
In order to find out what the (exact) problem is, you will have to 'catch' this exception using the CATCH statement within a TRY ENDTRY .
For example.
DATA: lr_error TYPE REF TO cx_address_bcs.
DATA: lv_message TYPE string.
TRY.
CATCH cx_address_bcs INTO lr_error.
lv_message = lr_error->get_text( ).
ENDTRY.
Evaluate the message in lv_message, and you should have a better understanding of the error.
2010 Jan 21 4:46 PM
CX_ADDRESS_BCS is thrown by CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS
recipient = cl_cam_address_bcs=>create_internet_address( wa_destmail_f-smtp_addr ) would be a candidate
so try what Micky suggested here:
DATA: lr_error TYPE REF TO cx_address_bcs.
DATA: lv_message TYPE string.
loop at tab_destmail_f into wa_destmail_f. "or assigning fs
TRY.
recipient = cl_cam_address_bcs=>create_internet_address( wa_destmail_f-smtp_addr ).
send_request->add_recipient( recipient ).
CATCH cx_address_bcs INTO lr_error.
lv_message = lr_error->get_text( ).
ENDTRY.
endloop.
2010 Jan 21 6:13 PM
Hi abapers,
the error is here:
DATA: lr_error TYPE REF TO cx_address_bcs.
DATA: lv_message TYPE string.
loop at tab_destmail_f into wa_destmail_f. "or assigning fs
TRY.
recipient = cl_cam_address_bcs=>create_internet_address( wa_destmail_f-smtp_addr ).
>>>>>>>> send_request->add_recipient( recipient ).
CATCH cx_address_bcs INTO lr_error.
lv_message = lr_error->get_text( ).
ENDTRY.
endloop.
The messages are:
Zugriff über 'NULL' Objektreferenz nicht möglich.
Access via 'NULL' object reference not possible.
Err.tmpo.ejec. OBJECTS_OBJREF_NOT_ASSIGNED
Excep. CX_SY_REF_IS_INITIAL
Fecha y hora 21.01.2010 19:00:55
The information of lv_message is:
{O:322*CLASS=CX_ADDRESS_BCS}
Excepción CX_ADDRESS_BCS ocurrida (programa: CL_CAM_ADDRESS_BCS============CP, include CL_CAM_ADDRESS_BCS============CM01W, línea: 45)
I don't find the solution, any saving code?
This is very important to me. Thanks a lot for your help!
2010 Jan 22 8:16 AM
can you show us more coding? e.g. where does send_request come from?
and does it look like bcs_example_1 (see Uwe's posting)?
2010 Jan 21 8:29 PM
Hello Ivo
In the package containing class CL_BCS you will find a couple of very useful sample reports (something like BCS_EXAMPLE_1 etc.).
Regards
Uwe
2010 Jan 22 9:29 AM
Hi all,
Uwe, Karsten & Micky thanks for your help.
I 'll see the examples.
Here are more code about my substitution-user exit:
send_request->set_document( document ).
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
send_request->add_recipient( recipient ).
******************
METHOD add_recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = i_recipient
i_express = i_express
i_copy = i_copy
i_blind_copy = i_blind_copy
i_no_forward = i_no_forward.
* EXCEPTIONS
* recipient_exists = 1
* released = 2
* os_exception = 3
* invalid_value = 4
* OTHERS = 5.
*
* CASE sy-subrc.
* WHEN 0.
* "Fine
* WHEN 1.
* RAISE recipient_exists.
* WHEN 2.
* RAISE released.
* WHEN OTHERS.
* RAISE invalid_value.
* ENDCASE.
ENDMETHOD.
METHOD add_recipient.
DATA: re TYPE recip_bcs.
* read notification
state_read_access.
IF ( sr_state <> ' ' ).
RAISE exception type cx_send_req_bcs
exporting error_type = cx_send_req_bcs=>allready_released.
ENDIF.
* write notification
state_write_access.
re-recipient = i_recipient.
re-sndex = i_express.
re-sndcp = i_copy.
re-sndbc = i_blind_copy.
re-forfb = i_no_forward.
re-prifb = i_no_print.
re-resend = i_resend.
INSERT re INTO TABLE recipients.
recipients_changed = 'X'.
* changed notification
state_changed.
ENDMETHOD.
2010 Jan 22 2:35 PM
Hi ivo,
what do you see in debugger in field wa_destmail_f-smtp_addr? Possibly the method can't handle the address. When dump occurs, you can click debugger button and see where you are and where you come from.
Regards,
Clemens
2010 Jan 22 2:38 PM
Hi all,
I finded the solution!!
is very simple:
.
DATA: mymail TYPE ad_smtpadr.
LOOP AT mitabla INTO w_mitabla.
mymail = w_mitabla-micampo.
recipient = cl_cam_address_bcs=>create_internet_address( mymail ).
send_request->add_recipient( recipient ).
ENDLOOP.
See you next time
2010 Jan 22 2:40 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |