Read external mail through ABAP

Hi All,
i want read external mail ( say yahoo, gamil etc) through ABAP code with attachments.
Thanks and regards
JK

Hi,
Reading external email through pure ABAP won't be an easy task as far as I know. Because it needs user login and password authentication. Therefore it would be better to use something like cURL, which is a good tool for simulating a user's actions at a web browser. You can use cURL on a web server with php installed and after reading the emails pass the contents to ABAP.

Similar Messages

  • Uncaught Exception occured while sending mail through abap code.

    Hi,
    Uncaught Exception occured while sending mail through abap code.Run time Errors "UNCAUGHT_EXCEPTION" occured after excuting the call method  CALL METHOD SEND_REQUEST->SEND( ).kindly help in resolving the issue.

    HI,
    Runtime Error:  UNCAUGHT_EXCEPTION details.
    Runtime Errors         UNCAUGHT_EXCEPTION
    Exception              CX_ADDRESS_BCS
    Short text
         An exception occurred that was not caught.
    What happened?
         The exception 'CX_ADDRESS_BCS' was raised, but it was not caught anywhere along
         the call hierarchy.
         Since exceptions represent error situations and this error was not
         adequately responded to, the running ABAP program 'SAPLZSEND_MAIL' has to be
         terminated.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_ADDRESS_BCS', was not caught in
        procedure "SEND_MAIL" "(FORM)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        An exception occurred
    How to correct the error
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "UNCAUGHT_EXCEPTION" "CX_ADDRESS_BCS"
        "SAPLZSEND_MAIL" or "LZSEND_MAILU01"
        "ZSEND_EMAIL"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
        3. If the problem occurs in a problem of your own or a modified SAP
        program: The source code of the program
           In the editor, choose "Utilities->More
        Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.
    The exception must either be prevented, caught within proedure
    "SEND_MAIL" "(FORM)", or its possible occurrence must be declared in the
    RAISING clause of the procedure.
    Please help me to resolve this issue.

  • Creation of transport rule to send all external mails through a particular server for a specific user..

    HI,
    In our Organisation We have a question, is there any possibility to create a transport rule for sending all external mails through a particular server by a specific user.
    in our organisation we have exchange 2007 one mailbox server and two hub transport servers...and we are using symantic gate way..

    Hi,
    Based on my knowledge, we can use the following transport rule to make that except with one user, other users cannot send outbound external emails:
    And I’m afraid that there is no Exchange feature to make one specific HUB server rout all external emails.
    Because if a Send connector is configured to send messages to an external domain, any Hub Transport server in the organization will route a message for that domain to a source server for that connector to be relayed to the destination domain.
    If you have any question, please feel free to let me know.
    Thanks,
    Angela Shi
    TechNet Community Support

  • Call external application through Abap WD application

    Hello All,
    We are trying to call an external application using ABAP.  The details are as below
    1) SAP server on AIX OS
    2) External Apps server: Windows OS
    The external apps takes a file located on windows as input and generates a file on windows as output. The external appls is installed on the windows OS.
    We are unable to trigger the VC apps from ABAP.( AIX OS).
    Appreciate if you can guide and give some examples. Please note that the OS are different.
    Questions:
    1)  How to access windows file system to execute external appls from ABAP ( AIX)
    2)  Would a RFC be required to be made between ABAP and the windows server where external appls is hosted
    3) Any sample code/links is really help ful
    We were able to get it working when the applications was hosted on local file system ( desktop) . Two problems are getting the appls executed on remote and different OS accessing windows file system through unix ( AL11 should help here i guess)
    Regards
    PN

    Hi Lekha
    I want to start a *.bsp page in a new external window and POST Parameters to this *.bsp page.
    So it is not actually showing a bsp in a ABAP WD.
    Kind regards
    Paul
    PS: create_external_window is alway a GET Method and I do not want to show Parameters in the URL.

  • How to put mail ids in CC and BCC while sending mail through ABAP?

    Hi all,
    i have created a report which sends the output of the  report to external mail ids. I want to put some email ids in CC or BCC.
    Please do guide me so that i can proceed with the development.
    Thanks and Regards,
    Syed

    just go through below code and
    *& Report  Z_TTTT
    REPORT  Z_TTTT1.
    *TABLE DECLARATIONS
    TABLES: SOLI.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT_B1 NO INTERVALS.
    SELECTION-SCREEN BEGIN  OF LINE .
    PARAMETERS: SAPID RADIOBUTTON GROUP ADDR.
    SELECTION-SCREEN COMMENT 5(20) T_SAPID.
    PARAMETERS: EMAIL_ID RADIOBUTTON GROUP ADDR.
    SELECTION-SCREEN COMMENT 30(20) T_EMAIL.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT_B2 NO INTERVALS.
    SELECTION-SCREEN BEGIN  OF LINE .
    SELECTION-SCREEN COMMENT 5(20) TXT_ID.
    SELECT-OPTIONS: ID FOR SOLI-LINE NO INTERVALS.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN  OF LINE .
    SELECTION-SCREEN COMMENT 5(20) TXT_CC.
    SELECT-OPTIONS: CC FOR SOLI-LINE NO INTERVALS.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN  OF LINE .
    SELECTION-SCREEN COMMENT 5(20) TXT_BCC.
    SELECT-OPTIONS: BCC FOR SOLI-LINE NO INTERVALS.
    SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN  OF LINE .
    *SELECTION-SCREEN COMMENT 5(20) TXT_SEND.
    *PARAMETERS: SENDER LIKE SOUD-USRNAM.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    *SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-009.
    *PARAMETERS: SUB_LINE(60) TYPE C.
    *SELECTION-SCREEN END OF BLOCK B3.
    *SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-008.
    *SELECT-OPTIONS: TEXT1 FOR SOLI-LINE NO INTERVALS.
    *SELECTION-SCREEN END OF BLOCK B4.
    SELECTION-SCREEN BEGIN OF BLOCK B5 WITH FRAME TITLE TEXT_B5.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: P_ATTACH AS CHECKBOX USER-COMMAND RAD1.
    SELECTION-SCREEN COMMENT 5(20) T_ATTACH.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(20) T_FLNAME.
    PARAMETERS: P_FLNAME  TYPE RLGRAP-FILENAME MODIF ID M1 .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B5.
    *Data Declarations
    DATA: MAIL_CONTENT LIKE SOLI OCCURS 0 WITH HEADER LINE,
          SUBJECT_LINE LIKE SOOD1-OBJDES.
    DATA : SENDER TYPE SY-UNAME.
    DATA : IT_REC type SOLI OCCURS 0 WITH HEADER LINE.
    *INITIALIZATION Block
    INITIALIZATION.
      TEXT_B1 = 'Output Specification'.
      T_SAPID = 'SAP User ID'.
      T_EMAIL = 'Email ID'.
      TXT_ID =  'Receipient Id'.
      TXT_CC =  'CC'.
      TXT_BCC = 'BCC'.
      TEXT_B2 = 'Receipient'.
      TEXT_B5 = 'Attachment'.
      T_ATTACH = 'Attachment'.
      T_FLNAME = 'File name'.
    *  TXT_SEND = 'Sender Name'.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF P_ATTACH <> 'X'.
          IF SCREEN-GROUP1 = 'M1'.
            SCREEN-INPUT = 0. " Disable for input.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FLNAME.
      PERFORM GET_FILENAME.
    *start of selection Block
    START-OF-SELECTION.
    *  LOOP AT TEXT1.
    *    MOVE TEXT1-LOW TO MAIL_CONTENT-LINE.
    *    APPEND MAIL_CONTENT.
    *  ENDLOOP.
    ****  Mail Body
      MOVE 'Hi' TO MAIL_CONTENT-LINE.
      APPEND MAIL_CONTENT.
      MOVE 'This is Test mail' TO MAIL_CONTENT-LINE.
      APPEND MAIL_CONTENT.
      MOVE 'Thanxs' TO MAIL_CONTENT-LINE.
      APPEND MAIL_CONTENT.
    ****  Mail Heading
      MOVE 'Test Mail' TO SUBJECT_LINE.
      PERFORM SEND_EMAIL  TABLES MAIL_CONTENT USING SUBJECT_LINE.
    *& Form SEND_EMAIL
    FORM SEND_EMAIL TABLES OBJCONT STRUCTURE MAIL_CONTENT
                    USING TITLE LIKE SOOD-OBJDES.
      DATA: RECEIVERS TYPE  SOOS1 OCCURS 0 WITH HEADER LINE,
            TSOOD1 TYPE SOOD1,
            PACKING_LIST TYPE SOXPL OCCURS 0 WITH HEADER LINE,
            OBJCONT1 type SOLI OCCURS 0 WITH HEADER LINE.
      DATA: BEGIN OF AT_HEADER OCCURS 1.
              INCLUDE STRUCTURE SOLI.
      DATA: END OF AT_HEADER.
      CLEAR: TSOOD1,
             RECEIVERS.
      REFRESH RECEIVERS.
      MOVE: SY-LANGU TO TSOOD1-OBJLA,
      'Email Notice' TO TSOOD1-OBJNAM,
      'C' TO TSOOD1-OBJSNS,
      TITLE TO TSOOD1-OBJDES,  " rajan
      'Rajan' TO TSOOD1-OWNNAM.
    *loop through each ID and move them to recipient table
      LOOP AT ID.
    *    TRANSLATE ID-LOW TO UPPER CASE.
        IF SAPID = 'X'.
          MOVE: SY-DATUM TO RECEIVERS-RCDAT,
          SY-UZEIT TO RECEIVERS-RCTIM,
          ' ' TO RECEIVERS-RECESC,
          ID-LOW TO RECEIVERS-RECNAM,
          'X' TO RECEIVERS-SNDEX.
        ELSE.
          MOVE: SY-DATUM TO RECEIVERS-RCDAT,
          SY-UZEIT TO RECEIVERS-RCTIM,
          'U' TO RECEIVERS-RECESC,
          'U-' TO RECEIVERS-RECNAM,
          ID-LOW TO RECEIVERS-RECEXTNAM.
        ENDIF.
        APPEND RECEIVERS.
        CLEAR RECEIVERS.
      ENDLOOP.
    *loop through each CC and move them to recipient table
      LOOP AT CC.
        TRANSLATE CC-LOW TO UPPER CASE.
        IF SAPID = 'X'.
          MOVE: SY-DATUM TO RECEIVERS-RCDAT,
          SY-UZEIT TO RECEIVERS-RCTIM,
          ' ' TO RECEIVERS-RECESC,
          CC-LOW TO RECEIVERS-RECNAM,
          'X' TO RECEIVERS-SNDEX,
          'X' TO RECEIVERS-SNDCP.
        ELSE.
          MOVE: SY-DATUM TO RECEIVERS-RCDAT,
          SY-UZEIT TO RECEIVERS-RCTIM,
          'U' TO RECEIVERS-RECESC,
          'U-' TO RECEIVERS-RECNAM,
          CC-LOW TO RECEIVERS-RECEXTNAM,
          'X' TO RECEIVERS-SNDCP.
        ENDIF.
        APPEND RECEIVERS.
        CLEAR RECEIVERS.
      ENDLOOP.
    *loop through each BCC and move them to recipient table
      LOOP AT BCC.
        TRANSLATE BCC-LOW TO UPPER CASE.
        IF SAPID = 'X'.
          MOVE: SY-DATUM TO RECEIVERS-RCDAT,
          SY-UZEIT TO RECEIVERS-RCTIM,
          ' ' TO RECEIVERS-RECESC,
          BCC-LOW TO RECEIVERS-RECNAM,
          'X' TO RECEIVERS-SNDEX,
          'X' TO RECEIVERS-SNDBC.
        ELSE.
          MOVE: SY-DATUM TO RECEIVERS-RCDAT,
          SY-UZEIT TO RECEIVERS-RCTIM,
          'U' TO RECEIVERS-RECESC,
          'U-' TO RECEIVERS-RECNAM,
          BCC-LOW TO RECEIVERS-RECEXTNAM,
          'X' TO RECEIVERS-SNDBC.
        ENDIF.
        APPEND RECEIVERS.
        CLEAR RECEIVERS.
      ENDLOOP.
      AT_HEADER = SY-DATUM.
      APPEND AT_HEADER.
      AT_HEADER = SY-UZEIT.
      APPEND AT_HEADER.
      IF SENDER EQ SPACE.
        SENDER = SY-UNAME.
      ENDIF.
      IF P_ATTACH EQ 'X'.
        PACKING_LIST-HEAD_START = 1.
        PACKING_LIST-HEAD_NUM = 2.
        PACKING_LIST-BODY_START = 1.
        PACKING_LIST-BODY_NUM = 9999.
        PACKING_LIST-FILE_EXT = 'PDF'.
        APPEND PACKING_LIST.
        CLEAR PACKING_LIST.
    *    APPEND LINES OF OBJCONT TO OBJCONT1.
    *    REFRESH OBJCONT.
        DATA : FLNAME TYPE  STRING.
        FLNAME = P_FLNAME.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            FILENAME                      = FLNAME
       FILETYPE                      = 'BIN'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
          TABLES
            DATA_TAB                      = IT_REC
    * EXCEPTIONS
    *   FILE_OPEN_ERROR               = 1
    *   FILE_READ_ERROR               = 2
    *   NO_BATCH                      = 3
    *   GUI_REFUSE_FILETRANSFER       = 4
    *   INVALID_TYPE                  = 5
    *   NO_AUTHORITY                  = 6
    *   UNKNOWN_ERROR                 = 7
    *   BAD_DATA_FORMAT               = 8
    *   HEADER_NOT_ALLOWED            = 9
    *   SEPARATOR_NOT_ALLOWED         = 10
    *   HEADER_TOO_LONG               = 11
    *   UNKNOWN_DP_ERROR              = 12
    *   ACCESS_DENIED                 = 13
    *   DP_OUT_OF_MEMORY              = 14
    *   DISK_FULL                     = 15
    *   DP_TIMEOUT                    = 16
    *   OTHERS                        = 17
        IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    APPEND LINES OF IT_REC TO OBJCONT1.
    *    APPEND  P_FLNAME TO OBJCONT1.
      ENDIF.
      CALL FUNCTION 'SO_OBJECT_SEND'
        EXPORTING
          SENDER                     = 'AAB_ABAP5'
          OBJECT_HD_CHANGE           = TSOOD1
          OBJECT_TYPE                = 'RAW'
        TABLES
          OBJCONT                    = OBJCONT
          RECEIVERS                  = RECEIVERS
          ATT_HEAD                   = AT_HEADER
          ATT_CONT                   = OBJCONT1
          PACKING_LIST               = PACKING_LIST
        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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE .
        MESSAGE 'sent successfully' TYPE 'I'.
      ENDIF.
    *  CALL FUNCTION 'GUI_DOWNLOAD'
    *  EXPORTING
    **  BIN_FILESIZE = GV_BIN_FILESIZE
    *  FILENAME =  'C:\Documents and Settings\Administrator\Desktop\file'"W_FULL_PATH
    *  FILETYPE = 'BIN'
    ** APPEND = ' '
    ** WRITE_FIELD_SEPARATOR = ' '
    ** HEADER = '00'
    ** TRUNC_TRAILING_BLANKS = ' '
    ** WRITE_LF = 'X'
    ** COL_SELECT = ' '
    ** COL_SELECT_MASK = ' '
    ** DAT_MODE = ' '
    ** CONFIRM_OVERWRITE = ' '
    ** NO_AUTH_CHECK = ' '
    ** CODEPAGE = ' '
    ** IGNORE_CERR = ABAP_TRUE
    ** REPLACEMENT = '#'
    ** WRITE_BOM = ' '
    ** TRUNC_TRAILING_BLANKS_EOL = 'X'
    ** WK1_N_FORMAT = ' '
    ** WK1_N_SIZE = ' '
    ** WK1_T_FORMAT = ' '
    ** WK1_T_SIZE = ' '
    ** IMPORTING
    ** FILELENGTH =
    *  TABLES
    *  DATA_TAB = IT_REC
    ** FIELDNAMES =
    ** EXCEPTIONS
    ** FILE_WRITE_ERROR = 1
    ** NO_BATCH = 2
    ** GUI_REFUSE_FILETRANSFER = 3
    ** INVALID_TYPE = 4
    ** NO_AUTHORITY = 5
    ** UNKNOWN_ERROR = 6
    ** HEADER_NOT_ALLOWED = 7
    ** SEPARATOR_NOT_ALLOWED = 8
    ** FILESIZE_NOT_ALLOWED = 9
    ** HEADER_TOO_LONG = 10
    ** DP_ERROR_CREATE = 11
    ** DP_ERROR_SEND = 12
    ** DP_ERROR_WRITE = 13
    ** UNKNOWN_DP_ERROR = 14
    ** ACCESS_DENIED = 15
    ** DP_OUT_OF_MEMORY = 16
    ** DISK_FULL = 17
    ** DP_TIMEOUT = 18
    ** FILE_NOT_FOUND = 19
    ** DATAPROVIDER_EXCEPTION = 20
    ** CONTROL_FLUSH_ERROR = 21
    ** OTHERS = 22
    *  IF SY-SUBRC <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    ** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM. " SEND_EMAIL
    *&      Form  GET_FILENAME
    FORM GET_FILENAME .
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          FILE_NAME = P_FLNAME.
    ENDFORM.                    " GET_FILENAME

  • Send External Mail Through One Exchange Server Only

    Hello,
    I'm very stuck on something & new to exchange.  I have two Exchange Servers:
    MAIL1: Windows Server 2003 & Exchange 2007 SP2
    MAIL2: Windows Server 2008 R2 & Exchange 2007 SP3
    All accounts are going to move eventually to MAIL2.  Until then, I would like any external emails sent, to be sent through MAIL1.
    So far all all internal mail can be sent & received, and any external mail received.  But I cannot send external mail from mailboxes on MAIL2 (just mine on MAIL2 at the minute).  MAIL1 works fine for everything.
    Can someone kindly explain what I should do to get all external mail sent through MAIL1?
    Thanks,
    Stacy

    Hi Stacy,
    We can just remove mail2 server from the mail2's send connector and add mail1 server to it.
    Then we can send mails to outside via mail1.
    Hope it is helpful
    Thanks
    Mavis
    Mavis Huang
    TechNet Community Support

  • Can we run a java class in a external server through abap program?

    Dear Experts,
    Can we run a java class in an external server ( other than application server and client system )?
    I have tried running it in the client system through a program and it works.
    But i have the requirement of running it in another system. Can it be done?

    Hi,
    If this is the case I think you can call this web service from SAP and triger the execution of the application on the "external server".
    SAP is behaving as a client in this case.
    Another alternative:
    "have tried running it in the client system through a program and it works." please elaborate.
    Regards.

  • Receiving/Reading external Email from ABAP

    Unhelpfully, certain information will only be sent to us in the text of emails sent to a specified email address (instead of a flat text file via sftp etc). This will all be within the same Intranet. We can specify the format.
    How can ABAP read the emails in the Inbox of a specified email address? Do you get a specific user to link their Office settings to a POP3/IMAP account (for example?).
    /people/anton.wenzelhuemer/blog/2006/05/27/abap-pop3-email-client-using-an-rfc-enabled-php-client-proxy gives a solution but is there a simpler way? No mail management is required (delete, flag when read etc).
    Cheers,
    Matt.
    Message was edited by:
            Matt King

    hi
    good
    try this
    Use the FM ALSM_EXCEL_TO_INTERNAL_TABLE.
    parameters : p_ifile like rlgrap-filename obligatory.
    data t_ifile like table of alsmex_tabline with header line.
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    exporting
    filename = p_ifile
    i_begin_col = 1
    i_begin_row = 1
    i_end_col = 100
    i_end_row = 5000
    tables
    intern = t_ifile
    exceptions
    inconsistent_parameters = 1
    upload_ole = 2
    others = 3.
    thanks
    mrutyun^

  • Triggering e-mail through ABAP based on conditions

    Hi ABAPers,
    I am very new to ABAP latest release.
    I am stuck up in developing a logic which fulfills the following requirement:
    If the Task = 3990 (file loaded successfully) in SAP table then those related Company ID general manager should receive a notification email. To fulfil this, I am following the below logic:
    ZTAB1 - replication of SAP table '/1SEM_UCV_0A013' (BCS system)
    ZTAB2 - Holds GM maild's
    I am comparing SAP table with ZTAB1 to check for any records with Task = '3990'. Pick up those check whether there are present in ZTAB1, if YES then do not send any mail and if NO then send the notification mail. After sending the email successfully move those records from SAP table to ZTAB1. So, when the comparison happens for nth time a repeatitive mail will not be sent to the Managers.
    The program will be scheduled on hourly basis.
    To send the email I have choosen 'SO_NEW_DOCUMENT_SEND_API1' FM.
    Could anyone of you please help me out by providing a sample code for the same?
    Many thanks,
    Sasi
    PS: Would definitely reward points for your help

    TABLES : ZBCS_MAIL, ZSEM_UCS, /1SEM/UCV__0A013.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0 WITH HEADER LINE.
    data:   w_doc_data LIKE sodocchgi1,
            l_lines type i,
            l_title LIKE sodocchgi1-obj_descr.
    DATA itab1 TYPE standard TABLE OF /1sem/ucv__0a013.
    Data wa_tab1 type /1sem/ucv__0a013.
    DATA itab2 TYPE standard TABLE OF zsem_ucs.
    Data wa_tab2 type zsem_ucs.
    DATA itab3 TYPE standard TABLE OF zsem_ucs.
    Data wa_tab3 type zsem_ucs.
    DATA itab4 TYPE standard TABLE OF zbcS_mail.
    Data wa_tab4 type zbcs_mail.
    SELECT * from /1sem/ucv__0a013 INTO TABLE itab1 WHERE task = '3990' and <datefield> = sy-datum.
    If sy-subrc = 0.
    Select * from zsem_ucs into table itab2 where task = '3990' and <datefield> = sy-datum .
    If sy-subrc = 0.
    LOOP at itab1 into wa_tab1.
    Read table itab2 into wa_tab2 with key task = '3990'  <datefield> = sy-datum <timefield> = wa_tab1-<timefield> .
    If sy-subrc ne 0.
    Append wa_tab1 to itab3.
    Endif.
    Endloop.
    Else.
    Itab3[] = itab1[].
    Endif.
    Else.
    Exit.
    Endif.
    Subject line for the mail
      l_title = 'Success...Mail program is working!!!'.
    Filling the contents
      clear it_message.
      it_message = 'This is a sample mail for testing'.
      append it_message.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      describe table it_message lines l_lines.
      w_doc_data-doc_size = l_lines * 255.
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'EMAIL'.
      w_doc_data-obj_descr  = l_title.
    Add the recipients email address
      CLEAR: t_receivers,
             wa_tab3.
      REFRESH t_receivers.
    If not itab3[] is initital.
    Select * from zbcs_mail into
    table itab4
    For all entries in itab3
    Where bukrs = itab3-bukrs.
    Loop at itab4 into wa_tab4.
        t_receivers-receiver = wa_tab4-emailid.
        t_receivers-rec_type = 'U'.
        t_receivers-notif_del = 'X'.
        t_receivers-notif_ndel = 'X'.
        APPEND t_receivers.
    Endloop.
    Function module which actually sends the mail
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
      EXPORTING
        DOCUMENT_DATA                    = w_doc_data
        DOCUMENT_TYPE                    = 'RAW'
        COMMIT_WORK                      = 'X'
      TABLES
        OBJECT_CONTENT                   = it_message
        RECEIVERS                        = t_receivers
      EXCEPTIONS
        TOO_MANY_RECEIVERS               = 1
        DOCUMENT_NOT_SENT                = 2
        DOCUMENT_TYPE_NOT_EXIST          = 3
        OPERATION_NO_AUTHORIZATION       = 4
        PARAMETER_ERROR                  = 5
        X_ERROR                          = 6
        ENQUEUE_ERROR                    = 7
        OTHERS                           = 8.
    IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    MODIFY zsem_ucs FROM TABLE itab3.
    Endif.
    Edited by: Ramesh Babu Cikka on Apr 5, 2008 12:57 PM

  • Send mail to external mail address

    Hello Guys,,
    I have required to send a mail through abap code. This program is need to schedule.
    Can some one send  me some sample code to send mail..
    I have search with existing forum , but have'nt got any proper answer.
    Thanks
    Swati....

    Hi i am sending 2 programs
    <b>First program......</b>
    REPORT  YH647_PRJ_TEST1 line-count 1000.
    data:
      fs_abaplist like abaplist.
    *DATA W_RULE(2) TYPE X VALUE '2009'.
    data:
    t_list like standard table
              of abaplist.
    DATA:
      T_DATA(1000) OCCURS 0,
      fs_data(1000).
    DATA:
       doc_chng like sodocchgi1,
       objpack like sopcklsti1 occurs 0 with header line,
       objhead like solisti1 occurs 0 with header line,
       objbin like solisti1 occurs 0 with header line,
       objtxt like solisti1 occurs 0 with header line,
       reclist like somlreci1 occurs 0 with header line,
       eml_tab like w3html occurs 0 with header line,
       eml_lines like sy-tabix,
       l_t_lines like tline occurs 0 with header line,
       tab_lines like sy-tabix.
    submit YH647_PRJ_TEST2 and return.
      import t_list from memory id 'MAN'.
    loop at t_list into fs_abaplist.
        condense fs_abaplist.
       TRANSLATE fs_abaplist using w_rule.
        write : / fs_abaplist.
      endloop.
    T_DATA[] = T_LIST[].
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
       BIN_FILESIZE                    =
         FILENAME                        = 'D:\test\PRJ1.XLS'
         FILETYPE                        = 'ASC'
       APPEND                          = ' '
        WRITE_FIELD_SEPARATOR           = ''
       HEADER                          = '00'
       TRUNC_TRAILING_BLANKS           = ' '
       WRITE_LF                        = 'X'
       COL_SELECT                      = ' '
       COL_SELECT_MASK                 = ' '
       DAT_MODE                        = ' '
       CONFIRM_OVERWRITE               = ' '
       NO_AUTH_CHECK                   = ' '
       CODEPAGE                        = ' '
       IGNORE_CERR                     = ABAP_TRUE
       REPLACEMENT                     = '#'
       WRITE_BOM                       = ' '
       TRUNC_TRAILING_BLANKS_EOL       = 'X'
       WK1_N_FORMAT                    = ' '
       WK1_N_SIZE                      = ' '
       WK1_T_FORMAT                    = ' '
       WK1_T_SIZE                      = ' '
    IMPORTING
       FILELENGTH                      =
       TABLES
         DATA_TAB                        = T_DATA
       FIELDNAMES                      =
      EXCEPTIONS
        FILE_WRITE_ERROR                = 1
        NO_BATCH                        = 2
        GUI_REFUSE_FILETRANSFER         = 3
        INVALID_TYPE                    = 4
        NO_AUTHORITY                    = 5
        UNKNOWN_ERROR                   = 6
        HEADER_NOT_ALLOWED              = 7
        SEPARATOR_NOT_ALLOWED           = 8
        FILESIZE_NOT_ALLOWED            = 9
        HEADER_TOO_LONG                 = 10
        DP_ERROR_CREATE                 = 11
        DP_ERROR_SEND                   = 12
        DP_ERROR_WRITE                  = 13
        UNKNOWN_DP_ERROR                = 14
        ACCESS_DENIED                   = 15
        DP_OUT_OF_MEMORY                = 16
        DISK_FULL                       = 17
        DP_TIMEOUT                      = 18
        FILE_NOT_FOUND                  = 19
        DATAPROVIDER_EXCEPTION          = 20
        CONTROL_FLUSH_ERROR             = 21
        OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    OBJBIN[] =  T_DATA.
      DOC_CHNG-OBJ_NAME = 'OFFER'.
      DOC_CHNG-OBJ_DESCR = 'Test Program List Output'.
      APPEND OBJTXT.
      OBJTXT = 'is enclosed as an attachment.'.
      APPEND OBJTXT.
      DESCRIBE TABLE OBJTXT LINES TAB_LINES.
      READ TABLE OBJTXT INDEX TAB_LINES.
      DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    Creating the entry for the compressed document
      CLEAR OBJPACK-TRANSF_BIN.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM   = 0.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM   = TAB_LINES.
      OBJPACK-DOC_TYPE   = 'RAW'.
      APPEND OBJPACK.
    Creating the document attachment
    (Assume the data in OBJBIN are given in BMP format)
       DESCRIBE TABLE OBJBIN LINES TAB_LINES.
       OBJHEAD = 'OUTPUT.XLS'. APPEND OBJHEAD.
    Creating the entry for the compressed attachment
       OBJPACK-TRANSF_BIN = 'X'.
       OBJPACK-HEAD_START = 1.
       OBJPACK-HEAD_NUM   = 1.
       OBJPACK-BODY_START = 1.
       OBJPACK-BODY_NUM   = TAB_LINES.
       OBJPACK-DOC_TYPE   = 'RAW'.
       OBJPACK-OBJ_NAME   = 'ATTACHMENT'.
       OBJPACK-OBJ_DESCR = 'Test program output'.
       OBJPACK-DOC_SIZE   = TAB_LINES * 255.
       APPEND OBJPACK..
    ***Recepients List
       reclist-receiver = 'SAPDEV17'.
       reclist-rec_type = 'B'.
       APPEND reclist.
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    Sending the document
      call function 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = doc_chng
                put_in_outbox              = 'X'
                commit_work                = 'X'
           TABLES
                packing_list               = objpack
                object_header              = objhead
                contents_bin               = objbin
                contents_txt               = objtxt
                receivers                  = reclist
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                operation_no_authorization = 4
                others                     = 99.
      case sy-subrc.
        when 0.
          write: / 'Result of the send process:'.
          loop at reclist.
            write: / reclist-receiver(48), ':'.
            if reclist-retrn_code = 0.
              write 'sent successfully'.
            else.
              write 'not sent'.
            endif.
          endloop.
        when 1.
          write: /
          'no authorization to send to the specified number of recipients!'
          raise too_many_recievers.
        when 2.
          write: / 'document could not be sent to any of the recipients!'.
          raise document_not_sent.
        when 4.
          write: / 'no authorization to send !'.
          raise operation_no_authorization.
        when others.
          write: / 'error occurred during sending !'.
          raise others.
      endcase.
    <b>Second program......</b>
    REPORT  YH647_PRJ_TEST2.
    TABLES:
      SFLIGHT.
    data:
    t_list like standard table
              of abaplist.
    *DATA:
    T_DATA(1000) OCCURS 0,
    fs_data(1000).
      DATA: BEGIN OF FS_DATA  OCCURS 0,
              MANDT TYPE SFLIGHT-MANDT,
              CARRID TYPE SFLIGHT-CARRID,
              CONNID TYPE SFLIGHT-CONNID,
              FLDATE TYPE SFLIGHT-FLDATE,
              PRICE(15)  TYPE C,
              CURRENCY TYPE SFLIGHT-CURRENCY,
              PLANETYPE TYPE SFLIGHT-PLANETYPE,
              SEATSMAX(10) TYPE C,
              SEATSOCC(10) TYPE C,
              PAYMENTSUM(17) TYPE C,
              SEATSMAX_B(10) TYPE C,
              SEATSOCC_B(10) TYPE C,
              SEATSMAX_F(10) TYPE C,
              SEATSOCC_F(10) TYPE C,
            END OF FS_DATA.
    DATA:
      T_DATA LIKE TABLE OF FS_DATA.
    data:
      T_SFLIGHT like table of sFLIGHT.
    select * into
           SFLIGHT
      up to 200 rows
       from sflight.
    MOVE-CORRESPONDING SFLIGHT TO FS_DATA.
    APPEND FS_DATA TO T_DATA.
    ENDSELECT.
    t_list[] = t_DATA[].
    *move t_data to t_list.
    export t_list to memory id 'MAN'.
    execute the first program......
    Reward points if useful......
    Suresh......

  • TS3276 Someone who receives my mail sent from Apple Mail cannot receive attachments or read my email even though they are on a Mac using Safari.  How could they be using Safari to receive or read my mail?

    Someone who receives my mail sent from Apple Mail cannot receive attachments or read my email even though they are on a Mac using Safari.  How could they be using Safari to receive or read my mail? 

    You can lead a horse to water, but you cannot make it drink.  This person receiving my email,  while on a Mac with Safari is reading their mail through Safari using Horde--our recent discovery.  Why they chose to do that in unclear. The last email we sent, however, was miraculously read and received and  the attachment was viewed with no problem after we told them our mail was coming from a Mac thriugh Apple Mail.  It seems that telling them that our emails were coming from a Mac and using Apple Mail was enough to make them think that perhaps THEY were doing something not quite right. Thank you both, Level 7 and Level 5. 
    But thank you especially for the meteorologists in the UK for putting forth the correct routes for Sandy these last days, you probably saved a lot of lives.

  • Sending of GR & GI slips through external mail

    Hi All,
    Kindly suggest me, to achieve following client requirement.
    The requirement is to send the GR and GI slips through external mail to "Goods Recipient" for MIGO transaction.
    Many thanks,
    Venkat

    You might want to use the message type MLGR (mail at goods receipt), but
    this message type will only work with the Message transmission medium 7
    (SAPoffice) and the processing routines:
    Program     : RSNASTSO
    FORM routine: SAPOFFICE_AUFRUF
    this is, unfortunately, you will be unable to send out an external
    mail (transmission medium 5) to your vendor using the message type MLGR.
    For a message type MLGR to be outputed, it is necessary to flag in the
    Purchase Order Header the 'Goods receipt message' indicator (EKKO-WEAKT)
    and, as you can read in the F1-on-line help for this indicator:
    "Indicator: Goods receipt message
    Indicator specifying that the system is to issue an appropriate message
    to the buyer following each goods receipt in respect of this purchase
    order".
    Therefore, the system has been designed to send an internal e-mail to
    the User ID who created the purchase order (buyer). This is made via
    SAPoffice and medium 7. However, the system has not been designed to
    send an external e-mail to the vendor.
    You can also check the IMG Activity Documentation for the activity
    'Output Determination' under the path:
    SPRO
    -> Materials Management
       -> Inventory Management and Physical Inventory
          -> Output Determination
    "Output Determination
    In Inventory Management, output is text that is created at the time of
    goods movements. There are output documents such as:
    .- goods receipt/issue slips ( example, GR/GI slips, pallet slips)
    .- labels
    .- kanban cards
    .- MAIL messages which Inventory Management uses to communicate with
        other departments (purchasing or materials planning, for example).
    Note:
    In the case of a goods receipt for a purchase order, MAIL messages are
    sent to purchasing in two cases:
    .- if Purchasing has set the indicator "GR output" in the purchase
        order,
    .- if an order price quantity has been entered at the time of a goods
        receipt which lies outside the tolerances (for a warning message).
    In the case of a goods receipt of missing parts, a mail message is sent
    to the MRP controller if the missing parts check is active for the
    plant.
    The standard system contains all settings for this output. You only
    have to maintain the mail texts for the following output types:
    MLGR (GR message)
    MLMD (GR quantity variance)
    MLFH (goods receipt of missing part)".
    Therefore:
    1.- MAIL messages within Inventory Management are used to communicate
        with other departments (purchasing or materials planning, for
        example), but not to send out information to vendors.
    2.- MLGR (GR message) are sent out to the Purchasing department only
        when the indicator "GR Message" has been set in the purchase order.

  • External Mail's Sending Via Abap Code

    <u>Hello, everyone.</u>
    I have a problem with an external mail's sending, I have to solve it very quickly.
    I'm tring to send mail to a specific address with an attachment but it doesn't work.
    Does any one has some source code that works (with file attached) ?
    Thanks in advance,
    Rebeka

    Hi rebeka,
    1. There is some trick involved
    in the binary files.
    2. I have made a program (and it works fantastic)
    ONLY 6 LINES FOR EMAILING
    BELIEVE ME
    ITS A FANTASTIC PROGRAM.
    IT WILL WORK LIKE OUTLOOK EXPRESS !
    3. The user is provided with
    a) file name
    b) email address to send mail
    and it sends ANY FILE (.xls,.pdf .xyz..)
    Instantaneously !
    4. Make two things first :
    1. Include with the name : ZAMI_INCLFOR_MAIL
    2. Report with the name : ZAM_TEMP147 (any name will do)
    3. Activate both and execute (2)
    4. After providing filename, email adress
    5. Code for Include :
    10.08.2005 Amit M - Created
    Include For Mail (First Req F16)
    Modification Log
    Data
    DATA: docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objhex LIKE solix OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA: tab_lines TYPE i,
    doc_size TYPE i,
    att_type LIKE soodk-objtp.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    FORM
    FORM ml_customize USING objname objdesc.
    Clear Variables
    CLEAR docdata.
    REFRESH objpack.
    CLEAR objpack.
    REFRESH objhead.
    REFRESH objtxt.
    CLEAR objtxt.
    REFRESH objbin.
    CLEAR objbin.
    REFRESH objhex.
    CLEAR objhex.
    REFRESH reclist.
    CLEAR reclist.
    REFRESH listobject.
    CLEAR listobject.
    CLEAR tab_lines.
    CLEAR doc_size.
    CLEAR att_type.
    Set Variables
    docdata-obj_name = objname.
    docdata-obj_descr = objdesc.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addrecp USING preceiver prec_type.
    CLEAR reclist.
    reclist-receiver = preceiver.
    reclist-rec_type = prec_type.
    APPEND reclist.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addtxt USING ptxt.
    CLEAR objtxt.
    objtxt = ptxt.
    APPEND objtxt.
    ENDFORM. "ml_customize
    FORM
    FORM ml_prepare USING bypassmemory whatatt_type whatname.
    IF bypassmemory = ''.
    Fetch List From Memory
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = listobject
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'LIST_FROM_MEMORY'.
    ENDIF.
    CALL FUNCTION 'TABLE_COMPRESS'
    IMPORTING
    COMPRESSED_SIZE =
    TABLES
    in = listobject
    out = objbin
    EXCEPTIONS
    OTHERS = 1
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'TABLE_COMPRESS'.
    ENDIF.
    ENDIF.
    Header Data
    Already Done Thru FM
    Main Text
    Already Done Thru FM
    Packing Info For Text Data
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'TXT'.
    APPEND objpack.
    Packing Info Attachment
    att_type = whatatt_type..
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = att_type.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = whatname.
    APPEND objpack.
    Receiver List
    Already done thru fm
    ENDFORM. "ml_prepare
    FORM
    FORM ml_dosend.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    put_in_outbox = 'X'
    commit_work = 'X' "used from rel. 6.10
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    CONTENTS_HEX = objhex
    OBJECT_PARA =
    object_parb =
    receivers = reclist
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8
    IF sy-subrc <> 0.
    MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
    WITH docdata-obj_name.
    ENDIF.
    ENDFORM. "ml_customize
    FORM
    FORM ml_spooltopdf USING whatspoolid.
    DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    Call Function
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = whatspoolid
    TABLES
    pdf = pdf
    EXCEPTIONS
    err_no_otf_spooljob = 1
    OTHERS = 12.
    Convert
    PERFORM doconv TABLES pdf objbin.
    ENDFORM. "ml_spooltopdf
    FORM
    FORM doconv TABLES
    mypdf STRUCTURE tline
    outbin STRUCTURE solisti1.
    Data
    DATA : pos TYPE i.
    DATA : len TYPE i.
    Loop And Put Data
    LOOP AT mypdf.
    pos = 255 - len.
    IF pos > 134. "length of pdf_table
    pos = 134.
    ENDIF.
    outbin+len = mypdf(pos).
    len = len + pos.
    IF len = 255. "length of out (contents_bin)
    APPEND outbin.
    CLEAR: outbin, len.
    IF pos < 134.
    outbin = mypdf+pos.
    len = 134 - pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF len > 0.
    APPEND outbin.
    ENDIF.
    ENDFORM. "doconv
    CODE FOR PROGRAM
    5.
    REPORT zam_temp147 .
    INCLUDE zami_inclfor_mail.
    DATA
    DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : file_name TYPE string.
    data : path like PCFILE-PATH.
    data : extension(5) type c.
    data : name(100) type c.
    SELECTION SCREEN
    PARAMETERS : receiver TYPE somlreci1-receiver lower case.
    PARAMETERS : p_file LIKE rlgrap-filename
    OBLIGATORY.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CLEAR p_file.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM ml_customize USING 'Tst' 'Testing'.
    PERFORM ml_addrecp USING receiver 'U'.
    PERFORM upl.
    PERFORM doconv TABLES itab objbin.
    PERFORM ml_prepare USING 'X' extension name.
    PERFORM ml_dosend.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    AND RETURN.
    FORM
    FORM upl.
    file_name = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = file_name
    filetype = 'BIN'
    TABLES
    data_tab = itab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    path = file_name.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    CHECK_DOS_FORMAT =
    IMPORTING
    DRIVE =
    EXTENSION = extension
    NAME = name
    NAME_WITH_EXT =
    PATH =
    EXCEPTIONS
    INVALID_DRIVE = 1
    INVALID_EXTENSION = 2
    INVALID_NAME = 3
    INVALID_PATH = 4
    OTHERS = 5
    ENDFORM. "upl
    regards,
    amit m.

  • How to read a mail from sap inbox thru abap code?

    how to read a mail from sap INBOX thru abap code? can anyone tell me the technical approach? I NEED TO READ A MAIL and then need to pass the parameters to a bapi.
    Message was edited by:
            shahid mohammed syed

    Hi SSM,
    Did you manage to have your program working? I also have same requirement. I tried standard FM and BAPI but I always encounter authorization error when I tried accessing other user's mail. Thanks.
    Regards,
    Ryan

  • Embedding external application in SAP through ABAP

    Hi All,
    I wanted to know that can we embed external application in a subscreen through ABAP.
    Thanks in advance,
    Points to helpful replies.
    Regards,
    Bharat Mistry.

    Hi Bharat,
    SAP did a lot in Terma of integration of programs running on the frontend. They have some intefaces with SAP office; I'm not too familar with them.
    What you want, is connected to the subject "Desktop Office Integration (BC-CI)".
    See the link
    http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
    for more information on this.
    SAP propvides a good pdf explaining a lot. You can find at help.sap.com; foro Additional Information->Print Files->SAP R/3 Release 4.6C->English->PDF Index->Desktop Office Integration (BC-CI): data/pdf/BCCIOFFI/BCCIOFFI.pdf
    This is not the latest version because SAP does not provide the new documentation in the form of print files, but it is good.
    Yo could have your Excel running in a subscreen will full data connection to the ABAP program. Any many tgings more.
    Depends on what you want and what you need.
    Regrads,
    Clemens

Maybe you are looking for

  • Origin server recovery after failover not working

    version of oracle web cache - webcache9.0.2.0.0_WINDOWS_OWM.zip patch set applied - p2885472_9022_WINNT firstly architecture is as follows: - 1 x Standalone OWC - 2 x Origin Web Servers (Standalone OC4J) - OWC configured with single site mapped to tw

  • How to install Apache module mod_rewrite

    Kindly tell me, how to install Apache module mod_rewrite which is a standard module in the Oracle HTTP Server (OHS).. I have installed OAS(10.1.2) but mod_rewrite module is missing.. Edited by: SrinivasanSeniorDBA on 26 Feb, 2010 2:42 PM

  • Onetime vendor bank account details

    Hi, When entering Name and Address details for a onetime vendor, the Bank Key and Bank Account fields can also be entered. Our auditors are in a flap that anybody who has access to create invoices using a onetime vendor, can enter in bank details (po

  • HOW TO FIX SESSION TIMEOUT IN ITUNES

    This seems to be a common problem all over the internet! I can't purchase and download ANYTHING from the itunes store! My internet connection is fine, I've tried changing the time, the time-zone (of the computer), I've reinstalled itunes, restarted t

  • Got upgrade for windows need Mac version how to change?

    I Inadvertently selected the windows upgrade version for Elements - I am using Mac how can I change my purchase prior to downloading?