MUNDOSAP

Regresar   MUNDOSAP > DESARROLLO > Programación ABAP IV
Nombre de Usuario
Contraseña
Home Descargas Registrar FAQ Miembros Calendario Buscar Temas de Hoy Marcar Foros Como Leídos




 
Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Viejo 25/06/08, 22:01:58
jangulo60 jangulo60 is offline
Member
 
Fecha de Ingreso: jul 2006
Mensajes: 35
Wink Problema con mail TXT

Buenas tardes, le comento mi problema estoy enviando un correo con un archivo .TXT, el correo llega bien en el formato TXT, pero resulta que la primera fila del archivo llega en blanco, compañeros por favor como hago para que archivo llegue bien o sea sin espacios.

Gracias
John

Este es el código
*&---------------------------------------------------------------------*
*& Report ZTEST40
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ztest40.

DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA l_num(3).

CONSTANTS: ret(5) TYPE c VALUE cl_abap_char_utilities=>cr_lf.

* Creation of the document to be sent
doc_chng-obj_name = 'SENDFILE'.
* Mail Subject
doc_chng-obj_descr = 'Prueba de Correo via Sap'.
* Mail Contents
objtxt = 'Este es el contenido del mensaje'.
APPEND objtxt.

DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
* Creation of the entry for the compressed document
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.

* Creation of the document attachment


DATA: wa TYPE solisti1.
DATA: saltolinea TYPE c.

saltolinea = '0D'.

DO 5 TIMES.
CONCATENATE 'ABAP4' 'COMUNIDAD ABAP CASTELLANO' '2006' 'By gvm_ncg' 'n' 'abcdfadadadasdadasdada' saltolinea INTO wa.
CONCATENATE ret wa INTO wa.
APPEND wa TO objbin.
CLEAR wa.
ENDDO.
* ENDLOOP.

DESCRIBE TABLE objbin LINES tab_lines.
objhead = 'panchoPepeGonzalez.txt'.
APPEND objhead.

** Creation of the entry for the compressed attachment
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
objpack-obj_name = 'WEBSITE'.
objpack-obj_descr = 'PANCHOPEPE.TXT'.
objpack-doc_size = tab_lines * 255.
APPEND objpack.

CLEAR reclist.
reclist-receiver = 'mpradac@consultoriaorganizacional.com'.
reclist-express = 'X'.
reclist-rec_type = 'U'.
reclist-copy = 'X'.
APPEND reclist.

* Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.

WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = ''
AND RETURN.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Reglas de Mensajes
no puedes crear nuevos temas
no puedes responder temas
no puedes adjuntar archivos
no puedes editar tus mensajes

El código vB está On
Las caritas están On
Código [IMG] está On
Código HTML está Off
Saltar a Foro


Husos Horarios son GMT. La hora en este momento es 12:18:37.


www.mundosap.com 2006 - Spain
software crm, crm on demand, software call center, crm act, crm solutions, crm gratis, crm web