Problem while sending Abap list to mail in the background

Hi all,
I am sending abap list to email in the background.
My code as folllows:
DATA: so_ali LIKE solisti1 OCCURS 100 WITH HEADER LINE.
  DATA: listobject LIKE abaplist OCCURS 0 WITH HEADER LINE.
  DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
  DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
  DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
  DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
  DATA: doc_chng LIKE sodocchgi1.
  DATA: tab_lines LIKE sy-tabix.
  DATA: lt_user TYPE soud3 OCCURS 0 WITH HEADER LINE.
*Start of modification Tix 14411 for transport request D82K929044
  DATA: it_user like SODLIENTI1 occurs 0 with header line.
*End of modification for Tix 14411 for transport request D82K929044
CLEAR: listobject, so_ali, objpack, objhead, objtxt, reclist, doc_chng.
  REFRESH :
     listobject, so_ali, objpack, objhead, objtxt, reclist.
creation of the document to be sent
  doc_chng-obj_name = 'BOFAREPORT'.
  WRITE sy-datum TO doc_chng-obj_descr.
  CONCATENATE 'Bank Activity Report for :'(025)
          company_itab_tr-company_code '-' doc_chng-obj_descr INTO
          doc_chng-obj_descr.                               "AN052799
  objtxt = 'This is the bank activity report received for'(026).
  APPEND objtxt.
  CONCATENATE company_itab_tr-company_code '-'
              company_itab_tr-company_name '-'
              company_itab_tr-company_city INTO
              objtxt.
  APPEND objtxt.
  WRITE sy-datum TO objtxt.
  CONCATENATE 'Date Received : '(027) objtxt INTO objtxt.
  APPEND objtxt.
  WRITE sy-uzeit TO objtxt.
  CONCATENATE 'Time Received : '(028) objtxt INTO objtxt.
  APPEND objtxt.
  DESCRIBE TABLE objtxt LINES tab_lines.
  READ TABLE objtxt INDEX tab_lines.
  doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
Creation of 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.
Creation of the document attachment
  CALL FUNCTION 'SAVE_LIST'
    EXPORTING
      list_index         = '0'
    TABLES
      listobject         = listobject
    EXCEPTIONS
      list_index_invalid = 1
      OTHERS             = 2.
  CALL FUNCTION 'TABLE_COMPRESS'       "Schneller Tabellencopy
       TABLES
            in         = listobject
            out        = so_ali.
  DESCRIBE TABLE so_ali LINES tab_lines. "objbin
  objhead = 'BOFA-REPORT'. APPEND objhead.
Creation of 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 = 'ALI'.
  objpack-obj_name = 'BOFAREPORT'.
  objpack-obj_descr = 'Bank Activity Report'.
  objpack-doc_size = tab_lines * 255.
  APPEND objpack.
Completing the recipient list
  SELECT * FROM zwfi_yefap_paypr WHERE
                       bukrs = company_itab_tr-company_code.
    IF NOT  ( zwfi_yefap_paypr-list1 IS INITIAL ).
      clear it_user[].
      CALL FUNCTION 'SO_DLI_READ_API1'
       EXPORTING
         DLI_NAME                         = zwfi_yefap_paypr-list1
      DLI_ID                           = ' '
         SHARED_DLI                       = 'X'
    IMPORTING
      DLI_DATA                         =
       TABLES
         DLI_ENTRIES                      = it_user
       EXCEPTIONS
         DLI_NOT_EXIST                    = 1
         OPERATION_NO_AUTHORIZATION       = 2
         PARAMETER_ERROR                  = 3
         X_ERROR                          = 4
         OTHERS                           = 5
      IF SY-SUBRC = 0.
        loop at it_user.
          if it_user-member_typ = 'A'.
            reclist-receiver = it_user-member_adr.
            reclist-rec_type = 'U'.
            reclist-com_type = 'INT'.
            reclist-notif_del = 'X'.
            reclist-notif_ndel = 'X'.
            append reclist.
          elseif it_user-member_typ = ''.
            reclist-receiver = it_user-member_nam.
            reclist-rec_type = 'B'.
            reclist-express = 'X'.
            append reclist.
          Endif.
        endloop.
      ENDIF.
    ENDIF.
    IF NOT ( zwfi_yefap_paypr-list2 IS INITIAL ).
      clear it_user[].
      CALL FUNCTION 'SO_DLI_READ_API1'
       EXPORTING
         DLI_NAME                         = zwfi_yefap_paypr-list2
      DLI_ID                           = ' '
         SHARED_DLI                       = 'X'
    IMPORTING
      DLI_DATA                         =
       TABLES
         DLI_ENTRIES                      = it_user
       EXCEPTIONS
         DLI_NOT_EXIST                    = 1
         OPERATION_NO_AUTHORIZATION       = 2
         PARAMETER_ERROR                  = 3
         X_ERROR                          = 4
         OTHERS                           = 5
      IF SY-SUBRC = 0.
        loop at it_user.
          if it_user-member_typ = 'A'.
            reclist-receiver = it_user-member_adr.
            reclist-rec_type = 'U'.
            reclist-com_type = 'INT'.
            reclist-notif_del = 'X'.
            reclist-notif_ndel = 'X'.
            append reclist.
          elseif it_user-member_typ = ''.
            reclist-receiver = it_user-member_nam.
            reclist-rec_type = 'B'.
            reclist-express = 'X'.
            append reclist.
          Endif.
        endloop.
      ENDIF.
    endif.
  ENDSELECT.
  CLEAR error_text.
Sending the document
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = doc_chng
      put_in_outbox              = 'X'
      COMMIT_WORK                = 'X'
   TABLES
      packing_list               = objpack
      object_header              = objhead
      contents_bin               = so_ali  "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 'The document was sent'.
        else.
          CONCATENATE 'The document could not be sent to : '(029)
                     reclist-receiver(48) INTO error_text.
        ENDIF.
      ENDLOOP.
    WHEN 1.
      error_text = text-030.
    WHEN 2.
      error_text = 'Document could not be sent to any recipient'(031).
    WHEN 4.
      error_text = 'No send authorization'(032).
    WHEN OTHERS.
      error_text = 'Error occurred while sending'(033).
  ENDCASE.
  IF NOT ( error_text IS INITIAL ).
    CONCATENATE 'Mail send Error : '(034) error_text INTO error_text.
   PERFORM WRITE_LOG(YEFAP_APERAK) USING ERROR_TEXT.
    PERFORM write_log(zwfi_yefap_bank_report) USING error_text.
  ENDIF.
  CALL FUNCTION 'LIST_FREE_MEMORY'
    TABLES
      listobject = listobject
    EXCEPTIONS
      OTHERS     = 1.
When I excute the same program in the foreground, Attachment in the mail is showing all the pages of the report output.
But when I excute the same program in the background only last page is shown in the mail attachemnt.
I think the problem is with the function module SAVE_LIST function module.
I replaced the SAVE_LIST function module with  LIST_TO_MEMORY and LIST_FROM_MEMORY function modules.
It is also giving the same result.
In the foreground excution email attachemnt showing all the pages and in the background excution only last page is shown in the attachemnt.
I want all the pages dispalyed in the background mode excution in the email attachment.
How to slove this issue.
Thanks in advance.
Raja

I have seen this problem before.   Please have a look at this example program.  This works very well when ran in background as well as foreground
* This program works in the background,
report zrich_0003 .
data: maildata like sodocchgi1.
data: mailtxt like solisti1 occurs 10 with header line.
data: mailrec like somlrec90 occurs 0 with header line.
data: list type table of abaplist with header line.
data: ascilines(1024) type c occurs 0 with header line.
data: htmllines type table of w3html with header line.
parameters: p_check.
start-of-selection.
  submit zrich_0004 exporting list to memory and return.
  call function 'LIST_FROM_MEMORY'
       tables
            listobject = list
       exceptions
            not_found  = 1
            others     = 2.
  call function 'LIST_TO_ASCI'
       tables
            listobject         = list
            listasci           = ascilines
       exceptions
            empty_list         = 1
            list_index_invalid = 2
            others             = 3.
  call function 'WWW_HTML_FROM_LISTOBJECT'
       tables
            html       = htmllines
            listobject = list.
  clear: maildata, mailtxt, mailrec.
  refresh: mailtxt, mailrec.
  maildata-obj_name = 'TEST'.
  maildata-obj_descr = 'Test Subject'.
  loop at htmllines.
    mailtxt = htmllines.
    append mailtxt.
  endloop.
  mailrec-receiver = '[email protected]'.
  mailrec-rec_type = 'U'.
  append mailrec.
  call function 'SO_NEW_DOCUMENT_SEND_API1'
       exporting
            document_data              = maildata
            document_type              = 'HTM'
            put_in_outbox              = 'X'
       tables
            object_header              = mailtxt
            object_content             = mailtxt
            receivers                  = mailrec
       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.
  commit work.
  wait up to 2 seconds.
  submit rsconn01 with mode = 'INT'
               with output = 'X'
                          and return.
Regards,
Rich Heilman

Similar Messages

  • Problem while sending Abap list to mail

    Hi All,
    I am sending an abap list to mail using function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    Report output is going to mail id but only last page is showing.
    The flow i followed in the code is as follows:
    First I used Function module SAVE_LIST
    Next I used Function module TABLE_COMPRESS
    And finally i used function module SO_NEW_DOCUMENT_ATT_SEND_API1
    Report output is going to mail id but last page is showingup.
    I want all the pages to show in the email.
    How it can be solved?
    Thanks in Advance,
    Raja

    Raja,
    Please provide your code that builds the ABAP List and the code that builds the mail package.

  • Excel problem while sending report output as mail!!

    Hi,
    I am sending an excel file as attachment in the mail id provided on the selection screen but once we open the attachment the first column value is not displayed in excel , but if we click on the excel cell twice , it does display the content otherwise it's seen as blank ..what may be the reason?
    I am using FM SO_DOCUMENT_SEND_API1 for sending mail...
    Points for sure .....
    Regards
    Gunjan

    Hello,
    DO like this:
      CONSTANTS: CON_CRET TYPE X VALUE '0D',  "OK for non Unicode
                 CON_TAB TYPE X VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    *    con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
             INTO IT_ATTACH SEPARATED BY CON_TAB.
      CONCATENATE CON_CRET IT_ATTACH  INTO IT_ATTACH.
      APPEND  IT_ATTACH.
      LOOP AT IT_EKPO INTO WA_CHAREKPO.
        CONCATENATE WA_CHAREKPO-EBELN WA_CHAREKPO-EBELP
                    WA_CHAREKPO-AEDAT WA_CHAREKPO-MATNR
               INTO IT_ATTACH SEPARATED BY CON_TAB.  " Check here
        CONCATENATE CON_CRET IT_ATTACH  INTO IT_ATTACH.  " Check here
        APPEND  IT_ATTACH.
      ENDLOOP.
    VAsanth

  • Problem  while sending the mail from sap

    Hi experts,
                     I am facing some problem while sending mail from sap to external mail.
    this is th code i am using but it is not working. plz check and tell me.
    REPORT  ZMAIL_DEMO.
    data: maildata type sodocchgi1.
    data: mailtxt type table of solisti1 with header line.
    data: mailrec type table of somlrec90 with header line.
    start-of-selection.
    break-point.
    clear: maildata, mailtxt, mailrec.
    refresh: mailtxt, mailrec.
    maildata-obj_name = 'TEST'.
    maildata-obj_descr = 'Test'.
    maildata-obj_langu = sy-langu.
    mailtxt-line = 'This is a test'.
    append mailtxt.
    mailrec-receiver = 'SOME MAIL ID'.
    mailrec-rec_type = 'U'.
    append mailrec.
    call function 'SO_NEW_DOCUMENT_SEND_API1'
    exporting
    document_data = maildata
    document_type = 'RAW'
    put_in_outbox = 'X'
    tables
    object_header = mailtxt
    object_content = mailtxt
    receivers = mailrec
    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.   "( did not receive any mail) *
    write : 'mail sent'.
    endif.

    Hi,
    Please check with the following code.
    TABLES: KNA1.
    data for send function
    DATA DOC_DATA  LIKE SODOCCHGI1.
    DATA OBJECT_ID LIKE SOODK.
    DATA OBJCONT   LIKE SOLI OCCURS 10 WITH HEADER LINE.
    DATA RECEIVER  LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
    SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.
      WRITE:/ KNA1-KUNNR, KNA1-ANRED.
    send data internal table
      CONCATENATE KNA1-KUNNR KNA1-ANRED
                             INTO OBJCONT-LINE SEPARATED BY SPACE.
      APPEND OBJCONT.
    ENDSELECT.
    insert receiver (sap name)
      REFRESH RECEIVER.
      CLEAR RECEIVER.
      MOVE: 'any_email'_ TO RECEIVER-RECEIVER,                " SY-UNAME
            'X'      TO RECEIVER-EXPRESS,
            'U'      TO RECEIVER-REC_TYPE.
      APPEND RECEIVER.
    insert mail description
      WRITE 'Sending a mail through abap'
                     TO DOC_DATA-OBJ_DESCR.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_DATA              = DOC_DATA
         IMPORTING
              NEW_OBJECT_ID              = OBJECT_ID
         TABLES
              OBJECT_CONTENT             = OBJCONT
              RECEIVERS                  = RECEIVER
         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.

  • Problem while sending IDOC to File Senario

    Hi Experts
        I am having problem while sending the Idoc from SAP R/3 to File
       I have done all the setting in SAP as well in XI but while pushing IDOC
       I am getting error in the transaction sm58 in SAP R/3
      " <b>The service for the client 300(My SAP R/3 client) is not present in Integration
      Directory</b>"
    I can any one explain me what to done on this....all the connections are fine
    Waiting for Response
    Adv points and thanx
    Rakesh

    Reason and Prerequisites
    You send IDocs from system ABC to the exchange infrastructure (XI) of system XIZ, and error messages are issued in system ABC (Transaction SM58) for the IDOC_INBOUND_ASYNCHRONOUS function module.
    This note proposes solutions for the following error messages:
    a) No service for system SAPABC client 123 in the integration directory
    b) Transaction IDX1: Port SAPABC, client 123, RFC destination
    c) ::000
    d) NO_EXEC_PERMISSION: "USER" "Business_System"
    e) IDoc adapter inbound: Error error ...
    Solution
    a) Error message: No service for system SAPABC client 123 in the integration directory
    Solution:
    You send IDocs from system ABC to XI. In the control record of the IDoc, the SNDPOR field contains the value "SAPABC". The client of the sending system is determined by the MANDT field of the control record. The system ID and client are then used to determine a service without party of the type (business-system/business-service):
    Business system
    Activities in the System Landscape Directory (SLD)(Create technical system):
    Create a technical system for system ABC in the SLD, and create the client for this. Do not forget to assign an "ALE logical system" (for example, "ABCCLNT123") to this technical system.
    SLD (Business system):
    You can now explicitly assign a business system to this client.
    For more details, refer to the SLD documentation.
    Activities in system ABC (self-registration in the SLD):
    Alternatively, you can register the system in the SLD in system ABC with Transaction RZ70. You will find detailed information about the SLD registration of systems on the SAP Service Marketplace for the "Exchange Infrastructure" in the document "Exchange_Installation_Guide.pdf".
    In system ABC, you can check your configuration with TransactionSLDCHECK.
    Activities in Integration Directory (import business system from SLD):
    You will find the business systems under Services Without Party in the Integration Services. In the Service menu, you will find the system identifiers, the client, and the corresponding ALE logical system under "Objects"->"Adapter-specific identifiers".
    Use the Import/Update button to copy the data from the SLD, to create business systems, or to update their identifiers.
    Business service
    Activities in the Integration Builder directory:
    You want to create a service without party that is not part of your system infrastructure and is therefore not maintained in the SLD.
    In the Integration Builder directory, you will find the "Business-Services" under Services Without Party. In the Service menu, you will find the system identifiers, the client, and the corresponding ALE logical system under "Objects"->"Adapter-specific identifiers".
    Activate the change list in Integration Directory.
    In system ABC, you can restart the incorrect entry from Transaction SM58 .
    b) Error message: Transaction IDX1: Port SAPABC, client 123, RFC destination
    Solution:
    The Integration Server tries to load the IDoc metadata from the sending system. The IDoc schemas from the Integration Repository cannot be used because they are release-dependent.
    The sending system is determined by the value of the "SNDPOR" field from the IDoc control record (for example, "SAPABC").
    Activities in the central XI system:
    In Transaction IDX1, you can assign an RFC destination to the sending system (for example, "SAPABC"). This must be created beforehand in Transaction SM59.
    Note that the IDoc metadata is cross-client data. In Transaction IDX1, only one entry must be maintained for each system. Only the lowest client is used by the runtime for Idoc metadata retrieval with RFC.
    Ensure that only SAPABC and not "SAPABC_123" is entered in the port name.
    c) Error message: "::000"
    Solution:
    This error occurs if the central XI system tries to load the IDoc metadata from the sending system by RFC.
    There may be several different reasons for the failure of the metadata import, the error is not transferred in full by tRFC completely, and this results in the error message above.
    User cannot log onto sending system
    User/password/client is not correct or the user is logged due to too many failed logons.
    Activities in sender system ABC:
    Transaction SM21 contains entries for failed logons.
    Activities in the central XI system:
    Determine the sending port from the IDoc control record of the IDoc. If the ID of the sending system has the value "ABC", the value of the sending port is "SAPABC". You will find the RFC destination used for the "SAPABC" sending port with the lowest client in Transaction IDX1. In Transaction SM59, you will find the RFC destination containing the maintained logon data .
    User does not have the required authorizations
    Activities in the sender system ABC:
    In Transaction SM21, you will find entries relating to authorization problems and more exact details.
    Contact your system administrator and, if necessary, assign the user the required roles in user administration.
    IDoctyp/Cimtyp cannot be loaded
    Activities in sender system ABC:
    In the sender system, you can check your IDoc types in Transaction WE30 (IDoc type editor)  Take note not only of the errors, but also of the warnings.
    The most common errors are:
    - IDoc type or segments not released
    - Segments that no longer exist are listed in the IDoc type
    - Data elements that do not exist in the DDIC are assigned to fields
      in the segment.
    Contact your system administrator and correct these errors in the IDoc type.
    d) Error message: NO_EXEC_PERMISSION: "User" "Business_System"
    Solution:
    You created a list of users in the directory who are authorized to use the "Business_System". The user in the error message is not on the list.
    Alternatively, the same error is used if you have created a sender agreement with a channel of the IDoc type for the "Business_System" and the interface used. The user in the error message is not contained in the list of all authorized users defined there.
    e) Error message: IDoc adapter inbound: Error error
    Solution:
    You send IDocs to the central XI system, where they are received by the IDoc adapter. The IDocs are converted into IDoc XML, and a corresponding XI message is generated and transferred to the XI Runtime Engine. The Engine tries to read its own business system from the "Exchange Profile". If the Exchange Profile is currently unavailable, the message is not processed and it is returned to the sending system with an error message.
    Regard's
    Prabhakar.....

  • Problem with sending and receiving e-mail through exchange [GMail]

    Hello I have problem with sending and receiving e-mail.
    all is well set, username and password are correct, the server set m.google.com. verification of data is about like stepping into a post and want to check the post office gives me an error message: Can not Get Mail. The connection to the server has failed
    I have this problem on my two iPhone

    http://www.zdnet.com/google-drops-exchange-activesync-support-for-free-email-acc ounts-7000008836/

  • Report to send a List via mail

    Hi everybody,
    at the moment we hava a report which we have to start every day to generate a customer List. Via SAP Office we can send this list via email to a specific person. Now I like to automate this report and start it as a job which automativly send this list via mail.
    Do you have an idea how this will work?
    Thanks a lot for your help.
    Kind regards
    Christian

    Hi Christian.
    You could put the lines of your list in a table of type SOLISTI1 and then use the function module SO_NEW_DOCUMENT_SEND_API1 to send the content of this table. You have to fill the table RECEIVERS with the address you want to send the report to.
    Hope that helps,
    Timo.

  • Problem in sending messages using java mail api

    Hi All,
    I have a problem in sending messages via java mail api.
    MimeMessage message = new MimeMessage(session);
    String bodyContent = "ñSunJava";
    message.setText (bodyContent,"utf-8");using the above code its not possible for me to send the attachment. if i am using the below code means special characters like ñ gets removed or changed into some other characters.
    MimeBodyPart messagePart = new MimeBodyPart();
                messagePart.setText(bodyText);
                // Set the email attachment file
                MimeBodyPart attachmentPart = new MimeBodyPart();
                FileDataSource fileDataSource = new FileDataSource("C:/sunjava.txt") {
                    public String getContentType() {
                        return "application/octet-stream";
                attachmentPart.setDataHandler(new DataHandler(fileDataSource));
                attachmentPart.setFileName(filename);
                Multipart multipart = new MimeMultipart();
                multipart.addBodyPart(messagePart);
                multipart.addBodyPart(attachmentPart);
                message.setContent(multipart);
                Transport.send(message);is there any way to send the file attachment with the body message without using MultiPart java class.

    Taken pretty much straight out of the Javamail examples the following works for me (mail read using Thunderbird)        // Define message
            Message message = new MimeMessage(session);
            message.setFrom(new InternetAddress(from));
            // Set the 'to' address
            for (int i = 0; i < to.length; i++)
                message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
    // Set the 'cc' address
    for (int i = 0; i < cc.length; i++)
    message.addRecipient(Message.RecipientType.CC, new InternetAddress(cc[i]));
    // Set the 'bcc' address
    for (int i = 0; i < bcc.length; i++)
    message.addRecipient(Message.RecipientType.BCC, new InternetAddress(bcc[i]));
    message.setSubject("JavaMail With Attachment");
    // Create the message part
    BodyPart messageBodyPart = new MimeBodyPart();
    // Fill the message
    messageBodyPart.setText("Here's the file ñSunJava");
    // Create a Multipart
    Multipart multipart = new MimeMultipart();
    // Add part one
    multipart.addBodyPart(messageBodyPart);
    // Part two is attachment
    for (int count = 0; count < 5; count++)
    String filename = "hello" + count + ".txt";
    String fileContent = " ñSunJava - Now is the time for all good men to come to the aid of the party " + count + " \n";
    // Create another body part
    BodyPart attachementBodyPart = new MimeBodyPart();
    // Get the attachment
    DataSource source = new StringDataSource(fileContent, filename);
    // Set the data handler to this attachment
    attachementBodyPart.setDataHandler(new DataHandler(source));
    // Set the filename
    attachementBodyPart.setFileName(filename);
    // Add this part
    multipart.addBodyPart(attachementBodyPart);
    // Put parts in message
    message.setContent(multipart);
    // Send the message
    Transport.send(message);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem while sending the message using RWB

    Dear All,
    I am facing a problem while sending a message from RWB. I sent the message using Test Message in component monitoring, it says message sent but I am not able to see any message in sxi_monitor.
    When I send the same message using the http client it successfully processed by XI and I can see the success message in sxi_monitor.
    Please let me know if anyone has face similar kind of issue.
    Thanks,
    Alok
    Edited by: Alok Raoka on May 26, 2008 5:08 PM

    Dear All,
    I am facing a problem while sending a message from RWB. I sent the message using Test Message in component monitoring, it says message sent but I am not able to see any message in sxi_monitor.
    When I send the same message using the http client it successfully processed by XI and I can see the success message in sxi_monitor.
    Please let me know if anyone has face similar kind of issue.
    Thanks,
    Alok
    Edited by: Alok Raoka on May 26, 2008 5:08 PM

  • Problem while sending FAX through PRINT_TEXT    FM

    Hi All,
    I have a problem while sending a fax.
    we are sending fax through the FM PRINT_TEXT.
    Below is the FM we are passing paramenters.
    CALL FUNCTION 'PRINT_TEXT'
           EXPORTING
                APPLICATION              = 'TX'
                DEVICE                   = 'TELEFAX'
                DIALOG                   = SPACE
                HEADER                   = fs_header
                OPTIONS                  = fs_popt
           IMPORTING
                RESULT                   = fs_pres
           TABLES
                LINES                    = <b>int_fax</b>
           EXCEPTIONS
                CANCELED                 = 1
                DEVICE                   = 2
                FORM                     = 3
                OPTIONS                  = 4
                UNCLOSED                 = 5
                UNKNOWN                  = 6
                FORMAT                   = 7
                TEXTFORMAT               = 8
                COMMUNICATION            = 9
                BAD_PAGEFORMAT_FOR_PRINT = 10
                OTHERS                   = 11.
      if sy-subrc ne 0.
        p_flag = lit_x.
      endif.
    In INT_FAX internal table we have two fields one is tdformat second one is tdline
    The lengh of the TDLINE is 132 char,Initially for all reocords we have only 108 char length,But according to user requirement we added one more field in taht
    Now the lengh increased to 132 for each records.
    When i checked in debugg mode the INT_FAX internal table have all 132 characters.
    The problem is while checking in SOST trnasaction it is showing 108 characters in one line and remaining in second line,can you please help on this.
    Thanks In advance
    Sriman.

    may it be that in those cases where it doesnt work, that you got no fax number?
    Since it works soemtimes, it seems there are no errors, but rather in some cases some important info is missing, fax number may be one of thsoe important info in a FAX scenario.

  • Problem while sending unicode (utf-8) xml to IE.

    Hi,
    I have encoding problem while sending utf-8 xml from servlet to IE (Client), where i am parsing the xml using Ajax.
    In the log I can see proper special characters that are being sent from the servlet. but when same is seen in the client end,, it is showing ? symbols instead of special charcters.
    This is the code that sends the xml from servlet.
    ByteArrayOutputStream stream = new ByteArrayOutputStream(2000);
    transformer.transform(new DOMSource(document), new StreamResult(new OutputStreamWriter(stream, "iso-8859-1")));
    _response.setContentType("text/xml; charset=UTF-8");
    _response.setHeader("Cache-Control", "no-cache");
    _response.getWriter().println(new String(stream.toByteArray(),  "UTF-8"));
    In the log i can see :
    <response status="success" value="1154081722531" hasNextPage="false" hasPreviousPage="false" ><row row_id="PARTY_test_asdasd" column_0="PARTY_test_asdasd" column_1="asdasd �" mode="edit" column_en_US="asdasd �" column_de_DE="? xyz" column_fr_FR="" ></row></response>
    But in the Client side I am able to see
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <response status="success" value="1154082795061" hasNextPage="false" hasPreviousPage="false"><row row_id="PARTY_test_asdasd" column_0="PARTY_test_asdasd" column_1="asdasd ?" mode="edit" column_en_US="asdasd ?" column_de_DE="? xyz" column_fr_FR=""/></response>
    I am getting ? instead of �.
    It will be greatful if somebody tell how to send utf xml from servlet, for ajax purpose.
    Thanks,
    Siva1

    This is the code that sends the xml from servlet.
    ByteArrayOutputStream stream = new
    ByteArrayOutputStream(2000);
    transformer.transform(new DOMSource(document), new
    StreamResult(new OutputStreamWriter(stream,
    "iso-8859-1")));Here you produce XML that's encoded in ISO-8859-1. (!!!)
    _response.setContentType("text/xml; charset=UTF-8");Here you tell the browser that it's encoded in UTF-8.
    _response.getWriter().println(new String(stream.toByteArray(), "UTF-8"));Here you convert the XML to a String, assuming that it was encoded in UTF-8, which it wasn't.
    Besides shooting yourself in the foot by choosing ISO-8859-1 for no good reason, you're also doing a lot of translating from bytes to chars and back again. Not only is that a waste of time, it introduces errors if you don't do it right. Try this instead:_response.setContentType("text/xml; charset=UTF-8");
    _response.setHeader("Cache-Control", "no-cache");
    _transformer.transform(new DOMSource(document_),
                    new StreamResult(_response.getOutputStream()));

  • How to rollback a traansacation if we got any problem while sending data to

    how to rollback a traansacation if we got any problem while sending data to a webservice...

    Is it SOA or OSB? Which version you are in..

  • Function Module to send output list to mail.

    Hi,
    Could anyone let me know the function module to send output list to mail.
    Regards,
    Ramesh

    Hi,
    Please try with following sample code
    Sending mail with attachment
    This program will allowed you to send email with attachment.
    First, specify the attachment file from your local hardisk and execute.
    Next, specify the sender email address and click the send button.
    report YUP_MAIL.
    data method1 like sy-ucomm.
    data g_user like soudnamei1.
    data g_user_data like soudatai1.
    data g_owner like soud-usrnam.
    data g_receipients like soos1 occurs 0 with header line.
    data g_document like sood4 .
    data g_header like sood2.
    data g_folmam like sofm2.
    data g_objcnt like soli occurs 0 with header line.
    data g_objhead like soli occurs 0 with header line.
    data g_objpara  like selc occurs 0 with header line.
    data g_objparb  like soop1 occurs 0 with header line.
    data g_attachments like sood5 occurs 0 with header line.
    data g_references like soxrl occurs 0 with header line.
    data g_authority like sofa-usracc.
    data g_ref_document like sood4.
    data g_new_parent like soodk.
    data: begin of g_files occurs 10 ,
      text(4096) type c,
       end of g_files.
    data : fold_number(12) type c,
           fold_yr(2) type c,
           fold_type(3) type c.
    parameters ws_file(4096) type c default 'c:\debugger.txt'.
    Can me any file fromyour pc ....either xls or word or ppt etc ...
    g_user-sapname = sy-uname.
    call function 'SO_USER_READ_API1'
    exporting
       user                            = g_user
       PREPARE_FOR_FOLDER_ACCESS       = ' '
    importing
       user_data                       = g_user_data
    EXCEPTIONS
       USER_NOT_EXIST                  = 1
       PARAMETER_ERROR                 = 2
       X_ERROR                         = 3
       OTHERS                          = 4
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    fold_type = g_user_data-outboxfol+0(3).
    fold_yr = g_user_data-outboxfol+3(2).
    fold_number =  g_user_data-outboxfol+5(12).
    clear g_files.
    refresh : g_objcnt,
      g_objhead,
      g_objpara,
      g_objparb,
      g_receipients,
      g_attachments,
      g_references,
      g_files.
    method1 = 'SAVE'.
    g_document-foltp  = fold_type.
    g_document-folyr   = fold_yr.
    g_document-folno   = fold_number.
    g_document-objtp   = g_user_data-object_typ.
    *g_document-OBJYR   = '27'.
    *g_document-OBJNO   = '000000002365'.
    *g_document-OBJNAM = 'MESSAGE'.
    g_document-objdes   = 'sap-img.com testing by program'.
    g_document-folrg   = 'O'.
    *g_document-okcode   = 'CHNG'.
    g_document-objlen = '0'.
    g_document-file_ext = 'TXT'.
    g_header-objdes =  'sap-img.com testing by program'.
    g_header-file_ext = 'TXT'.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = sy-uname
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
      FOLMEM_DATA        =
      RECEIVE_DATA       =
    File from the pc to send...
    method1 = 'ATTCREATEFROMPC'.
    g_files-text = ws_file.
    append g_files.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
    method1 = 'SEND'.
    g_receipients-recnam = 'MK085'.
    g_receipients-recesc = 'B'.
    g_receipients-sndex = 'X'.
    append  g_receipients.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header.
    *-- End of Program
    Thanks,
    -Pramod

  • I'm trying to unlock an Iphone 4. The celular company allready unlocked it. and send me an E Mail with the instructions to do it myself. I have done every step, and in itunes apears that my Iphone is Unlocked. But I can not use a sim CArd from another Co

    Im tying to unlock an Iphone 4.
    the celular company make it by its system, and send me an E mail with the instructions to finsh the process by myself, throug itunes.
    I did every step, and at the end appers a message telling that my Iphone is unlocked.
    but it does not work with other celular company sim card.
    It only works with the original sim Card company.
    In the Iphone appears a message teeling that has no service with another company's sim CArd.
    I don't know what to do.
    I've been doing this, with different Sim cards.
    sometimes appears a message informing that the SIM card is locked with a PIN. That i must instal the last itunes version and connect it again.
    but every Sim card I have are with PIN.
    If you can help me I;ll be very glad.
    Thank you very Much.
    nicanorfrommon

    Chrisj4203, thank you for your kind answer.
    I have done a lot of restores to the Iphone, and resets also.
    I;ve done holding both buttons as you sugested, but there is no signal appearing.
    I am in Uruguay, South America and the original company is Movistar ( Telefonica) and the new sim card is from ANTEL ( the officail and biggest company in my country).
    I don;t knoe what todo.
    I have been trying for more than one mont.
    I have gone several times to both companies. Aldo two times to Apple uruguay, and nobody can help me.

  • I am facing a problem while working in Muse... The issue is I cannot delete a page from my plan, when I am trying to delete it showing an error and the application shuts down. I am working on an emergency project which I got to submit it tomorrow I hope y

    I am facing a problem while working in Muse... The issue is I cannot delete a page from my plan, when I am trying to delete it showing an error and the application shuts down. I am working on an emergency project which I got to submit it tomorrow I hope you will find a solution for the same.Help with using Adobe Muse CC

    Thanks,
    I have tried with a new site it's working perfectly.
    See the screenshot of the error.
    Thanks for your support Rohit

Maybe you are looking for

  • Can I transfer photos between users on same macbook?

    Can I transfer photos between users on same macbook? I've exported them out of iPhoto into a folder on desktop. Would like to move them into other User account on same laptop.

  • Digital signature stopped working in Acrobat Pro 9

    My digital id functionality in signing PDFs has suddenly stopped working. I've tried using it with multiple documents and none are working. I tried to create a new digital id, but that doesn't work either. Here's the error message I'm getting: (pleas

  • WSDL generated from service that references XMLBean is invalid

    Env: Weblogic Workshop 9.2.0 Build id: 783464 When I validate a WSDL generated from a service that imports XMLBean classes (auto-generated by the XMLBeans Builder) it shows numerous errors including src-resolve.4.2. and ?The part ?parameters? has an

  • Disk on port 0 at risk..

    on startup I get a message saying that my Harddrive is at risk, i pressed continue and this has been going for about a month or two now. I get the message "disk on port 0 at risk" on the bottom right corner of my screen, but I havent encountered any

  • How to create user in Express database through express command

    Hi In our application we need add/delete new user to the OFA. Is there any way of doing this through the automated express.? Is there any Express command to add new user ? If so,Please let me know how to do that. Thanks Murugesan