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.

Similar Messages

  • Problem while sending e-mail from SAP

    Hi,
    I need to modify customized report, my problem is i need to download as .XLS file as well i need to send as an attachment to e-mail. If i select with NO-Delimeter the attachment comming as .TXT file and if i select any delimeter that occupying one cell in .XLS file.
    Can anyone help me out in this.
    Thanks,
    Yogesh

    Hi Yogesh,
    Refer the following code as pointer to sending email with attachment.
    REPORT ZSAMPL_001 .
    INCLUDE ZINCLUDE_01.
    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
    ***INCLUDE ZINCLUDE_01 .
    Data
    tables crmrfcpar.
    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.
    data v_rfcdest LIKE crmrfcpar-rfcdest.
    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
    FORM
    FORM ml_saveforbp USING jobname jobcount.
    Data
    *data : yhead like yhrt_bp_head.
    *DATA : ydocdata LIKE yhrt_bp_docdata,
    *yobjtxt LIKE yhrt_bp_objtxt OCCURS 0 WITH HEADER LINE,
    *yreclist LIKE yhrt_bp_reclist OCCURS 0 WITH HEADER LINE.
    *DATA : seqnr TYPE i.
    Head
    *yhead-jobname = jobname.
    *yhead-jobcount = jobcount..
    *MODIFY yhrt_bp_head FROM yhead.
    Doc Data
    *ydocdata-jobname = jobname.
    *ydocdata-jobcount = jobcount.
    *MOVE-CORRESPONDING docdata TO ydocdata.
    *MODIFY yhrt_bp_docdata FROM ydocdata.
    Objtxt
    *seqnr = 0.
    *LOOP AT objtxt.
    *seqnr = seqnr + 1.
    *yobjtxt-jobname = jobname.
    *yobjtxt-jobcount = jobcount.
    *yobjtxt-seqnr = seqnr.
    *MOVE-CORRESPONDING objtxt TO yobjtxt.
    *MODIFY yhrt_bp_objtxt FROM yobjtxt.
    *ENDLOOP.
    RecList
    *seqnr = 0.
    *LOOP AT reclist.
    *seqnr = seqnr + 1.
    *yreclist-jobname = jobname.
    *yreclist-jobcount = jobcount.
    *yreclist-seqnr = seqnr.
    *MOVE-CORRESPONDING reclist TO yreclist.
    *MODIFY yhrt_bp_reclist FROM yreclist.
    *ENDLOOP.
    ENDFORM. "ml_saveforbp
    FORM
    FORM ml_fetchfrombp USING jobname jobcount.
    *CLEAR docdata.
    *REFRESH objtxt.
    *REFRESH reclist.
    *SELECT SINGLE * FROM yhrt_bp_docdata
    *INTO corresponding fields of docdata
    *WHERE jobname = jobname
    *AND jobcount = jobcount.
    *SELECT * FROM yhrt_bp_objtxt
    *INTO corresponding fields of TABLE objtxt
    *WHERE jobname = jobname
    *AND jobcount = jobcount
    *ORDER BY seqnr.
    *SELECT * FROM yhrt_bp_reclist
    *INTO corresponding fields of TABLE reclist
    *WHERE jobname = jobname
    *AND jobcount = jobcount
    *ORDER BY seqnr.
    ENDFORM. "ml_fetchfrombp
    <b>Please reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Problem sending externail mail from SAP

    I am facing problem in sending external mail from SAP. for ex: yahoo, hotmail like that. But, i can able to send the mails to my domain ids. I have configured both the SMTP and SAP internet gateway to send mails.
    But, i dont know what could be the problem in sending external mails.
    Is there any body to help me in this regard
    Regards,
    B.Sudharsan

    Hi Sudarsan,
    How are you trying to send an e-mail using ABAP or using actions or ?
    Enclosed link gives you a complete overview of the settings and the way to send an e-mail using ABAP ( if necessary).
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    Reward points if it helps.
    Regards,
    Vamsi Krishna P.

  • Problem while exporting the data from a report to an excel file.

    Hi SAP guru's,
    I have a problem while exporting the data from a report to an excel file.
    The problem is that after exporting, the excel file seems to have some irrelevant characters....I am checking this using SOST transaction..
    Required text (Russian):
    Операции по счету                                    
    № документа     Тип документа     № учетной записи     Дата документа     Валюта     Сумма, вкл. НДС     Срок оплаты     Описание документа
    Current Text :
       ? 5 @ 0 F 8 8  ? >  A G 5 B C                                   
    !   4 > : C       "" 8 ?  4 > : C      !   C G 5 B = > 9  7 0 ? 8 A 8        0 B 0  4 > : C         0 ; N B 0      ! C <       ! @ > :  > ? ; 0 B K        ? 8 A 0 = 8 5  4 > : C
    Can you help me making configuration settings if any?
    Regards,
    Avinash Raju

    Hi Avinash
    To download  such characteres you need to adjust code page to be used during export. You can review SAP note 73606 to identify which code page is required for this language
    Best regards

  • Problem in Triggering the Mail to SAP Inbox

    Dear Experts,
                     I have a problem for triggering the Mail option to SAP Inbox.
    We created a Job assigning the program RSEIDOCA,RSWUWFML2 by creating a variant for those programs. We are scheduling the job,  It is showing as
    24.11.2010 12:43:46 Job started                                                                     00           516          S
    24.11.2010 12:43:46 Step 001 started (program RSEIDOCA, variant ZRSEIDOCA, user ID__ )        00           550          S
    24.11.2010 12:43:48 Error situation found by evaluation                                             E0           596          S
    24.11.2010 12:43:48 Step 002 started (program RSWUWFML2, variant ZRSWUWFML2, user ID__)      00           550          S
    24.11.2010 12:43:49 Job finished                                                                    00           517          S
    But while checking in SOST, we are unable to see those mails. eventhough the user is unable to get those mail in SAP INBOX.
    I think, is there any authorization problem while triggering the mail for that particular user id.. Please tell me the solution, this is very high requirement for me.
    Thanks in Advance.
    Regards,
    Srini

    Hi Chandra,
              Thanks for your reply. Actually i am not workflow consultant, thats why i asking this question. Where to assign the Receipient Type and Recipient Notification.
    you give Recipient Type as position and Recipient of Notification must be position of the reciepient,
    Regards,
    Srini

  • Sample code to send a mail from SAP

    Hi guys
    could any one provide me with the
    sample code to send a mail from SAP with text as the main body of that mail via bcs classes

    Hi,
         Please go through this code: U can send mail;
    Tables : zchp_cust-info.
    DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
    DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
    DATA: DOC_CHNG LIKE SODOCCHGI1.
    DATA: ENTRIES LIKE SY-TABIX.
    DATA: NAME(15).
    DATA: CON_NAME(20).
    DATA: req_num like zchp_cust_info.
    DATA: I_TAB_CHP LIKE ZCHP_CUST_INFO OCCURS 0 WITH HEADER LINE.
    *data: reno like ZCHP_CUST_INFO-req_num value .
    data input for the mail
    select * from zchp_cust_info
    appending table i_tab_chp where req_num = c_knumv.
    LOOP AT I_TAB_CHP.
    concatenate i_tab_chp-created_by i_tab_chp-req_num into CON_NAME.
    *WRITE: / con_name.
    ENDLOOP.
    Fill the document
    DOC_CHNG-OBJ_NAME = 'Refe'.
    DOC_CHNG-OBJ_DESCR = 'TESCRA Ref Number !'.
    DOC_CHNG-SENSITIVTY = 'P'.
    *OBJCONT = 'Tescra'.
    OBJCONT = CON_NAME.
    APPEND OBJCONT.
    OBJCONT = con_name.
    APPEND OBJCONT.
    DESCRIBE TABLE OBJCONT LINES ENTRIES.
    READ TABLE OBJCONT INDEX ENTRIES.
    DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).
    Fill the receiver list
    CLEAR RECLIST.
    RECLIST-RECEIVER = SY-UNAME.  " replace with <login name>
    RECLIST-REC_TYPE = 'B'.
    RECLIST-EXPRESS = 'X'.
    APPEND RECLIST.
    CLEAR RECLIST.
    RECLIST-RECEIVER = 'sapuser'.
    RECLIST-REC_TYPE = 'U'.
    APPEND RECLIST.
    Send the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_TYPE  = 'RAW'
              DOCUMENT_DATA  = DOC_CHNG
              PUT_IN_OUTBOX  = 'X'
         TABLES
              OBJECT_CONTENT = OBJCONT
              RECEIVERS      = RECLIST
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
                   DOCUMENT_NOT_SENT          = 2
                  OPERATION_NO_AUTHORIZATION = 4
                   OTHERS                     = 99.
        CASE SY-SUBRC.
          WHEN 0.
            LOOP AT RECLIST.
              IF RECLIST-RECEIVER = SPACE.
                NAME = RECLIST-REC_ID.
              ELSE.
                NAME = RECLIST-RECEIVER.
              ENDIF.
              IF RECLIST-RETRN_CODE = 0.
                WRITE: / NAME, ': succesfully sent'.
              ELSE.
                WRITE: / NAME, ': error occured'.
              ENDIF.
            ENDLOOP.
          WHEN 1.
            WRITE: / 'Too many receivers specified !'.
          WHEN 2.
            WRITE: / 'No receiver got the document !'.
          WHEN 4.
            WRITE: / 'Missing send authority !'.
          WHEN OTHERS.
            WRITE: / 'Unexpected error occurred !'.
        ENDCASE.
    <b>Please provide points if the issue is solved.</b>
    Regards,
    Sunil

  • 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

  • How will we send smtp mail from SAP via Exchange

    Hi;
    We changed SAP OS between Windows and Linux and still 4.6c . Now we use linux OS.
    We used smtp mail at SAP via Exchange with 3.party (sendmail,indigomail etc.) But Now I dont know how will we send smtp mail from SAP.
    Please help me,
    Thanks for answers.
    Moderator message: not directly related to ABAP development, please have look in the Netweaver forums, also search for available information on sending emails.
    Edited by: Thomas Zloch on Nov 22, 2010 2:39 PM

    Hi,
    What is the nature of the URL you wish to include in the e-mail ?
    Is it fixed or dynamic ?
    Cheers
    Colin.

  • To send outbound mails from SAP

    Hi team,
    Here i need to configure email setting from SAP to any other email ID ( yahoo,gmail etc).For this configuration do i need to confgure any program or to genrate some RFC settings.
    Can some one guide me the process step by step what to be done to send outbound mails from SAP. Immediate help will be really appreciated.
    thanks in advance.

    Check note 455140 - Configuration of e-mail, fax, paging or SMS using SMTP
    Markus

  • Problem while dowloading the file from Application Server

    Dear Experts,
                 I am facing the Problem while downloading the file from Application server.
    We done the automatic function while saving the invoice, this will create an idoc, and this idoc is written in the Application Server.
    I am running the Transaction AL11 and select the record, and from menu --> List, i am downloading into TXT format.
    But for some segments, the length is long, and so the last 3 to 4 fields values are not appearing in the File. Even though i am unable to view the values in the file before downloading. But i can view in IDOC.
    Please help me to solve this issue.
    Thanks & Regards,
    Srini

    but our user will use the Txn. AL11 and they will download from there
    Educate the user On a serious note, tell him this is not how data from app server should be downloaded. You can ask him to talk to the basis team to provide him access to the app server folder where the file is being stored.
    I can set the Variant and put this in background, But always the file name will be change, Like we use Time stamp in the File name.
    You can't automate this process by scheduling in BG mode. This is because the in BG mode you can't dwld the file to presentation server.
    Hope i'm clear.
    BR,
    Suhas

  • Facing a Problem while downloading the data from ALV Grid to Excel Sheet

    Hi Friends,
    Iam facing a problem while downloading the data from ALV Grid to excel sheet. This is working fine in Development server , when comes to Quality and Production servers I have this trouble.
       I have nearly 11 fields in ALV Grid and out of which one is PO number of length 10 , all the ten numbers are visible in the excel sheet if we download it from development server but when we download it from Quality or Production it is showing only 9 numbers.
    Can any one help me out in this case.

    hi...
    if this problems happens dont display the same internal as u finally got.
    just create new internal table without calling any standard data elements and domains... but the new internal table s similar like ur final internal table and move all the values to new int table.
    for eg.
    ur final internal int table for disp,
         data : begin of itab occur 0,
                        matnr like mara-matnr,
                   end of itab.
    create new like this,
               data : begin of itab occur 0,
                        matnr(12) type N,
                   end of itab.

  • User not able to send the mail from other mail box on outlook 2007

    In my outlook(2007), i am using my mail box to send the mail and receiving the mail every thing working fine, now what happened , i am adding one of my users mail box to my outlook profile,and trying to send the mail from that mail box,when ever
    i am trying to send its give me the message called message undelivered  and permission error. as i am full permission on that users mail box. but still getting that issue.
    My lab info
    Exchange server 2010 sp3
    outlook 2007

    HI Paul,
    In exchange, you have something called Send as permission as well. Try to give send as permission to your self from the user's mailbox.
    In exchange> Reciepient config> Mailboxes> user mailbox> right click> Full Send as permssion
    or,
    Add-ADPermission -Identity "user1" -User "[email protected]" -ExtendedRights Send-As
    After you add your self in send as permission you need to wait for some time to propagate the settings or you can forcefully reset the information store services
    That should solve your issue.
    UMESH DEUJA MCP,MCTS,MCSA,CCNA

  • Dreamweaver encountered problems while constructing the menus from the current menus.xml file

    So, after having trouble with my Photoshop scratch disk, I had to do an archive and install of my Mac OS 10.6.1 then reinstall the Adobe suite. I then had to run the Licensing Repair Tool (http://www.adobe.com/support/contact/licensing.html).
    Now everything works but Dreamweaver, which is throwing the following error:
    "Dreamweaver encountered problems while constructing the menus from the current menus.xml file.
    Please delete the current menus.xml file and rename menus.bak to menus.xml"
    I tried that. menus.bak is a directory, not a file. Even renaming the directory didn't work.
    I saw this http://forums.adobe.com/message/2188511#2188511
    but I don't have a /FlashPlayerTrust/ directory, nor do I see what that has to do with Dreamweaver.
    I couldn't find a corresponding solution for this http://forums.adobe.com/message/862339#862339 for the Mac OS.
    This http://forums.adobe.com/message/3396334#3396334 didn't help, either.
    Anybody have any ideas?
    Thanks!

    This is the error I got after deleting (moving) the configuration directory.
    "No document types have been found in the Configuration/DocumentTypes/ folder. The MMDocumentTypes.xml file may be missing or corrupted. The application will exit now."
    I've reinstalled the entire Adobe CS4 (which fixed my Photoshop problem but created this Dreamweaver problem) and then reinstalled Dreamweaver alone.
    I've also attached a screenshot of the Dreamweaver directory tree with the menus.xml files.

  • User couldn't recieve the mail from SAP SYSTEM

    Hi all experts,
    User couldn't recieve the mail from SAP SYSTEM since the Unicode changes were pushed ,
    how to fix the issue ?
    Thanks & Best regards,
    Michael

    Hi Michael,
    Is the SAPConnect configured as per note [455140|https://service.sap.com/sap/support/notes/455140] ?
    Since you are talking about receiving emails, do you see the emails in SOIN transaction (or report RSBCSIN)? Have you tried telnet directly to the SAPConnect plugin as described on note [607108|https://service.sap.com/sap/support/notes/607108]
    What is the value of parameter is/SMTP/virt_host_<*>?
    Regards,
    Tiago

  • Problem while sending a mail with smtp and ssl

    Hi all,
    I am new to java mail . I have downloaded one java program to send the mail. I have configured smt and port address.And my System firewall is also in off mode
    Still i am unable to send the mail
    The following code is my program import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.URLName;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import com.sun.mail.smtp.SMTPSSLTransport;
      To use this program, change values for the following three constants,
        SMTP_HOST_NAME -- Has your SMTP Host Name
        SMTP_AUTH_USER -- Has your SMTP Authentication UserName
        SMTP_AUTH_PWD  -- Has your SMTP Authentication Password
      Next change values for fields
      emailMsgTxt  -- Message Text for the Email
      emailSubjectTxt  -- Subject for email
      emailFromAddress -- Email Address whose name will appears as "from" address
      Next change value for "emailList".
      This String array has List of all Email Addresses to Email Email needs to be sent to.
      Next to run the program, execute it as follows,
      SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
    //private static final String SMTP_HOST_NAME = "smtp.mail.yahoo.com";
         private static final String SMTP_HOST_NAME = "smtp.gmail.com";
      private static final String SMTP_AUTH_USER = "admijn.ramd";
      private static final String SMTP_AUTH_PWD  = "hairamu";
      private static final int SMTP_PORT  = 465;
      private static final String emailMsgTxt      = "Online Order Confirmation Message. Also include the Tracking Number.";
      private static final String emailSubjectTxt  = "Order Confirmation Subject";
      private static final String emailFromAddress = "[email protected]";
      // Add List of Email address to who email needs to be sent to
      private static final String[] emailList = {"[email protected]", "[email protected]"};
      public static void main(String args[]) throws Exception
        SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
        smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
      public void postMail( String recipients[ ], String subject,
                                String message , String from)
           try{
        boolean debug = false;
         //Set the host smtp address
    //  Set the host smtp address
         Properties props = new Properties();
         props.put("mail.transport.protocol", "smtp");
         props.put("mail.smtp.port", SMTP_PORT);
         props.put("mail.smtp.starttls.enable","true");
         props.put("mail.smtp.host", SMTP_HOST_NAME);
         props.put("mail.smtp.auth", "true");
          props.put("mail.smtp.socketFactory.port", SMTP_PORT);
         props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
          props.put("mail.smtp.socketFactory.fallback", "false");
          SecurityManager security = System.getSecurityManager();
         Authenticator auth = new SMTPAuthenticator();
         Session session = Session.getDefaultInstance(props, auth);
         session.setDebug(debug);
         // create a message
         Message msg = new MimeMessage(session);
         // set the from and to address
         InternetAddress addressFrom = new InternetAddress(from);
         msg.setFrom(addressFrom);
         InternetAddress[] addressTo = new InternetAddress[recipients.length];
         for (int i = 0; i < recipients.length; i++) {
              addressTo[i] = new InternetAddress(recipients);
         msg.setRecipients(Message.RecipientType.TO, addressTo);
         // Setting the Subject and Content Type
         msg.setText(message);
         msg.setSubject(subject);
         msg.setContent(message, "text/plain");
         Transport.send(msg);
         }catch (MessagingException e) {
              // TODO: handle exception
              e.printStackTrace();
    * SimpleAuthenticator is used to do simple authentication
    * when the SMTP server requires it.
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
         try{
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    System.out.println("username "+ username+" Password"+password);
    return new PasswordAuthentication(username, password);
         }catch (Exception e) {
         return null;
    And i am getting the following exceptions
    javax.mail.MessagingException: Exception reading response;
      nested exception is:
         javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
         at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1611)
         at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
         at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
         at javax.mail.Service.connect(Service.java:310)
         at javax.mail.Service.connect(Service.java:169)
         at javax.mail.Service.connect(Service.java:118)
         at javax.mail.Transport.send0(Transport.java:188)
         at javax.mail.Transport.send(Transport.java:118)
         at com.FutureSoft.org.SendingMail.SendMailUsingAuthentication.postMail(SendMailUsingAuthentication.java:123)
         at com.FutureSoft.org.SendingMail.SendMailUsingAuthentication.main(SendMailUsingAuthentication.java:70)
    Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
         at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
         at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110)
         at java.io.BufferedInputStream.fill(Unknown Source)
         at java.io.BufferedInputStream.read(Unknown Source)
         at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:88)
         at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1589)
         ... 9 more                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    hi neuro11
    the following code is for sending mail its is working fine in my system, just change the
    SMTP_AUTH_USER = "tina.numi"; with u r email user name
    SMTP_AUTH_PWD = "abdcde"; u r gmail password
    emailFromAddress = "[email protected]"; ur gmail addres
    emailList = {"[email protected]"}; receipient list .
    and u must sure that u r internet is on and firewall should be off . some times firewall restricts you to communicate with gmail port number
    Please make u r firewall off and source code is
    package com.FutureSoft.org.SendingMail;
    Some SMTP servers require a username and password authentication before you
    can use their Server for Sending mail. This is most common with couple
    of ISP's who provide SMTP Address to Send Mail.
    This Program gives any example on how to do SMTP Authentication
    (User and Password verification)
    This is a free source code and is provided as it is without any warranties and
    it can be used in any your code for free.
    Author : Sudhir Ancha
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.URLName;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import com.sun.mail.smtp.SMTPSSLTransport;
      To use this program, change values for the following three constants,
        SMTP_HOST_NAME -- Has your SMTP Host Name
        SMTP_AUTH_USER -- Has your SMTP Authentication UserName
        SMTP_AUTH_PWD  -- Has your SMTP Authentication Password
      Next change values for fields
      emailMsgTxt  -- Message Text for the Email
      emailSubjectTxt  -- Subject for email
      emailFromAddress -- Email Address whose name will appears as "from" address
      Next change value for "emailList".
      This String array has List of all Email Addresses to Email Email needs to be sent to.
      Next to run the program, execute it as follows,
      SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
    //private static final String SMTP_HOST_NAME = "smtp.mail.yahoo.com";
         private static final String SMTP_HOST_NAME = "smtp.gmail.com";
      private static final String SMTP_AUTH_USER = "tina.numi";// gmail username
      private static final String SMTP_AUTH_PWD  = "abdcde";// gmail password
      private static final int SMTP_PORT  = 465;
      private static final String emailMsgTxt      = "Online Order Confirmation Message. Also include the Tracking Number.";
      private static final String emailSubjectTxt  = "Order Confirmation Subject";
      private static final String emailFromAddress = "[email protected]";// gmail id
      // Add List of Email address to who email needs to be sent to
      private static final String[] emailList = {"[email protected]"};
      public static void main(String args[]) throws Exception
        SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
        smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
      public void postMail( String recipients[ ], String subject,
                                String message , String from)
           try{
        boolean debug = false;
         //Set the host smtp address
    //  Set the host smtp address
         Properties props = new Properties();
         props.put("mail.transport.protocol", "smtp");
         props.put("mail.smtp.port", SMTP_PORT);
         props.put("mail.smtp.starttls.enable","true");
         props.put("mail.smtp.host", SMTP_HOST_NAME);
         props.put("mail.smtp.auth", "true");
          props.put("mail.smtp.socketFactory.port", SMTP_PORT);
         props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
          props.put("mail.smtp.socketFactory.fallback", "false");
          SecurityManager security = System.getSecurityManager();
         Authenticator auth = new SMTPAuthenticator();
         Session session = Session.getInstance(props, auth);
         session.setDebug(debug);
         // create a message
         Message msg = new MimeMessage(session);
         // set the from and to address
         InternetAddress addressFrom = new InternetAddress(from);
         msg.setFrom(addressFrom);
         InternetAddress[] addressTo = new InternetAddress[recipients.length];
         for (int i = 0; i < recipients.length; i++) {
              addressTo[i] = new InternetAddress(recipients);
         msg.setRecipients(Message.RecipientType.TO, addressTo);
         // Setting the Subject and Content Type
         msg.setText(message);
         msg.setSubject(subject);
         msg.setContent(message, "text/plain");
         Transport t = session.getTransport("smtps");
         try {
              t.connect(SMTP_HOST_NAME, SMTP_AUTH_USER, SMTP_AUTH_PWD);
              t.sendMessage(msg, msg.getAllRecipients());
         catch(Exception e){}
         finally
              t.close();
         }catch (MessagingException e) {
              // TODO: handle exception
              e.printStackTrace();
    * SimpleAuthenticator is used to do simple authentication
    * when the SMTP server requires it.
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
         try{
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    System.out.println("username "+ username+" Password"+password);
    return new PasswordAuthentication(username, password);
         }catch (Exception e) {
         return null;
    try this . all the best

Maybe you are looking for