les pido ayuda para ver porque puede ser que no funcione la convercion a pdf y de hai a binario le s paso el codigo aver si ustedes ven algo que se me paso por alto desde ya gracias
form gen_pdf changing p_logo lv_solicitud p_nom_tra p_rut_tra p_empresa
p_fech_ing_emp p_sindicato p_tip_boni p_rut_ben p_nom_hc
p_ap_paterno p_ap_materno p_001 i_cont_bin numbytes.
tables nast.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
w_compop-tddest = 'LOCL'.
w_compop-tdarmod = '1'.
w_compop-tdcopies = '1'.
w_compop-tdprinter = 'SAPWIN'.
w_compop-tdlifetime = '8'.
call function '/1BCDWB/SF00000006'
exporting
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
gp_logo = p_logo "Aca los parametros que necesita el smartform
gp_n_solicitud = lv_solicitud
gp_nom_tra = p_nom_tra
gp_rut_tra = p_rut_tra
gp_empresa = p_empresa
gp_fech_ing_emp = p_fech_ing_emp
gp_sindicato = p_sindicato
gp_tip_boni = p_tip_boni
gp_fech_soli = sy-datum
gp_rut_bene = p_rut_ben
gp_nom_famil = p_nom_hc
gp_ap_paterno = p_ap_paterno
gp_ap_materno = p_ap_materno
gp_for001 = p_001
importing
job_output_info = w_return "aca me devuelve el smartform
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc ne 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 'QCE1_CONVERT'
* TABLES
* t_source_tab = i_tline
* t_target_tab = i_cont
* EXCEPTIONS
* CONVERT_NOT_POSSIBLE = 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.
endform. " GEN_PDF
despues lo envio
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).
* 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: saltolinea type x.
saltolinea = '0D'.
describe table objbin lines tab_lines.
objhead = 'PDF'.
append objhead.
** Creation of the entry for the compressed attachment
describe table i_cont_bin lines tab_lines.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'PDF'.
objpack-doc_size = numbytes.
move objhead to objpack-obj_descr.
move objhead to objpack-obj_name.
objpack-doc_size = tab_lines * 255.
append objpack.
clear reclist.
reclist-receiver = 'XXXXXXXXX@hotmail.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 = i_cont_bin
contents_txt = objtxt
receivers = reclist
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
el error que tira es en la tranformacion a pdf dentro de la funcion
form gen_pdf changing p_logo lv_solicitud p_nom_tra p_rut_tra p_empresa
p_fech_ing_emp p_sindicato p_tip_boni p_rut_ben p_nom_hc
p_ap_paterno p_ap_materno p_001 i_cont_bin numbytes.
tables nast.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
w_compop-tddest = 'LOCL'.
w_compop-tdarmod = '1'.
w_compop-tdcopies = '1'.
w_compop-tdprinter = 'SAPWIN'.
w_compop-tdlifetime = '8'.
call function '/1BCDWB/SF00000006'
exporting
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
gp_logo = p_logo "Aca los parametros que necesita el smartform
gp_n_solicitud = lv_solicitud
gp_nom_tra = p_nom_tra
gp_rut_tra = p_rut_tra
gp_empresa = p_empresa
gp_fech_ing_emp = p_fech_ing_emp
gp_sindicato = p_sindicato
gp_tip_boni = p_tip_boni
gp_fech_soli = sy-datum
gp_rut_bene = p_rut_ben
gp_nom_famil = p_nom_hc
gp_ap_paterno = p_ap_paterno
gp_ap_materno = p_ap_materno
gp_for001 = p_001
importing
job_output_info = w_return "aca me devuelve el smartform
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc ne 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 'QCE1_CONVERT'
* TABLES
* t_source_tab = i_tline
* t_target_tab = i_cont
* EXCEPTIONS
* CONVERT_NOT_POSSIBLE = 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.
endform. " GEN_PDF
despues lo envio
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).
* 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: saltolinea type x.
saltolinea = '0D'.
describe table objbin lines tab_lines.
objhead = 'PDF'.
append objhead.
** Creation of the entry for the compressed attachment
describe table i_cont_bin lines tab_lines.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'PDF'.
objpack-doc_size = numbytes.
move objhead to objpack-obj_descr.
move objhead to objpack-obj_name.
objpack-doc_size = tab_lines * 255.
append objpack.
clear reclist.
reclist-receiver = 'XXXXXXXXX@hotmail.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 = i_cont_bin
contents_txt = objtxt
receivers = reclist
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
el error que tira es en la tranformacion a pdf dentro de la funcion
Comentario