All,
I am using cl_bcs to send email from ABAP code for my POC purposes. Th email functionality is also working fine. I want to put SY-SYSID in the email subject line. However I get an error sayng that "SYSTEMID" is not type-compatible with formal parameter "I_SUBJECT".
I am following standard SAP code to send email.
Here is the starting of the code:
DATA: send_request TYPE REF TO cl_bcs.
DATA: text TYPE bcsy_text.
DATA: document TYPE REF TO cl_document_bcs.
DATA: sender TYPE REF TO cl_sapuser_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
DATA: bcs_exception TYPE REF TO cx_bcs.
DATA: sent_to_all TYPE os_boolean.
DATA: systemID TYPE SY-SYSID.
DATA: note TYPE bcsy_text.
START-OF-SELECTION.
PERFORM main.
*---------------------------------------------------------------------*
* FORM main *
*---------------------------------------------------------------------*
FORM main.
TRY.
* -------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
* -------- create and set document -------------------------------
* create document from internal table with text
APPEND 'Hello world!' TO text.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_length = '12'
i_subject = systemID ).
* add document to send request
CALL METHOD send_request->set_document( document ).