Skip to Content
0
Former Member
Feb 11, 2009 at 11:42 AM

How to create different spool request in a session and write in them

148 Views

Hi everybody,

I have a problem and I don't know how to solve, may be someone knows how to do it. I am writing a program that must send emails with an attachment to different people. As the information to send is different, same table but with different info, I am trying to create an spool request, write there the table and after that create a pdf and just attached to the email.

This must be done in background. The problem I have is that I can not write anything in the spool. This is the coding I am using. the spoolrequests are created but nothing is in there. What I have to write in the spool is a table with a format. Does anybody know how can I write in the spool?

CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'

EXPORTING

dest = 'LOCL'

IMPORTING

handle = handle

spoolid = l_rqid

rc = rc

errmessage = errmsg.

PERFORM f_write_list TABLES it_zzcashm_s.

CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'

EXPORTING

handle = handle

IMPORTING

rc = rc

errmessage = errmsg

EXCEPTIONS

handle_not_valid = 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.

Thanks in advance,

Alejandro