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: 

Help with Class CL_BCS

Former Member
0 Kudos
640

I am pasting a part of the code which I am working on now...

This is related to sending an e-mail using class CL_BCS.. I am trying to send an e-mail with subject line more than 50 characters in it.

The e-mail is already working, i get an e-mail immediately but with a shortened subject line.....

We can use the set_message_subject method to get the subject line longer but it doesnt work still due to some strange reason...

I know that the problem is with the bolded part.. when i went into the debugger mode i see that it compares the subject line which is passed on to the i_subject.

Points are guaranteed.........

  • -------- create persistent send request ------------------------

send_request = cl_bcs=>create_persistent( ).

clear i_subject.

  • -------- create and set document with attachment ---------------

  • create document from internal table with text

document = cl_document_bcs=>create_document(

i_type = 'RAW'

i_text = text

i_length = '12'

i_subject = '' ).

*changing the content of the attachment

binary_content[] = l_iobjbin[].

*change the name of the PDF attachment

concatenate 'Build ID' s_buildid_i 'Rev' v_buildid_rev

into i_att_sub separated by space.

  • add attachment to document

CALL METHOD document->add_attachment

EXPORTING i_attachment_type = 'PDF'

i_attachment_subject = i_att_sub

i_att_content_hex = binary_content.

*subject line more than 50 chars

t_sub = '[ D01 TEST] CCS0000096 NJ 8A7192 21 CONSTITUTION AVE'.

<b>

CALL METHOD send_request->set_message_subject

EXPORTING

ip_subject = t_sub.

</b>

  • add document to send request

CALL METHOD send_request->set_document( document ).

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
279

How is T_SUB defined? Less than 50 characters?

Regards,

Rich Heilman

0 Kudos
279

T_SUB is a string...

0 Kudos
279

I see no DATA statement for T_SUB. But I'll take your word for it.

Regards,

Rich Heilman

former_member194669
Active Contributor
0 Kudos
279

Try this way


data : subject type SOTR_TXT.
subject = '[ D01 TEST] CCS0000096 NJ 8A7192 21 CONSTITUTION AVE'.
document = cl_document_bcs=>create_document(
                     i_type    = 'RAW'
                     i_text = text
                     i_length = '12'
                     i_subject = subject ).

aRs

0 Kudos
279

that doesnt work as the i_subject cannot exceed 50 chars

Former Member
0 Kudos
279

I found the solution for this

We need to change the configuration settings in SCOT

Set SMTP node to node in use, goto Internet settings and then say '*' in the address area

This will do the work....