2008 Dec 03 4:09 PM
Hi all,
I am using the funtion module SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail.
I want to format the text which i need to send in the mail content.
I dont have any attachments, message will be sent only throughthe mail body.
Im able to send all these below content...but its not coming in below requireed format.
Example: Mail body content should be like below format
-
vbeln | erdat | Matnr |
-
123 | xx | Mat-1 |
-
234 | yy | Mat-2 |
-
Thanks in advance
jean liker
Hi all,
I am using the funtion module SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail.
I want to format the text which i need to send in the mail content.
I dont have any attachments, message will be sent only throughthe mail body.
Im able to send all these below content...but its not coming in below requireed format.
Example: Mail body content should be like below format
-
vbeln | erdat | Matnr |
-
123 | xx | Mat-1 |
-
234 | yy | Mat-2 |
-
Thanks in advance
jean liker
2008 Dec 03 4:12 PM
Hi Jean,
Please find below give code where i was able to format the output. It is as per my requirement.
For blank space, you can just append a blank line to the message table.
* Text - Dear Franchisee,
ls_message = text-011.
APPEND ls_message TO fp_t_message.
CLEAR ls_message.
APPEND INITIAL LINE TO fp_t_message.
*<Royalty & Rent from table ZFARTXT001-DESCRIPTION by entering the BUKRS & language form the customer master >
*<Customer No>
CONCATENATE fp_wa_zfartxt001-description
fp_wa_kna1-kunnr
INTO lv_msg
SEPARATED BY space.
* Text - This is to inform you that an invoice(s) or credit adjustments(s)
*has been posted to the account referenced:
CONCATENATE text-012
text-013
lv_msg
INTO ls_message
SEPARATED BY space.
APPEND ls_message TO fp_t_message.
CLEAR ls_message.
APPEND INITIAL LINE TO fp_t_message.
* Text - Please Access BK ePAY to view the items
ls_message = text-014.
APPEND ls_message TO fp_t_message.
CLEAR ls_message.
APPEND INITIAL LINE TO fp_t_message.
* Text - Thank you,
ls_message = text-015.
APPEND ls_message TO fp_t_message.
CLEAR ls_message.
APPEND INITIAL LINE TO fp_t_message.
* Text - AR DEPARTMENT
ls_message = text-016.
APPEND ls_message TO fp_t_message.
CLEAR ls_message.
* Text -
ls_message = text-017.
APPEND ls_message TO fp_t_message.
CLEAR ls_message.
* Text - 305-378-7710
ls_message = text-018.
APPEND ls_message TO fp_t_message.
CLEAR ls_message.Hope this helps.
Best Regards,
Ram.
2008 Dec 04 9:07 AM
2008 Dec 04 9:11 AM
Hi Ram,
Thanks for your reply.
But the sample code dont have any formatting options.
2008 Dec 04 12:49 PM
-use textmodule tcode so10 to write ur bodytext
maybe with FM for symbol replacement
-write some html statements in ur code
they will get translated
use FM convert_itf_to_htm
send mail with doc-type HTM in packing_list
hope it helps
msg if u need some code example
regards
Stefan Seeburger
2008 Dec 04 2:24 PM
If formatting is causing you some problems and finally you are Concatenating data into a single line, why dont you try CONCATENATE x y z SEPARATED BY space RESPECTING BLANKS.
This will ensure that all concatented fields retaing their respective field lengths.
Let me know if this does not help and there is some other issue.
2008 Dec 04 2:43 PM
data it_message TYPE TABLE OF solisti1 WITH HEADER LINE.
"in unicode system use this:
CONSTANTS: con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB, "for tab mark
con_cret(2) TYPE c VALUE cl_abap_char_utilities=>cr_lf. "for carret return
"in non-unicode this one
CONSTANTS: con_cret TYPE x VALUE '0D',
con_tab TYPE x VALUE '09'.
"now simply place your TAB between your data and CR and beginning of each line
concatenate con_cret field1 con_tab field2 con_tab field3 into it_message.
append it_message.