cancel
Showing results for 
Search instead for 
Did you mean: 

Carraige Return/New line etc in Outlook Application...

Former Member
0 Kudos

Hello,

I am sending MS Outlook Calendar appointments from SAP. I would like to send the body of the text in a normal way say using double space, Carraige returns, New line etc., I used like \n etc in the text while sending from SAP to Oulook. But it is not working.

Can anyone pls let me know of any special code to be used while sending from SAP to Outlook to identify Carrage return etc.,? Tks.

Note: I am using VBScript to send outlook appointments from SAP.

Tks.

Srinivas.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Norbert,

Your first solution worked for me. But if I have say 50 lines to be written in the body, I have to attach these 50 lines with & Chr(13) & Chr(10) &, one after the other. Is there a simple way, where I can assign lines dynamically to MyItem.Body.

Your second option, is not working. Tks.

Srinivas.

athavanraja
Active Contributor
0 Kudos

you can try this.

concatenate 'first line' '&vbCRLf' 'second line' '&vbCRLf' 'third line' ito l_chr.

Regards

Raja

norbertk
Participant
0 Kudos

hi,

i don't know where your lines come from, but probably you have an itab. then you should be able to loop over it like that:

MyItem.Body = "<%

loop at itab into itab_line.

if sy-tabix > 1.

page->write( '" & chr(13) & chr(10) & "' ).

endif.

page->write( itab_line-charvalue ).

endloop. %>"

pay attention that 's and "s are at the correct places...

regards,

norbert

Former Member
0 Kudos

Tks Norbert...

Your inputs did solved my requirement. Tks again...

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Raja,

I tried concatenating as per mentioned. Somehow I am getting pound symbol (##) between each lines. Am I doing somthing wrong? Tks.

Srinivas.

Former Member
0 Kudos

Hello Norbert,

The following VBScript I am using for Outlook calendar...

Dim MyItem 'As Outlook.AppointmentItem

Const olAppointmentItem = 1

Const olMeeting = 1

Set MyOlApp = CreateObject("Outlook.Application")

Set MyItem = MyOlApp.CreateItem(olMeeting)

Set MyItem = MyOlApp.CreateItem(1)

MyItem.MeetingStatus = 1

MyItem.Subject = "My Test "

MyItem.Location = "At my desk"

MyItem.Body = "<%= l_char. %> "

MyItem.duration = 30

MyItem.Start = "03/24/2006"

MyItem.End = "03/24/2006"

MyItem.Send

I want to constrcut my body message in 'l_char' variable. How to use chr(13) and chr(10) so that carraige return or new line will be added in the body.

Also, I tried using 'CL_ABAP_CHAR_UTILITIES=>CR_LF' in ABAP, but at the end result between to strings '##' is appearing. I am not sure how to call this class variable.

If you can help me how to call in VB or ABAP, it will be helpfull. Tks.

Srinivas.

athavanraja
Active Contributor
0 Kudos

concatenate 'This is first line.' CL_ABAP_CHAR_UTILITIES=>CR_LF 'This is second line' CL_ABAP_CHAR_UTILITIES=>CR_LF 'this is third line' into l_char .

Regards

Raja

athavanraja
Active Contributor
0 Kudos

Hi Srinivas,

Can you reward points to the helpful answers and mark the thread as answered once they are.

for example this thread

Regards

Raja

if you want to learn more about SDN way of saying thanks for helpful answers, check out this weblog.

/people/mark.finnern/blog/2004/08/10/spread-the-love

norbertk
Participant
0 Kudos

Hello Srinivasa,

try something like

MyItem.Body = "<%= l_line1 %>" & chr(13) & chr(10) & "<%= l_line2 %>"

Perhaps also concatenating l_char like this would work:

l_char = '"line 1" & chr(13) & chr(10) & "line2"'

and then:

MyItem.Body = <%= l_char %>

Regards,

Norbert

norbertk
Participant
0 Kudos

Hello Srinivasa,

you can use Chr(13) & Chr(10) in VBScript to create carriage return and line feed.

By the way, in ABAP you can use CL_ABAP_CHAR_UTILITIES=>CR_LF.

Regards,

Norbert

Former Member
0 Kudos

Hello Raja,

I tried the concatenation...It is not doing any carraige return but it is concatenating and outputting the string as such...FYI...