cancel
Showing results for 
Search instead for 
Did you mean: 

SY-SYSID in i_subject

Former Member
0 Kudos

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 ).

Accepted Solutions (1)

Accepted Solutions (1)

ambrish_mishra
Active Contributor
0 Kudos

Hi Vicky,

I suggest you post ABAP queries in ABAP-> application development community for quicker response.

However, there is a type mismatch between i_subject and systemID variable as the error suggests.

You can try assigning the systemID to so_obj_des object type and then assign it to i_subject.

pls go through the document:

http://scn.sap.com/community/abap/application-development/blog/2012/03/27/simple-bcs-email-method-wi...

Ambrish

Answers (0)