on 08-12-2013 2:32 PM
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 ).
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:
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.