How to send the error file as a attachment

Hi All,
Is it possible to send a mail by attaching the error file.
I am writing the code in the events,if import failed then i need to send the mail with import failed error file as an attachment.
Thanks.

In your mail code, include something like the following prior to the .Send command. strAttach is the path to the Attachment:
If Not strAttach="" Then' Attach file(s) to message
     Set fso = CreateObject("Scripting.FileSystemObject")
     If fso.FileExists(strAttach) Then .AddAttachment strAttach
     Set fso = Nothing
End If

Similar Messages

  • How to send the PDF file to FAX will the nast table updates

    Hi all,
    How to send the PDF file to FAX. Will the nast table updates ( which fields updates ).
    Need is once fax is send for that delivery, again it should not fax again. Will the nast table helps to check the sent fax.
    Please give me sutable suggessions....

    Have you checked Forums » Community Discussions » Code Snippets 
    I believe there were some examples on converting/sending PDF.
    Or check FM 'SO_DOCUMENT_SEND_API1' and documentation for it.

  • How to send the pdf file....

    How to send the pdf file which is an outpu of smart form to sap users.
    How to delete the pdf file as soon as it was sent.

    Have you checked Forums » Community Discussions » Code Snippets 
    I believe there were some examples on converting/sending PDF.
    Or check FM 'SO_DOCUMENT_SEND_API1' and documentation for it.

  • How to send the Error notification

    Hi,
      Hi,
         I am having the one scenario like , i send the one record to destination using outbound that time i stored in one table sent time and date and they are send the ACK to me that time i update the table with receiving time and date using inbound program but now this enhancement is to check the receiving time and sent time if it more than 5 hrs i need to send the Error notification this process is doing every 15minst in background mode please suggest in this issue.
    Thanks,
    Harinath

    Hey
    please have a look at the following
    How to trigger alert in XI from a connected SAP R/3 4.7 system
    Thanx
    Aamir

  • How to send the Adobe page as mail attachement from webdynpro...

    Hi Experts,
    How to send the Adobe page as external mail attachment from webdynpro automatically (for example: If I input the data for sales order in a view and created the sales order, if the sales order is created then have to place the created sales order number and the some details in a adobe form and should send as external mail and have to specifying the body as "Sales order created and details can be found in the attached adobe form" from webdynpro).
    Do the needful.
    Thanks & regards,
    Ravi.

    Hi ravi,
    See the WDA forum for the how to attach a file in webdynpro component for the attachments.

  • HOW to send the SPlitted files to multiple Receiver On some Condition ?

    Hi all,
    It's Urgent,
    Aim of our scenario
    the single file is splited according to company code and creates as separate file
    previously it was sending to same server..
    we have got the CHANGE REQUEST ON THIS SCENARIO that to route to TWO FTP servers which is splitting according to company code.
    But we are not changing any objects in IR
    we have only need to change in ID
    as now we are using on BUSINESS SERVICE which we have created in ID itself we are not using the BUSINESS SYSTEM created in SLD
    We are using ONLY one INBound interface , Interface MApping , Message MAPPing .(no cahnges in IR)
    Sender XML Structure
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    <ns1:MT_FileEwadCompany occurence1-1
    xmlns:ns1="http://bridgegcs.com/HR/EmployeeWorkforceAdminDataXI_IHR004">
    <COMPANYEWADDATA> 0 -unbound occurence
    <AUDIT_STAMP/>
    <SEQNO/>
    <SE_TYPE/>
    <RECNAME_AUDIT/>
    <FLD_NAME/>
    <OLDVALUE/>
    <NEWVALUE/>
    <KEY1/>
    <KEY2/>
    <KEY3/>
    <KEY4/>
    <COMPANY/>
    <SCE_PAYROLL_CODE/>
    <ALTER_EMPLID/>
    </COMPANYEWADDATA>
    </ns1:MT_FileEwadCompany>
    </ns0:Message1>
    </ns0:Messages>
    Receiver XML Structure
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    <ns1:MT_FileEwadCompany 0-to-unbound
    xmlns:ns1="http://bridgegcs.com/HR/EmployeeWorkforceAdminDataXI_IHR004">
    <COMPANYEWADDATA>0-unbound
    <AUDIT_STAMP/>
    <SEQNO/>
    <SE_TYPE/>
    <RECNAME_AUDIT/>
    <FLD_NAME/>
    <OLDVALUE/>
    <NEWVALUE/>
    <KEY1/>
    <KEY2/>
    <KEY3/>
    <KEY4/>
    <COMPANY/>
    <SCE_PAYROLL_CODE/>
    <ALTER_EMPLID/>
    </COMPANYEWADDATA>
    </ns1:MT_FileEwadCompany>
    </ns0:Message1>
    </ns0:Messages>
    IN Integration Directory We have to route to 2 FTP servers based on Company code .
    WE have used XPATH with particular company codes TO one target Business service which we have created in ID where we are using one FTP server(FTP server 1).
    For all other company codes it has to send to second FTP server for Second business system which has been created in SLD .
    previously they used INTERFACE DETERMINATION as ENHANCED TYPE
    IF we change to STANDARD its not DISPLAYING INTERFACE MAPPING in pop up window.
    As now we created now .
    One receiver determination
    Two Interface DETERMINATIONs(As enhanced type).
    Two REceiver Agreements.
    As now we have tested
    it is sending all files to both servers.
    But we need to send to specfied FTP servers on the basis of COmpany code which we declare in XPATH expression.
    could any one can guide us
    POINTS WILL BE REWARDED FOR BEST ANSWERS..It's urgent
    THanks in ADvance
    Nandan

    Hi nandan,
    u said that u r using
    1) business service for FTP1
    2)business system for FTP2
    u have given X-path condition in Rec determination...i.e depending upon the company code it will route to business service or business system .
    so i guess there should be two reciver determination
    2 interface dtermination
    And also check ur Xpath....make sure that its like....
    if (Comp code == 1)
    go to FTP1
    if (comp code == 2)
    go to FTP2
    regards
    biplab

  • How to resolve the error "File could not open" in AL11?

    Hi Friends,
    When I am going to write a file via DATASET.
    But it's showing me a error"File Could not Found"?
    And I am unable to check my fiel at AL11.
    Please suggest me the solutions.
    Regards
    Ricky

    Hi,
    Try this code
    TYPES : BEGIN OF ty_emp,
    empno(2) TYPE c,
    empid(10) TYPE c,
    empname(3) TYPE c,
    END OF ty_emp.
    DATA : it_emp TYPE TABLE OF ty_emp,
    wa_emp TYPE ty_emp.
    DATA : pbk TYPE string.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_file TYPE rlgrap-filename default 'D:\EMP.TXT'.
    PARAMETERS : p_asfile TYPE rlgrap-filename default 'EMP'.
    SELECTION-SCREEN END OF BLOCK b1.
    pbk = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = pbk
      FILETYPE                      = 'ASC'
    has_field_separator           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      = it_emp
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    OPEN DATASET p_asfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      LOOP AT it_emp INTO wa_emp.
        TRANSFER wa_emp TO p_asfile.
      ENDLOOP.
      CLOSE DATASET p_asfile.
    ==============================================
    Regards,
    Krrishna

  • How To send the text document as a attachment using a 'So_object_send'

    Hi,
    I want to send a mail to user in sap office.
    I had used a function module 'SO_OBJECT_SEND'.
    Also, I need to send all the attachments (like files .XLS,.TXT etc) in the mail as a attachment.
    Please tell me how to pass the attachment to the Function module 'So_object_send'.
    Thanks in advance
    Regards,
    Darshana

    You should use FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with attachments.
    Below is the code for your reference :
    Doc data
          WL_DOC_DATA-OBJ_NAME  = TEXT-031.          "Survey Data
          WL_DOC_DATA-OBJ_DESCR = TEXT-031.          "Survey Data
          WL_DOC_DATA-OBJ_LANGU = C_LANG_EN.         "E
    Receiver's details
          WL_RECEIVERS-RECEIVER  = ABCD AT XYZ DOT COM."l_survey_recipient_email.
          WL_RECEIVERS-REC_TYPE  = C_REC_TYPE.       "U
          WL_RECEIVERS-COM_TYPE  = C_COMM_TYP.       "INT
          WL_RECEIVERS-NOTIF_DEL = C_CHK.            "X
          WL_RECEIVERS-NOTIF_NDEL = C_CHK.           "X
          APPEND WL_RECEIVERS TO TL_RECEIVERS.
    Mail subject
          WL_HEADER-LINE = TEXT-036.                 "Mail
          APPEND WL_HEADER TO TL_HEADER.
          LOOP AT TL_EMAIL_TAB2 INTO WL_HEADER2.
            CONCATENATE  WL_HEADER2-MESSAGE  C_TAB INTO  L_STRING.
            CONCATENATE C_RET  L_STRING  INTO WL_OBJTXT-LINE SEPARATED BY SPACE.
            APPEND WL_OBJTXT TO TL_OBJTXT.
          ENDLOOP.                                   "LOOP AT tl_email_ta..
          DESCRIBE TABLE TL_OBJTXT LINES L_LINES.
          L_TMP = L_LINES * 255.
          MOVE L_TMP TO L_DOC_SIZE.
          CONDENSE L_DOC_SIZE.
          WL_PACK-HEAD_START  = 1.
          WL_PACK-HEAD_NUM    = 0.
          WL_PACK-BODY_START  = 1.
          WL_PACK-BODY_NUM    = L_LINES.
          WL_PACK-DOC_TYPE    = C_DOC_TYP.           "RAW
          WL_PACK-OBJ_LANGU   = C_LANG_EN.           "E
          WL_PACK-DOC_SIZE    = L_DOC_SIZE.
          APPEND WL_PACK TO TL_PACK.
    Call function module to send the email to the survey recipient
          CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            EXPORTING
              DOCUMENT_DATA              = WL_DOC_DATA
              PUT_IN_OUTBOX              = C_CHK     "X (Check)
              COMMIT_WORK                = C_CHK     "X (Check)
            TABLES
              PACKING_LIST               = TL_PACK
              OBJECT_HEADER              = TL_HEADER
              CONTENTS_TXT               = TL_OBJTXT
              RECEIVERS                  = TL_RECEIVERS
          IF SY-SUBRC = 0.
            SUBMIT RSCONN01 WITH MODE = 'INT'
                            WITH OUTPUT = 'X'
                            AND RETURN.
          ENDIF.
    Regards,
    NaPPy

  • How to send the Mail of shop papers attached to Service / PM order

    I would like to send the E-Mail of shop ppers which I am printing from Service order / Plant Maintenance order. How to do it?

    Hi Pete,
    Thanks for your valuable input. I have read the note, but it gives solution for notification. Is there any other note for orders (Service order or Plant Maintenance Order). .
    I would like to send the mail from orders (Service order or Plant Maintenance Order).
    Thank you

  • How to send an Html File as an Attachment tht has style included?

    Hi Friends,
    If anybody has sample code ...
    please post it here..

    Not sure what you're asking for but have you seen the sendhtml.java
    demo program included with JavaMail?

  • Problen when Sending the text file as attachment to the external mail

    HI,
    I am sending the text file as an attachment to a aexternal mai. mailing is going with text file attachment, but text file is empty. No information in the file is going, only empty text file is going. I am sending the code  iam using. Please suggest, if I need to change any passing parameters orany other other solution.
    tables: knb1,kna1,adr6,ITEMSET,bsid,TSP01.
               INTERNAL TABLES
    DATA: BEGIN OF it_kna1 occurs 0,
            KUNNR LIKE KNA1-KUNNR,
            ADRNR LIKE KNA1-ADRNR,
          END OF it_kna1.
    DATA: BEGIN OF it_email occurs 0,
            ADDRNUMBER LIKE ADR6-ADDRNUMBER,
            SMTP_ADDR LIKE ADR6-SMTP_ADDR,
          END OF it_email.
    DATA: BEGIN OF it_bsid occurs 0,
           KUNNR LIKE BSID-KUNNR,
           BUKRS LIKE BSID-BUKRS,
         END OF it_bsid.
    DATA: BEGIN OF it_final occurs 0,
            KUNNR LIKE KNA1-KUNNR,
            ADRNR LIKE ADR6-ADDRNUMBER,
            EMAIL LIKE ADR6-SMTP_ADDR,
          END OF it_final.
    DATA: BEGIN OF BUFFER OCCURS 10000,
              TEXT(255) TYPE C,
            END OF BUFFER.
    data:xtext type solix_tab." occurs 0 with header line."line.
    data:xi_pdf type soli_tab.
    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2  WITH HEADER LINE,
          OBJHEAD LIKE SOLISTI1   OCCURS 1  WITH HEADER LINE,
          OBJBIN  LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
          OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE,
          RECLIST LIKE SOMLRECI1  OCCURS 5  WITH HEADER LINE,
          DOC_CHNG  LIKE SODOCCHGI1,
         PARAMS   LIKE PRI_PARAMS,
         ARPARAMS LIKE ARC_PARAMS,
         DAYS(1)  TYPE N VALUE 8,
         COUNT(3) TYPE N VALUE 1,
         VALID    TYPE C,
         RECEIVER(30),
         STR(256).
    data:  spoolid    type tsp01-rqident,
           pdf_table like tline occurs 0 with header line,
           v_bytecount type i,
           itab_pdf like tline occurs 10 with header line,
          xi_pdf  like tline occurs 0 with header line,
          xi_pdf  like buffer occurs 0 with header line,
           xi_pdf_1 like xi_pdf,
           v_length(2) type p,
           html  like solisti1   occurs 0  with header line,
           xi_temp      like bapiqcmime occurs 0 with header line,
           xi_mime(255) type c occurs 0 with header line.
              VARIABLES
    data: g_email type adr6-smtp_addr,
          TAB_LINES LIKE SY-TABIX,
          G_FLAG(1) TYPE C.
         g_norm(1) TYPE C,
         g_shbv(1) TYPE C,
         g_merk(1) TYPE C,
         g_park(1) TYPE C,
         g_apar(1) TYPE C.
    data: l_lines     type i,
          line1       type i,
          l_temp(500) type c,
          l_offset    type p,
          l_lineslen(2) type p,
          l_mimelen(2)  type p,
          v_spono like tsp01-rqident,
          l_tabix       like sy-tabix.
    *****VIA SELECTION-SCREEN
    ENDFORM.                    " SEND_TO_SPOOL
    *&      Form  GET_SPOOL_ID
    *&      Form  CONVERT_SPOOL_TO_PDF
    *&      Form  SEND_MAIL
    FORM SEND_MAIL .
      data:l_lin  like sy-tabix,
            l_lint like sy-tabix,
            it_list like abaplist occurs 0,
            l_newline(2) type x value '0D0A'.
    *--Data for the status output after sending
      data: user_address like sousradri1 occurs 1 with header line,
            sent_to_all like sonv-flag.
      clear: reclist, reclist[],
             objtxt , objtxt[],
             objpack, objpack[],
             objbin , objbin[],
             doc_chng.
    *--move list to office table objbin
    *--Start of Changes to support PDF attachments - UB20030116
    loop at html.
       objbin-line = html-line.
       append objbin.
       clear objbin.
    endloop.
    loop at xi_pdf.
       objbin-line = xi_pdf-text.
       append objbin.
       clear objbin.
    endloop.
    *--We may write additional text to the main document
    *--For faxing this will be the cover page. Like sending from SAPoffice
    *--the layout set Office-Telefax will be used.
      objtxt-line = 'NOTE : Please Consider the below Headers'.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Assignment -->  Purchase order number '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Document  -->   Invoice No '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Amount In DC --> Amount Due '.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Please find attached statement for this week'.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'This is an AUTO GENERATED MAIL'.
      concatenate objtxt-line 'Please Do not reply to this mail' into
      objtxt-line separated by ' '.
      append objtxt.
      clear objtxt.
      describe table objtxt lines tab_lines.
      read table objtxt index tab_lines.
    *--Create the document which is to be sent
    doc_chng-obj_name  = 'List'.
      doc_chng-obj_name = 'SAPRPT'.
    doc_chng-obj_descr = 'Customer statement for the week'.
      concatenate 'Customer statement for '
                  sy-datum into
                  doc_chng-obj_descr
                  separated by ' '.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
    *--Fill the fields of the packing_list for the main document:
    *--It is a text document
      clear objpack-transf_bin.
    *--The document needs no header (head_num = 0)
      objpack-head_start = 1.
      objpack-head_num = 0.
    *--but it has a body
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
    *--of type RAW
      objpack-doc_type = 'RAW'.
      append objpack.
    *--Create the attachment (the list itself)
      describe table objbin lines tab_lines.
    *--Fill the fields of the packing_list for the attachment:
    *--It is binary document
    objpack-transf_bin = 'X'.
    *--we need no header
      objpack-head_start = 1.
      objpack-head_num = 0.
    *--but a body
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
    *--of type G_DOC_TYPE
    objpack-doc_type = 'PDF'. "commented on 12/13/2007
      objpack-doc_type = 'TXT'. "commented on 12/13/2007
      objpack-obj_name = 'Attachment'.
    objpack-obj_descr = 'Customer Statement'.
      concatenate 'Customer Statement' sy-datum into objpack-obj_descr.
      objpack-doc_size = tab_lines * 255.
      append objpack.
      reclist-receiver = g_email.
      reclist-rec_type = 'U'.
    reclist-com_type = 'FAX'.
      append reclist.
      data:xi type soli.
    xi-line = 'haisdgsfsdf'.
    append xi to xi_pdf.
    xi-line = 'haisdfdsfd'.
    append xi to xi_pdf.
    xi-line = 'haisfgsdfsd'.
    append xi to xi_pdf.
    xi-line = 'haisdfsgfsdgg'.
    append xi to xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
        EXPORTING
          ip_solitab        = xi_pdf[]
       IMPORTING
         EP_SOLIXTAB       = xtext[].
    **--Send the document by calling the SAPoffice API1 module for sending
    **--documents with attachments
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
          PUT_IN_OUTBOX              = 'X'
         COMMIT_WORK                = 'X'
        IMPORTING
          sent_to_all                = sent_to_all
        TABLES
          packing_list               = objpack
          object_header              = objhead
         contents_bin               = objbin
          contents_txt               = objtxt
          contents_hex               = xtext
          receivers                  = reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          others                     = 99.

    HI,
    There are lots of bugs.
    Please refer this sample program to fix it.
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Best regards,
    Prashant

  • How to send the report output to the application server in a excel file

    Hello,
    how to send the report output to the application server in a excel file.
    and the report runs in background.
    Thanks in advance.
    Sundeep

    Dear Sundeep.
    I'm providing you with the following piece of code ... Its working fine for me ... hopefully it suits your requirement ...
    D A T A D E C L A R A T I O N *
    TYPES: BEGIN OF TY_EXCEL,
    CELL_01(80) TYPE C,
    CELL_02(80) TYPE C,
    CELL_03(80) TYPE C,
    CELL_04(80) TYPE C,
    CELL_05(80) TYPE C,
    CELL_06(80) TYPE C,
    CELL_07(80) TYPE C,
    CELL_08(80) TYPE C,
    CELL_09(80) TYPE C,
    CELL_10(80) TYPE C,
    END OF TY_EXCEL.
    DATA: IT_EXCEL TYPE STANDARD TABLE OF TY_EXCEL,
    WA_EXCEL TYPE TY_EXCEL..
    E V E N T : S T A R T - O F - S E L E C T I O N *
    START-OF-SELECTION.
    Here you populate the Internal Table.
    Display - Top of the Page.
    PERFORM DISPLAY_TOP_OF_PAGE.
    E V E N T : E N D - O F - S E L E C T I O N *
    END-OF-SELECTION.
    SET PF-STATUS 'GUI_STATUS'.
    E V E N T : A T U S E R - C O M M AN D *
    AT USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'EXPORT'.
    Exporting the report data to Excel.
    PERFORM EXPORT_TO_EXCEL.
    ENDCASE.
    *& Form DISPLAY_TOP_OF_PAGE
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_TOP_OF_PAGE .
    SKIP.
    WRITE: /05(128) SY-ULINE,
    /05 SY-VLINE,
    06(127) 'O R I C A'
    CENTERED COLOR 1,
    132 SY-VLINE.
    WRITE: /05(128) SY-ULINE,
    /05 SY-VLINE,
    06(127) 'Shift Asset Depreciation - Period/Year-wise Report.'
    CENTERED COLOR 4 INTENSIFIED OFF,
    132 SY-VLINE.
    WRITE: /05(128) SY-ULINE.
    E X C E L O P E R A T I O N
    CLEAR: IT_EXCEL[],
    WA_EXCEL.
    PERFORM APPEND_BLANK_LINE USING 1.
    WA_EXCEL-cell_02 = ' XYZ Ltd. '.
    APPEND WA_EXCEL TO IT_EXCEL.
    CLEAR: WA_EXCEL.
    WA_EXCEL-cell_02 = 'Shift Asset Depreciation - Period/Year-wise Report.'.
    APPEND WA_EXCEL TO IT_EXCEL.
    PERFORM APPEND_BLANK_LINE USING 1.
    ENDFORM. " DISPLAY_TOP_OF_PAGE
    *& Form APPEND_BLANK_LINE
    text
    -->P_1 text
    FORM APPEND_BLANK_LINE USING P_LINE TYPE I.
    DO P_LINE TIMES.
    CLEAR: WA_EXCEL.
    APPEND WA_EXCEL TO IT_EXCEL.
    enddo.
    ENDFORM.
    *& Form EXPORT_TO_EXCEL
    text
    --> p1 text
    <-- p2 text
    FORM EXPORT_TO_EXCEL .
    DATA: L_FILE_NAME(60) TYPE C.
    Create a file name
    CONCATENATE 'C:\' 'Shift_Depn_' SY-DATUM6(2) '.' SY-DATUM4(2)
    '.' SY-DATUM+0(4) INTO L_FILE_NAME.
    Pass the internal table (it_excel which is already populated )
    to the function module for excel download.
    CALL FUNCTION 'WS_EXCEL'
    exporting
    filename = L_FILE_NAME
    tables
    data = IT_EXCEL
    exceptions
    unknown_error = 1
    others = 2.
    if sy-subrc <> 0.
    message e001(ymm) with 'Error in exporting to Excel.'.
    endif.
    ENDFORM. " EXPORT_TO_EXCEL
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    When you click the button - Export to Excel ( GUI-Status) you'll be able to export the content of the Internal Table to an Excel file .......
    Regards,
    Abir
    Don't forget to award Points *

  • How to write the errors into a specific file

    Hi all,
    How to handled the errors in the scenarios,By using fault messages we can informed about errors to sender.But in my case i have to gather all errors & write into a specific file.For this can i create another Communication Channel for File reciever.How can i gather error messages in the scenario.
    Early response is appreciate

    Hi,
    Bhavesh had already answered how to handle it. For saving it in a file yes you can use File Receiver adapter.
    Regards,
    Prakash

  • How to send the file contents in the application server to ftp server

    Hi,
    how to send the file contents in the application server to ftp server.
    regards,
    sree

    Test SAP FTP functions
    DATA: BEGIN OF MTAB_DATA OCCURS 0,
    LINE(132) TYPE C,
    END OF MTAB_DATA.
    DATA: MC_PASSWORD(20) TYPE C,
    MI_KEY TYPE I VALUE 26101957,
    MI_PWD_LEN TYPE I,
    MI_HANDLE TYPE I.
    START-OF-SELECTION.
    MC_PASSWORD = 'password'.
    DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.
    *-- FTP_CONNECT requires an encrypted password to work
    CALL 'AB_RFC_X_SCRAMBLE_STRING'
         ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY
         ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD
         ID 'DSTLEN' FIELD MI_PWD_LEN.
    CALL FUNCTION 'FTP_CONNECT'
         EXPORTING
           USER            = 'userid'
           PASSWORD        = MC_PASSWORD
           HOST            = 'servername'
           RFC_DESTINATION = 'SAPFTP'
         IMPORTING
           HANDLE          = MI_HANDLE
         EXCEPTIONS
           NOT_CONNECTED   = 1
           OTHERS          = 2.
    CHECK SY-SUBRC = 0.
    CALL FUNCTION 'FTP_COMMAND'
         EXPORTING
           HANDLE = MI_HANDLE
           COMMAND = 'dir'
         TABLES
           DATA = MTAB_DATA
         EXCEPTIONS
           TCPIP_ERROR = 1
           COMMAND_ERROR = 2
           DATA_ERROR = 3
           OTHERS = 4.
    IF SY-SUBRC = 0.
      LOOP AT MTAB_DATA.
        WRITE: / MTAB_DATA.
      ENDLOOP.
    ELSE.
    do some error checking.
    ENDIF.
    CALL FUNCTION 'FTP_DISCONNECT'
         EXPORTING
           HANDLE = MI_HANDLE
         EXCEPTIONS
           OTHERS = 1.
    Execute external commands (FTP Scripts)
    The following code shows the syntax of the FM 'SXPG_COMMAND_EXECUTE'. You pass it the external command created within transaction SM69 and it will execute it.
    DATA: ld_comline 
    LIKE sxpgcolist-name,
            ld_param    LIKE sxpgcolist-parameters,
            ld_status   LIKE extcmdexex-status,
            ld_output   LIKE btcxpm OCCURS 0 WITH HEADER LINE,
            ld_subrc    LIKE sy-subrc.
      REFRESH ld_output.
      MOVE 'FTP_DATA_IN' to ld_comline.         "Maintained using trans SM69
    Execute external command, contained in 'ld_comline'
      CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
           EXPORTING
                commandname                   = ld_comline
              additional_parameters   = ld_param  "Params passed to script
              operatingsystem              
    = 'UNIX'
           IMPORTING
                status                        = ld_status
           TABLES
                exec_protocol                 = ld_output
           EXCEPTIONS
                no_permission
                     = 1
                command_not_found
                 = 2
                parameters_too_long          
    = 3
                security_risk                
    = 4
                wrong_check_call_interface    = 5
                program_start_error           = 6
                program_termination_error     = 7
                x_error                       = 8
                parameter_expected            = 9
                too_many_parameters           = 10
                illegal_command               = 11
                wrong_asynchronous_parameters = 12
                cant_enq_tbtco_entry
              = 13
                jobcount_generation_error
         = 14
                OTHERS                       
    = 15.
      IF sy-subrc NE 0.
      ENDIF.

  • How to send the entire binary file as Content in mail adapter

    Hi,
    I have the below scenario:
    A binary file is there on the XI server and this is more than 1 lines.
    This file needs to be sent across to certain email addresses via the XI interface.
    I have made the design and config and now get the the mail but so far not been able to get the file contents.
    The requiremnet is to send the entire file contents in the mail so that they appear in the body of the received mail.
    How do i do it?
    Can you please advice.
    Regards,
    Archana

    Hi,
    I am giving below the incoming mesasge details and the outgoing Mail message details.
    Sender File Adapter:
    Mesasge Content/Payload:
      <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MT_Ack_Mail_In xmlns:ns="Urn:Serco-com:interface:Banking:HSBC:FileTransfer">
    - <Content>
    - <Mail>
      <Details>UNBUNOA:3HEXAGON-ABCABC10268002081201:2152+692125127893</Details>
      </Mail>
    - <Mail>
      <Details>UNH1CONTRL:2:2:UN:APACS</Details>
      </Mail>
    - <Mail>
      <Details>UCI1000246720ABC10268002HEXAGON-ABC4+C09</Details>
      </Mail>
    - <Mail>
      <Details>UNT31</Details>
      </Mail>
    - <Mail>
      <Details>UNZ1692125127893</Details>
      </Mail>
      </Content>
      </ns:MT_Ack_Mail_In>
    Receiver Mail Adapter:
    Message Content/Payload:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
      <Subject>ME-Acknowledgement</Subject>
      <From>email of from</From>
      <To>my email</To>
      </ns1:Mail>
    I need to map the contents of the incoming payload Contents/Mail/Details (all the 5 instance) to outgoing Missing Content (after To field).
    If it can be in Mail body, then it would be best else please suggest what other option can I use?
    Also, If i want the file name to be in the subject of the mail, is that possible to be picked up in the configuration?
    Please help.
    Regards,
    Archana

Maybe you are looking for

  • How do you make drop caps in Pages?

    Word has a drop down in the Format column that give you an ap to make drop caps... like at the beginning of a chapter. How do you do it in Pages?

  • My ipod is grrr broke i think

    My computer just crashed when i was transferring songs to my ipod mini and when i unplugged my ipod and turned it on all that comes up is the apple logo and then after a short while a folder with an exclamation mark.I have done the 5 r's(or whatever

  • Google maps in UAE App store

    Anyone know when it's going to be available for download?

  • How to tell Firefox "Okay for THIS site to redirect"?

    Websites for huge, bureaucratic corporations sometimes try to redirect the browser to other pages. How do I tell Firefox that this is okay -- for a particular website?

  • Pacman won't use community repository [solved, my bad]

    I enabled the community section in /etc/pacman.conf, but when I so a pacman -Sy, it doesn't download from the community repo, and pacman -S commands to community packages fail. Here's my /etc/pacman.conf file: # /etc/pacman.conf # See the pacman manp