SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Send a message to SapOffice



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования -> Mail
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Nov 04, 2007 4:23 pm    Post subject: Send a message to SapOffice Reply with quote

This reports does send a message to SapOffice.

Parameters:
p_line1(70) type c obligatory,
p_line2(70) type c,
p_line3(70) type c,
p_title like sood1-objdes,
p_user like sy-uname obligatory.

Output:
message SapOffice

Code:
REPORT ZMESSAGE LINE-SIZE 250.      "yyyymmdd, Release x.x
*
**********************         HEADER                    **************
*
* Copyright (c) 2001 by Angell, 44318 Anywhere, http://xxxxx
* or: Copyright (c) 2001 by A.L. from I.
*
*     You can use or modify this report for your own work as long
*               as you don't try to sell or republish it.
*      In no event will the author be liable for indirect, special,
*        Incidental, or consequental damages (if any) arising out of
*                       the use of this report.
*//////////////////////////////////////////////////////////////////////*
* Append your coding here ...
parameters: p_line1(70) type c obligatory,
            p_line2(70) type c,
            p_line3(70) type c,
            p_title like sood1-objdes,
            p_user like sy-uname obligatory.

START-OF-SELECTION.

DATA: I_RECEIVERS LIKE SOOS1 OCCURS   0 WITH HEADER LINE,
      I_OBJCONT LIKE SOLI OCCURS   0 WITH HEADER LINE,
      I_OBJHEAD LIKE SOLI OCCURS   0 WITH HEADER LINE,
      R_OBJECT_HD_CHANGE LIKE SOOD1 OCCURS   0 WITH HEADER LINE.

  R_OBJECT_HD_CHANGE-OBJDES = p_title.    "Title
  R_OBJECT_HD_CHANGE-OBJNAM = TEXT-000.   "Document name
  R_OBJECT_HD_CHANGE-OBJLA = sy-langu.    "Lenguaje
  R_OBJECT_HD_CHANGE-OBJSNS = 'P'.        "Atributos del objeto, Privado
  R_OBJECT_HD_CHANGE-VMTYP = 'F'.         "Tipe
  R_OBJECT_HD_CHANGE-SKIPS = ' '.         "Procesar 1º dynpro no visible
  R_OBJECT_HD_CHANGE-ACNAM = SY-UNAME.

  I_RECEIVERS-RECESC = 'B'.               "Sap User
  I_RECEIVERS-RECNAM = p_user.            "Destiny user
  I_RECEIVERS-SNDEX = 'X'.
  APPEND I_RECEIVERS.

  I_OBJCONT-LINE = p_line1.
  APPEND I_OBJCONT.
  CLEAR I_OBJCONT.
  I_OBJHEAD-LINE = I_OBJHEAD-LINE  + 1.

  IF NOT P_LINE2 IS INITIAL.
    I_OBJCONT-LINE = p_line2.
    APPEND I_OBJCONT.
    CLEAR I_OBJCONT.
    I_OBJHEAD-LINE = I_OBJHEAD-LINE  + 1.
  ENDIF.
  IF NOT P_LINE3 IS INITIAL.
    I_OBJCONT-LINE = p_line3.
    APPEND I_OBJCONT.
    CLEAR I_OBJCONT.
    I_OBJHEAD-LINE = I_OBJHEAD-LINE  + 1.
  ENDIF.
  APPEND I_OBJHEAD.
  CALL FUNCTION 'SO_OBJECT_SEND'
       EXPORTING
            OBJECT_HD_CHANGE           =  R_OBJECT_HD_CHANGE
            OBJECT_TYPE                = 'RAW'
            OWNER                      = SY-UNAME
       TABLES
            OBJCONT                    = I_OBJCONT
            OBJHEAD                    = I_OBJHEAD
            RECEIVERS                  = I_RECEIVERS
       EXCEPTIONS
            ACTIVE_USER_NOT_EXIST      = 1
            COMMUNICATION_FAILURE      = 2
            COMPONENT_NOT_AVAILABLE    = 3
            FOLDER_NOT_EXIST           = 4
            FOLDER_NO_AUTHORIZATION    = 5
            FORWARDER_NOT_EXIST        = 6
            NOTE_NOT_EXIST             = 7
            OBJECT_NOT_EXIST           = 8
            OBJECT_NOT_SENT            = 9
            OBJECT_NO_AUTHORIZATION    = 10
            OBJECT_TYPE_NOT_EXIST      = 11
            OPERATION_NO_AUTHORIZATION = 12
            OWNER_NOT_EXIST            = 13
            PARAMETER_ERROR            = 14
            SUBSTITUTE_NOT_ACTIVE      = 15
            SUBSTITUTE_NOT_DEFINED     = 16
            SYSTEM_FAILURE             = 17
            TOO_MUCH_RECEIVERS         = 18
            USER_NOT_EXIST             = 19
            X_ERROR                    = 20
            OTHERS                     = 21.

  IF SY-SUBRC <> 0.
    MESSAGE I000.  "Error en el envío de mensaje al responsable
    LEAVE SCREEN.
  ENDIF.
************************************************************************
******************* END OF PROGRAM *************************************
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования -> Mail All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.