HPOMSAP 6.1 Delivering documents to SAPconnect nodes in SAP R/3

82 Technical Note
Sample Programs
Sample report program YSALES_SC (Example 4)
buffer = compressed_list
exceptions
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
others = 8.
check not compressed_list[] is initial.
move compressed_list[] to objbin[].
*** Delete Spool after read.
clear spool_rec.
move p_spool to spool_rec-rqident.
call function 'RSPO_IDELETE_SPOOLREQ'
exporting
spoolreq = spool_rec
importing
status = spool_stat.
commit work and wait.
** Create the document which is to be sent
doc_chng-obj_name = 'REPORT'.
doc_chng-obj_descr = 'Sales Order Item Details'.
write : sy-datum to doc_chng-obj_descr+35.
describe table objtxt lines tab_lines.
read table objtxt index tab_lines.
doc_chng-doc_size = ( tab_lines-1)*255+strlen( objtxt ).
* Fill the fields of the packing_list for the main document:
* It is a text document
clear objpack-transf_bin.
* The document needs no header (head_num = 0)
objpack-head_start = 1.
objpack-head_num = 0.
* but it has a body
objpack-body_start = 1.
objpack-body_num = tab_lines.
* of type RAW
objpack-doc_type = 'RAW'.
append objpack.
** Create the attachment (the list itself)
describe table objbin lines tab_lines.
** Fill the fields of the packing_list for the attachment:
** It is binary document
objpack-transf_bin = 'X'.