HPOMSAP 6.1 Delivering documents to SAPconnect nodes in SAP R/3
Technical Note 83
Sample Programs
Sample report program YSALES_SC (Example 4)
** we need no header
objpack-head_start = 1.
objpack-head_num = 0.
** but a body
objpack-body_start = 1.
objpack-body_num = tab_lines.
** of type ALI
objpack-doc_type = 'ALI'.
objpack-obj_name = 'Attachment'.
objpack-obj_descr = 'Sales Order Item Details '.
write : sy-datum to objpack-obj_descr+33.
objpack-doc_size = tab_lines * 255.
append objpack.
refresh : reclist.
if p2 = 'X' and mailtype = 'U'.
loop at receiver.
recipient_int = receiver-low.
reclist-receiver = recipient_int. "'i.ravindrababu@digital.com'.
reclist-rec_type = mailtype . "U
append reclist.
endloop.
elseif p2 = 'X' and mailtype = 'F'.
loop at receiver.
recipient_fax-rec_fax = receiver-low.
recipient_fax-rec_state = 'US'.
recipient_fax-rec_title = 'Ms.'.
recipient_fax-rec_name1 = 'Ann Recipient'.
recipient_fax-send_nam = 'Tom Sender'.
recipient_fax-send_comp = 'SAP AG'.
* Additional text should appear on the cover and not on a 2nd page
recipient_fax-send_cover = 'X'.
reclist-receiver = recipient_fax.
* recipient_fax = receiver-low.
* reclist-receiver = recipient_fax. "'i.ravindrababu@digital.com'.
reclist-rec_type = mailtype . "U
append reclist.
endloop.
.
else.
message e000 with 'Invalid Mail Type, only Fax or Internet'.
endif.
check not reclist[] is initial.
**********************************************************************
** Send the document by calling the SAPoffice API1 module
** for sending documents with attachments
**********************************************************************
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = doc_chng