Standard ist es zwar nicht, aber in der Nachrichtenverarbeitung ist man so frei, das man fast alles machen kann:SAPerlotti hat geschrieben:Gibt es im Standard eine Lösung über Customizing oder kennt jemand eine SAP Partnerlösung, bzw. Drittanbieter die Erfahrung mit dem Thema haben?
Code: Alles auswählen.
* generate the Packing List
CLEAR object_pack-transf_bin.
object_pack-head_start = 1.
object_pack-head_num = 0.
object_pack-body_start = 1.
object_pack-body_num = tab_lines.
object_pack-doc_type = 'RAW'.
APPEND object_pack.
k = i = 0.
LOOP AT pdf.
DO 134 TIMES.
j = sy-index - 1.
object_bin+i(1) = pdf+j(1).
i = i + 1.
IF i > 254.
APPEND object_bin.
CLEAR i.
ENDIF.
k = k + 1.
IF k GE filesize.
IF i NE 0. APPEND object_bin.ENDIF.
EXIT.
ENDIF.
ENDDO.
ENDLOOP.
* Generate the Attachment
* Packing List(Att)
DESCRIBE TABLE object_bin LINES tab_lines.
READ TABLE object_bin INDEX tab_lines.
object_pack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( object_bin ).
object_pack-transf_bin = 'X'.
object_pack-transf_txt = 'X'.
object_pack-head_start = 1.
object_pack-head_num = 0.
object_pack-body_start = 1.
object_pack-body_num = tab_lines.
object_pack-doc_type = 'PDF'.
object_pack-obj_name = 'SPOOL'.
object_pack-obj_descr = nast-objky.
APPEND object_pack.
* get all GOS - Attachments from Purchase Order
* PERFORM get_gos_documents TABLES object_bin object_pack.
* generate the receiver list
* Internet User
************************
* @@@@ TODO !!!!!
************************
* Your Email Adress goes HERE
receiver_list-receiver = 'JHAASE@EMAG.DE'.
receiver_list-rec_type = 'U'.
receiver_list-com_type ='INT'.
APPEND receiver_list.
* Send the mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = document_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = object_pack
contents_bin = object_bin
contents_txt = object_txt
receivers = receiver_list
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.