Anyway, to share some of the thing that I've done to get the body text work:
- You can't use body text in NACE, it just doesn't work that way. Tried it so many times and given up. SAP has a note which says that no matter what you do, it will not work for you :) SAP Note 753622.
- Next best thing to do is, to go ahead and change the way the standard SAP send out email in the print program, create an OTF, and just after CLOSE_FORM, use SO_NEW_DOCUMENT_ATT_SEND_API1 or BCS to send the email out. For me, this is too much too.
- Probably the best option, do this in FORM_OPEN subroutine in the print program. This is what I've done and it works. Copy the standard RVADOPF0 into customer namespace and replace this in FROM_OPEN subroutine. Add the following code just after the check for retcode eq 0. Create a standard text using SO10 .. text name will be your (output type)_BODY_TEXT.
Here is the code that I've:
DATA: lines_tab LIKE tline OCCURS 0 WITH HEADER LINE,
obj_name LIKE thead-tdname,
email_body_text TYPE TABLE OF soli,
email_line TYPE soli.
CONCATENATE nast-kschl '_BODY_TEXT' INTO obj_name.
CALL FUNCTION 'READ_TEXT'
id = 'ST'
language = nast-spras
name = obj_name
object = 'TEXT'
lines = lines_tab
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT lines_tab.
email_line = lines_tab-tdline.
APPEND email_line TO email_body_text.
IF email_body_text IS NOT INITIAL.
swc_object_from_persistent lvs_recipient recipient.
swc_set_element container 'NoteText' email_body_text.
swc_call_method recipient 'AddNote' container.
swc_object_to_persistent recipient lvs_recipient.