Buenas, en mi sistema el remitente se recuperaba y se enviaba bien en los mails pero desde que implementamos los SP (parches), aparace el nombre del remitente bien, pero la direccion aparece fpr300+cod_usuario@....
Os ha pasado a alguien???
La funcion que envia los mail es:
FUNCTION z_enviar_email.
*"----------------------------------------------------------------------
*"*"Interfase local
*" IMPORTING
*" VALUE(FILE_SEND) LIKE RLGRAP-FILENAME
*" VALUE(NAME_FILE) TYPE SOOD-OBJDES OPTIONAL
*" VALUE(EMAIL) TYPE SO_NAME
*" VALUE(TITLE) TYPE SO_OBJ_DES
*" VALUE(PROGRAM) LIKE SY-CPROG OPTIONAL
*"----------------------------------------------------------------------
* Variables
DATA: send_request TYPE REF TO cl_bcs.
DATA: text TYPE bcsy_text.
DATA: doc_content TYPE bcsy_text.
DATA: binary_content TYPE solix_tab.
DATA: document TYPE REF TO cl_document_bcs.
DATA: sender TYPE REF TO cl_sapuser_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
DATA: bcs_exception TYPE REF TO cx_bcs.
DATA: sent_to_all TYPE os_boolean.
DATA: temp_text(255).
DATA: doc_line TYPE soli.
DATA: hex_line TYPE solix.
DATA: hex_table TYPE solix_tab.
DATA: nombre_fichero TYPE sood-objdes.
DATA: temp_mail LIKE zcontrol_batch-email_gds.
DATA: lines TYPE i.
DATA: length LIKE sood-objlen.
DATA: temp_fecha(10).
DATA: titulo TYPE so_obj_des.
* Fecha del sistema
WRITE sy-datum TO temp_fecha DD/MM/YYYY.
* Titulo del correo
CONCATENATE title '-' temp_fecha INTO titulo SEPARATED BY space.
TRY.
* -------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
* -------- Creamos el texto del correo ---------------
* create document from internal table with text
CONCATENATE text-001 file_send text-002 program text-003 email '.'
INTO temp_text SEPARATED BY space.
APPEND temp_text TO text.
APPEND text-004 TO text.
APPEND '' TO text.
APPEND text-005 TO text.
APPEND '' TO text.
APPEND text-006 TO text.
* Creamos eldocuemnto con el titulo, el texto y el fichero
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_length = '12'
i_subject = titulo ).
OPEN DATASET file_send FOR INPUT IN BINARY MODE.
* OPEN DATASET file_send FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE i010(ad) WITH text-007.
EXIT.
ELSE.
DO.
READ DATASET file_send INTO hex_line-line.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND hex_line TO binary_content.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET file_send.
* fin de la creación del documento
CONCATENATE 'NAME_FILE' '-'
sy-datum
INTO nombre_fichero SEPARATED BY space.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'CSV'
i_attachment_subject = nombre_fichero
* i_attachment_size = length
i_att_content_hex = binary_content.
* i_att_content_text = doc_content.
* add document to send request
CALL METHOD send_request->set_document( document ).
* --------- set sender -------------------------------------------
* note: this is necessary only if you want to set the sender
* different from actual user (SY-UNAME). Otherwise sender is
* set automatically with actual user.
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
* --------- add recipient (e-mail address) -----------------------
* create recipient - please replace e-mail address !!!
recipient = cl_cam_address_bcs=>create_internet_address( email ).
* add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
* set send immediately flag
send_request->set_send_immediately( 'X' ).
* ---------- send document ----------------------------------
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
COMMIT WORK.
* -----------------------------------------------------------
* exception handling
CATCH cx_bcs INTO bcs_exception.
WRITE: bcs_exception->error_type.
EXIT.
ENDTRY.
ENDFUNCTION.
Os ha pasado a alguien???
La funcion que envia los mail es:
FUNCTION z_enviar_email.
*"----------------------------------------------------------------------
*"*"Interfase local
*" IMPORTING
*" VALUE(FILE_SEND) LIKE RLGRAP-FILENAME
*" VALUE(NAME_FILE) TYPE SOOD-OBJDES OPTIONAL
*" VALUE(EMAIL) TYPE SO_NAME
*" VALUE(TITLE) TYPE SO_OBJ_DES
*" VALUE(PROGRAM) LIKE SY-CPROG OPTIONAL
*"----------------------------------------------------------------------
* Variables
DATA: send_request TYPE REF TO cl_bcs.
DATA: text TYPE bcsy_text.
DATA: doc_content TYPE bcsy_text.
DATA: binary_content TYPE solix_tab.
DATA: document TYPE REF TO cl_document_bcs.
DATA: sender TYPE REF TO cl_sapuser_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
DATA: bcs_exception TYPE REF TO cx_bcs.
DATA: sent_to_all TYPE os_boolean.
DATA: temp_text(255).
DATA: doc_line TYPE soli.
DATA: hex_line TYPE solix.
DATA: hex_table TYPE solix_tab.
DATA: nombre_fichero TYPE sood-objdes.
DATA: temp_mail LIKE zcontrol_batch-email_gds.
DATA: lines TYPE i.
DATA: length LIKE sood-objlen.
DATA: temp_fecha(10).
DATA: titulo TYPE so_obj_des.
* Fecha del sistema
WRITE sy-datum TO temp_fecha DD/MM/YYYY.
* Titulo del correo
CONCATENATE title '-' temp_fecha INTO titulo SEPARATED BY space.
TRY.
* -------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
* -------- Creamos el texto del correo ---------------
* create document from internal table with text
CONCATENATE text-001 file_send text-002 program text-003 email '.'
INTO temp_text SEPARATED BY space.
APPEND temp_text TO text.
APPEND text-004 TO text.
APPEND '' TO text.
APPEND text-005 TO text.
APPEND '' TO text.
APPEND text-006 TO text.
* Creamos eldocuemnto con el titulo, el texto y el fichero
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_length = '12'
i_subject = titulo ).
OPEN DATASET file_send FOR INPUT IN BINARY MODE.
* OPEN DATASET file_send FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE i010(ad) WITH text-007.
EXIT.
ELSE.
DO.
READ DATASET file_send INTO hex_line-line.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND hex_line TO binary_content.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET file_send.
* fin de la creación del documento
CONCATENATE 'NAME_FILE' '-'
sy-datum
INTO nombre_fichero SEPARATED BY space.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'CSV'
i_attachment_subject = nombre_fichero
* i_attachment_size = length
i_att_content_hex = binary_content.
* i_att_content_text = doc_content.
* add document to send request
CALL METHOD send_request->set_document( document ).
* --------- set sender -------------------------------------------
* note: this is necessary only if you want to set the sender
* different from actual user (SY-UNAME). Otherwise sender is
* set automatically with actual user.
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
* --------- add recipient (e-mail address) -----------------------
* create recipient - please replace e-mail address !!!
recipient = cl_cam_address_bcs=>create_internet_address( email ).
* add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
* set send immediately flag
send_request->set_send_immediately( 'X' ).
* ---------- send document ----------------------------------
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
COMMIT WORK.
* -----------------------------------------------------------
* exception handling
CATCH cx_bcs INTO bcs_exception.
WRITE: bcs_exception->error_type.
EXIT.
ENDTRY.
ENDFUNCTION.
Comentario