Skip to Content

Sending eMails from an SAP NetWeaver based system is a very basic Standard functionality.

Sending appointments/meeting requests however, also directly from SAP NetWeaver is something more unique, but it’s supported nonetheless and can be very useful e.g. for

  1. Automatically Sending “vacation”/Leave of absence appointments back to the employee and his manager after vacation/leave request approval
  2. Automatically sending resubmission/follow-up appointments e.g. x days before contract expiration

This appointment was sent out directly from a regular ECC6.0 based System:
Outlook Appointment Sample

Find more information including sample coding in this article:
Sending Outlook Appointments and Meeting Requests Directly from ABAP Applications

To report this post you need to login first.

20 Comments

You must be Logged on to comment or reply to a post.

  1. Paul Hardy
    Hello

    I have a 470 BASIS 620 system. Your sample code works up to a point in my system – an email is sent with an attachment which looks like a calendar file. But this attachment cannot be opened. Does there need to be any changes made for a 470 system?

    Cheersy Cheers

    Paul

    (0) 
      1. Paul Hardy
        Greetings

        I totally forgot about the OSS Notes! I loaded them all, and now although the attachment still says “not supported calendar message” as its name, when I click on it I get taken into a blank outlook appointment. Opening the ICS file using notepad tells me the data looks very similar to a real Microsoft ICS file, but clearly the data is not getting copied across. I wonder if you need a particular level of outlook. I am on 2003 SP 2.

        I would be very interested if any other 4.7 users have got this working.

        Cheersy Cheers

        Paul

        (0) 
      2. Paul Hardy
        Mr.Martin

        I have solved this problem. It turns out the attribute “METHOD” of CL_APPOINTMENT needs to be set to “REQUEST”.

        As this is a protected attribute there is no way to set this value.

        I created a new class ZCL_APPOINTMENT inheriting from CL_APPOINTMENT and added a SET_METHOD method.

        I then added an extra line to your program

        LO_APPOINTMENT->SET_METHOD( I_METHOD = ‘REQUEST’ ).

        And everything then worked perfectly.

        Cheersy Cheers

        Paul

        (0) 
    1. Martin Lang Post author
      Hi Wolf,
      mmh. we didn’t see priority high on our end, so far, but generally the CL_APPOINTMENT class has a method called SET_PRIORITY. The syntax would be very similar to the other set_* methods in the code.
      Hope this helps
      Martin
      (0) 
      1. Wolfgang DOBNIK
        Hi Martin,
        I already used the method set_priority, and it works. In transaction SOST the document content displays the set priority. Nevertheless when I start the sending process with SOST I received the appointment with high prio (appointment proberties).
        cheers
        Wolf
        (0) 
        1. Wolfgang DOBNIK
          BEGIN:VCALENDAR
          PRODID:-//SAP AG//R/3-700//D
          VERSION:2.0
          METHOD:
          BEGIN:VEVENT
          ATTENDEE;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CN=”wolfgang.
          dobnik@frequentis.com“:MAILTO:wolfgang.dobnik@frequentis.com
          ORGANIZER:MAILTO:WOLFGANG.DOBNIK@FREQUENTIS.COM
          DTSTART;VALUE=DATE:20090803
          DTEND;VALUE=DATE:20090804
          X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
          LOCATION:Location
          UID:DF4C81F8C37689F18E9F005056B10DE1@frequentis.com
          STATUS:CONFIRMED
          DTSTAMP:20100420T133817Z
          SUMMARY:This is the Appointment Subject
          CATEGORIES:Keine Terminart ausgewählt
          CREATED:20100420T133817Z
          SEQUENCE:0
          TRANSP:OPAQUE
          PRIORITY:9
          CLASS:PUBLIC
          DESCRIPTION:This is the Body Text of the Appointment
          END:VEVENT
          END:VCALENDAR

          If I import this vCalender as .ICS file in outlook, the priority setting is correct.

          I think the problem is not the appointment. It seems to be the manner of how the appointment will be send to outlook.

          (0) 
          1. Wolfgang DOBNIK
            Hi Martin,

            I have the same problem if I am using the demo “BCS_EXAMPLE_1”.

            Although I set the priority for the CL_BCS

            CALL METHOD send_request->set_priority
              EXPORTING
                 i_priority = ‘5’.

            I receive the mail with high prio.

            cheers
            Wolf

            (0) 
            1. Martin Lang Post author
              It’s because of this parameter:
              X-MICROSOFT-CDO-IMPORTANCE
              It’s set to 2 which I think means high, it would need to be 1. Am just currently unsure where that is set myself will have to check and come back to you.
              (0) 
              1. Wolfgang DOBNIK
                Hi Martin, We already found a solution

                * set mail importance to normal
                  TRY.

                      lo_document ?= lo_send_request->document( ).

                      lo_document->set_importance( i_importance = ‘5’ ).

                    CATCH cx_sy_move_cast_error.
                  ENDTRY.

                cheers
                Wolf

                (0) 
  2. Trim Chakrapani
    Hi Martin,
    Good article. We are running ECC6 and our other SP details SAP_BASIS 701SAPKB70105.

    I have to only implement 1369864. Ran test the program, to my own e-mail ID, calendar not updated. Debug shows all steps or okay. Do i have to do any settings? Can you please tell me what i am doing wrong here.

    Regards,
    Trim

    (0) 
      1. Trim Chakrapani
        Hi Martin,
        Thanks reply. NO! e-mail is not reaching SOST at all. All that i have done is copied the given code and provided my e-mail id in selection screen. Code look fine, but no output?

        Any help much appreciated.

        Regards,
        Trim

        (0) 
          1. Trim Chakrapani
            Hi Martin,
            Thanks for reply. Creating new entry in calendar working fine. Now i am trying to work on deleting the calendar entry once course cancellation approved by manager. Any idea? how i can get this working.
            Regards,
            Trim
            (0) 
            1. Martin Lang Post author
              @Trim, Great to hear it works now at least for creations! Cancellation is trickier, when we did this prototype a while ago, we didn’t do cancellations, currently the team around this is not available, so I can’t help much.
              Basically cancellation should work though, the main trick woudl be to save the GUID that gets created when you create a meeting request (it’s also part of the ICS file, when you send out an appointment/meeting request) in the system connected to the vacation request. When the vacation request gets cancelled, the same meeting with the same GUID needs to be cancelled, am not 100% whether the methods for this exist, but they might.
              Sorry I can’t help more on this. If you get stuck, maybe posting a question in the forums might be another avenue to get some help. Possibly some other folks tried this already.
              (0) 
    1. Marc Pelao Marcos
      I have a problema with the times. The appointment doesn’t take the correct times, always 00:00:00 to 00:00:00.

      Can I put in abap X-MICROSOFT-CDO-ALLDAYEVENT:TRUE to FALSE?

      I used:

      * Sample Apppointment for specific date/time
      lo_appointment->set_date( date_from = ‘20101223’
                                time_from = horai
                                 date_to = ‘20101223’
                                 time_to = horaf
                                 timezone = ‘UTC’).

      (0) 

Leave a Reply