05-15-2013 6:57 PM
I have created a class to read the GOS documents in a specific folder and attach them to a send_request created with cl_bcs and email created with cl_document_bcs.
The issue my users have identified is an extra, blank attachment to the email which is named <subject>.txt. The <subject> is the text entered into the subject of the email document.
Can anyone advise me how to set up the email document so that the extra attachment is Not created?
Patsy
05-15-2013 7:21 PM
Hi Pasty,
maybe it's in the cl_document_bcs used your problem occurs. Can you give us this part of code ?
Regards
Fred
05-15-2013 7:21 PM
Hi Pasty,
maybe it's in the cl_document_bcs used your problem occurs. Can you give us this part of code ?
Regards
Fred
05-15-2013 9:28 PM
These are the instructions used to create the send_request and the email.
send_request = cl_bcs=>create_persistent( ).
email = cl_document_bcs=>create_document(
i_type = 'RAW'
i_subject = l_subj
).
send_request->set_document( i_document = email ).
05-16-2013 6:24 AM
I have already post an example code for this class : http://scn.sap.com/message/13850390#13845471
and this example is for adding GOS attachment
if you didn't find your problem I could send you the whole code (quite long)
regards
Fred
05-16-2013 6:12 PM
Thank you Fred. Your post appears to be the answer. I really appreciate learning about class cl_gbt_multirelated_service.
05-16-2013 6:55 PM
I could send you the code if you want, I think my email is in my profile.
it's an old code to send from the QM module the certificat of analysis.
Fred
05-16-2013 12:05 AM
Hi,
Check your code I think your code is processing the subject text as an attachment. Often happens with CL_BCS usage.
Check the SCN wiki post below and compare with your steps for the email creation
http://wiki.sdn.sap.com/wiki/display/Snippets/Send+email+from+ABAP+with+class+CL_BCS
Cheers,
Arindam
06-04-2013 2:04 PM
I think the real key here is keeping the method calls to cl_bcs and cl_document_bcs together within a try / endtry group. The example in the wiki has a good many method calls within a single try/endtry group. If, like me, you prefer to keep your try/endtry groups small - I think you will have to nest groups. That is, if your users don't want the extra bogus attachment.