Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CL_BCS Mail set_message_subject not working

Former Member
0 Kudos

When I use set_message_subject, it does not work.

The email always uses the subject of the document - which is only 50 characters long.


*     -------- create and set document -------------------------------
*     create document from internal table with text
        document = cl_document_bcs=>create_document(
                  i_type     = 'RAW'
                  i_text     = i_text    "Tabelle!!
                  i_language = 'D'
                  i_subject  = i_subject
                   ).

*     add document to send request
        CALL METHOD send_request->set_document( document ).

*     --------- set long subject -------------------------------------
* does not work yet...
        CALL METHOD send_request->set_message_subject( ip_subject ).

Any help will be appreciated. I cannot find too much about using CL_BCS for mailing in the SDN....

By the way: <b>Does anyone know if and how it is possible to add Extra-Headers to the email?</b> They all start with "X-". One that SAP WebAS is adding is this one:

X-Mailer: SAP Web Application Server 7.00

Thanks.

For anyone having other questions about sending emails with CL_BCS, I recommend this blog: /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface

- sadly this specific problem was not mentioned there...

Alex Nicolovius

4 REPLIES 4

Former Member
0 Kudos

This message was moderated.

0 Kudos

Hi Balwant,

I am also having a requirement to add an attachment to email and hav a subject line >50 characters...

I have created teh ZFM as you have posted... but please also do let me know what are parameters that need to be passed.... how do you attach a PDF document to this FM... Please give me the sample code for the same.

Thanks

Former Member
0 Kudos

Hi Alex,

regarding the second part of your question (to do with additional email headers like the X-Mailer header), did you manage to find anything further on this?

I have noticed that when creating a cl_document_bcs object using method create_document, if you supply the parameters Sensitivity (i_sensitivity) and/or Priority (i_importance), these will show up in the email header as:

Importance: Normal

X-Priority: 3 (Normal)

Sensitivity: Private

If you then change the importance orsensitivty, the values in the header will also change. However, these are the only default internet email header fields made available through the cl_document_bcs class that have any effect on the email header contents.

Any additional information or pointers would be greatly appreciated,

Regards

Hagen

0 Kudos

Suggested solution provided in another thread. Hope it's of use.

[|]