How to send original filename as the attachment name through mail adapter?

Hi,
I have a File to Mail scenario where the file is picked up from a folder in R/3 system and is sent as an attachment through mail. The requirement is to send the file unconverted and with the same file name.
When tried without creating any ESR objects, it was sending the file with the name Untitled.xml.
Since the filename has to be picked dynamically, I am not able to configure it through module parameters also (where we can set it through Content_Disposition)
I tried configuring it as mentioned in the following link: [http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=138084630]
But still it is going as Untitled.xml with the whole mail package as the content of the attachment.
Any pointers to solve this issue will be of great help.
Thanks
Justin

there is no standard way so you will  have to write module beans.
in other way:
XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping - XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
Dynamic name in the mail attachment - pseudo "variable substitution" :
XI: Dynamic name in the mail attachment - pseudo "variable substitution"
Dynamic attachment name in receiver mail adapter

Similar Messages

  • How to send file with original name through Mail adapter

    I have to send file with original name as attachment through Mail Adapter. I am picking the file from FTP server through File Adapter. I am not using message mapping because files do not have any standard format.

    Hi,
    Have you solve your problem ?...
    I have exactly the same scenario : pik up a file (file adapter) and send it in attachment by mail adapter without mapping (no IR)...
    I activated Adapter specific paramters properties in the File adapter sender and i can see the FileName tag in DynamicConfiguration section of SoapHeader in SXMB_MONI...
    I want to use MessageTransformationBean... BUT, how can i 'access' to FileName tag ???...
    Thanks...
    I setup modules like this :
    AF_Modules/DynamicConfigurationBean 1
    AF_Modules/MessageTransformBean rename
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean mail
    1 key.0 write http://sap.com/xi/XI/System/File FileName
    1 value.0 message.FileName
    rename Transform.ContentDisposition attachment;filename=message.FileName
    rename Transform.ContentDescription message.FileName
    rename Transform.ContentType application/csv-tab-delimited-table;name=message.FileName
    But my file name attachment is message.FileName....
    Edited by: Emmanuel JORAND on Sep 29, 2008 9:23 PM
    Edited by: Emmanuel JORAND on Sep 29, 2008 10:25 PM

  • Setting dynamic attachment name in mail adapter

    Hi experts,
    I have a mail adapter that send e-mails from ECC to several address.
    I have configured dynamically the FROM and TO field using the code showed below in message mapping:
    public String SetMailParameters(String Mail_address_to, Container container){
       //write your code here
      String valueFrom = "my_address";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "THeaderFROM");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "THeaderTO");
    conf.put(key1, valueFrom);
    conf.put(key2, Mail_address_to);
      return  "";
    In communication channel I have checked ASMA and variable transport binding (using XHeaderName1 and 2), mail package is not checked.
    It works fine!
    My question is:
    I need to dynamically configure also the Attachment name: is it possible?
    I've tried adding the code below:
    DynamicConfigurationKey key3 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(key3,Attachment_name);
    and also
    Transform.ContentDisposition      attachment;filename=<FileName>
    in Message TransformBean in communication channel, but it doesn't work!!!
    Any idea?
    Thanks
    Fabio Boni

    Hi,
    thanks a lot!!
    ASMA and variable transport binding must be checked or not?
    it raise an error in runtime workbench message monitoring:
    2010-09-02 17:41:15 Success Mail: calling the adpter for processing
    2010-09-02 17:41:15 Error Mail: call failed; com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {'}Content_Disposition at state 1
    2010-09-02 17:41:15 Success Mail: sending a delivery error ack ...
    2010-09-02 17:41:15 Success Mail: sent a delivery error ack
    2010-09-02 17:41:15 Error Mail: error occured: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {'}Content_Disposition at state 1
    2010-09-02 17:41:15 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1
    2010-09-02 17:41:15 Error Exception caught by adapter framework: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1
    2010-09-02 17:41:15 Error Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1.
    This is my message in message monitoring:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
      <Content_Disposition>"attachment; filename="MyFileName.txt"</Content_Disposition>
      <Content>ZLF;0001000079;Dealer Motors UK</Content>
      </ns1:Mail>
    In message mapping with target message mail package I've linked Content_Disposition with the constant
    "attachment; filename="MyFileName.txt"
    If I cancel this relation the mail arrives correctly.
    One other thing: when I took mail.xsd from SAP the fields Content_Disposition and Content_Description weren't in, so I added them manually in XSD.
    thanks
    Edited by: Fabio Boni on Sep 2, 2010 5:42 PM
    Edited by: Fabio Boni on Sep 2, 2010 6:06 PM

  • Change attachment name using mail adapter

    Hi All,
    I have a problem changing the attachment name in my scenario. I use Mail scenario to send a pdf Attachment from R/3 to email address. Everything working fine except the attachment name that becoming untitled.pdf and untitled.txt.
    Communication Channel setting :
    message protocol : xipayload
    transport protocol : smtp
    checked use mail package
    checked keep attachment
    I have use MessageTransformBean in my receiver adapter, but no luck. It was produce an error.
    anyone have an idea to solve my problem?
    thx,
    Robby

    Hi,
    You need to go to the Module tab of the Mail adapter receiver communcation channel and give the parameter as Transform.contentDisposition and its value as attachment ( since you needed the output to be sent as an attachment) and give the name of the attachment as you required.
    Please see the help page : [http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm] for more details and more options of the parameters.
    Regards,
    Kalpana.

  • How  to send text file as an attachment to exteral mail

    hi ,
    Can any one tell me how to send an internal table as a textfile attachment  to the external mail.
    regards
    kishore

    hi,
    i am assuming txt fie attachment means you want notepad attachment
    recently i struggled on this and i achieved success by doing as below
    remember to keep packlist as RAW type like below:
    t_packing_list-doc_type = 'RAW'.
    do like this
    CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
        EXPORTING
          ip_solitab        = t_attachment[]
       IMPORTING
         EP_SOLIXTAB       = xtext[].
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data                    = w_doc_data
         PUT_IN_OUTBOX                    = 'X'
        COMMIT_WORK                      = 'X'
        tables
          packing_list                     = t_packing_list
        OBJECT_HEADER                    =
        CONTENTS_BIN                     = objbin
         CONTENTS_TXT                     = it_message
         CONTENTS_HEX                     = xtext
        OBJECT_PARA                      =
        OBJECT_PARB                      =
          receivers                        = t_receivers
       EXCEPTIONS
         TOO_MANY_RECEIVERS               = 1
         DOCUMENT_NOT_SENT                = 2
         DOCUMENT_TYPE_NOT_EXIST          = 3
         OPERATION_NO_AUTHORIZATION       = 4
         PARAMETER_ERROR                  = 5
         X_ERROR                          = 6
         ENQUEUE_ERROR                    = 7
         OTHERS                           = 8

  • Dynamic file name of the attachment in receiver mail adapter

    Hi
    I have configured a receiver mail adapter which receives the payload as an xml attachment.
    Right now the file name of the attachment is hardcoded to "invoice.xml".
    I want to set it to dynamic ie. instead of "invoice.xml"... i want it as "invoice<invoicenumber>.xml".
    Invoice number is present in the payload.
    please suggest a solution w/o the need to develop a custom adapter module.
    Thanks!
    Regards,
    Faria Mithani

    Hi,
    Go through this thread..
    Dynamic  File Name for Receiver File Adapter
    Regards,
    Sarvesh

  • How to send Chinese Characters from BPEL to SAP through JCA Adapter

    Hi All,
    We want to do a POC using a BPEL process to send Chinese characters to SAP System through a JCA Adapter.
    If anyone has implemented the similar requirement, please share your thoughts on how to achieve it? Or if there had been any problems?
    Also, please let us know which SAP API we can use to test this?
    Appreciate your quick help!

    Hi Srini,
    I am working on 9.0.3 EBS 11i.
    Now i am able to encode using the below code:
    in = new BufferedReader(new InputStreamReader(uploadedByteStream.getInputStream(),"UTF-8"));
    if(linetext[7]!=null&&!"".equalsIgnoreCase(linetext[7]))
    col8=linetext[7].toString();
    vendor = new String(linetext[7].getBytes("UTF-8"),"EUC_CN");
    Now i am able to encode to chinese character when the file is in ANSI encoding, i see the CSV data in some form(not chinese).
    But when the file is in UTF-8 , and i can see the CSV data in Chinese (when i open in edit plus) , the encoding is not proper. when i remove the encoding the chinese data is coming properly.
    The data i am printing on the OAF screen.
    Now my doubt is : What type of file shd i be uploading ANSI/UTF-8????
    When i see on the local jdev as sop's , the data is seen as ???? but on the screen its printing correctly.
    but the data has to be passed to pl/sql procedure.
    Regards,
    Roopa.

  • How to send an email with an attachment to the customers email address.

    Hi friends,
    How to send an email with an attachment to the customers email address.
    the attachment will be in doc format.
    Having an Header
    the data which i am sending must be in a TABLE format
    with 5 columns.
    and each column must have a column heading
    Please guide me.
    Thanks in Advance,
    Ganesh.

    *& Report  ZEMAIL_ATTACH                                               *
    *& Example of sending external email via SAPCONNECT                    *
    REPORT  ZEMAIL_ATTACH                   .
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver .
    *Here get the values of mail from the table adn6 for the customer address.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
      Retrieve sample data from table ekpo
      PERFORM data_retrieval.
      Populate table with detaisl to be entered into .xls file
      PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Populate message body text
      perform populate_email_message_body.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'DOC'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
          Build data table for .xls document
    FORM build_xls_data_table.
      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.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY
    regards,
    venkat.

  • How to send a file as an attachment using mailx

    Hi
    Can any one tel me how to send a file as an attachment using mailx command in shell script.
    Thanks,
    Suman.

    Wrong forum where to ask such questions.
    Check this one link:
    http://www.unix.com/shell-programming-scripting/18370-sending-email-text-attachment-using-mailx.html?t=18370#post70254

  • Change the attachment name while sending PO as mail..

    Hi,
    I’m able to send PO Form through mail using NACE, configuration for output type.
    But my Attachment name is always showing as ‘Print Data‘.
    My requirement is to change the attachment name as below.
    Program: SAPFM06P
    Script: Z_SD_PORDER
    Please help on this issue.
    Thanks in advance.
    Regards,
    Kumar

    I didn't find any field with PACKING_LIST in program 'SAPFM06P'.
    If we create the copy of 'SAPFM06P' kindly let me know where I need to change the same..
    in form entry_neu using ent_retco ent_screen.
    the below is the code.
    *   INCLUDE FM06PE02                                                   *
    form entry_neu using ent_retco ent_screen.
       data: l_druvo like t166k-druvo,
             l_nast  like nast,
             l_from_memory,
             l_doc   type meein_purchase_doc_print.
       clear ent_retco.
       if nast-aende eq space.
         l_druvo = '1'.
       else.
         l_druvo = '2'.
       endif.
       call function 'ME_READ_PO_FOR_PRINTING'
            exporting
                 ix_nast        = nast
                 ix_screen      = ent_screen
            importing
                 ex_retco       = ent_retco
                 ex_nast        = l_nast
                 doc            = l_doc
            changing
                 cx_druvo       = l_druvo
                 cx_from_memory = l_from_memory.
       check ent_retco eq 0.
       call function 'ME_PRINT_PO'
            exporting
                 ix_nast        = l_nast
                 ix_druvo       = l_druvo
                 doc            = l_doc
                 ix_screen      = ent_screen
                 ix_from_memory = l_from_memory
                 ix_toa_dara    = toa_dara
                 ix_arc_params  = arc_params
                 ix_fonam       = tnapr-fonam          "HW 214570
            importing
                 ex_retco       = ent_retco.
    endform.
    Kindly give the clear view.

  • I have finally set up a group in my contacts. Can anyone please tell me how to send an email to the entire group? running Mavericks on iMac

    I have finally set up a group in my contacts. Can anyone please tell me how to send an email to the entire group? running Mavericks on iMac

    Drag the entire group into the To: field of a new message. The group is in your Address Book. You've used a name for it, like My Group. You can simply start typing "My Group" in that To: field and it should appear in a context menu.

  • How to sending simple text in the mail body

    Hi friends,
                 How to send simple text in the mail body through ABAP code
       plz send me the related code and setting for that mail.
      Thanks&Regards,
      Srinivas

    try this...
    FORM send_file_as_email_attachment .
      DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
      DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA : i_body TYPE soli_tab WITH HEADER LINE.
    DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
      DATA: att_lines TYPE i.
    DATA: lv_lines TYPE i.
      DATA: file TYPE string.
      data: g_datum like sy-datum.
      data: g_datum1(10) type c.
      DATA: len TYPE n.
      LOOP AT it_email.
        CLEAR : objpack,
                objhead,
                objbin,
                objtxt,
                reclist.
        REFRESH: objpack,
                 objhead,
                 objbin,
                 objtxt,
                 reclist.
        g_datum =     sy-datum - 1.
        concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
        g_datum1.
    doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
        CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
        doc_chng-obj_descr.
        CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
        g_datum1
        INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        objtxt-line = ' '.
        APPEND objtxt.
        objtxt-line = 'Regards'.
        APPEND objtxt.
        objtxt-line = 'LIS SAP Projects'.
        APPEND objtxt.
        objtxt-line =
        'PS: Pls send feedback for futher improvements to SAP office.'.
        APPEND objtxt.
        DESCRIBE TABLE objtxt LINES tab_lines.
        READ TABLE objtxt INDEX tab_lines.
        doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
       CLEAR objpack-transf_bin.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'TXT'.
       objpack-obj_name = 'Run_prog'.
       objpack-obj_descr = 'Agestock.txt'.
       lv_lines = tab_lines.
        APPEND objpack.
    *CONCATENATE 'Plant'   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           it_display SEPARATED BY space.
           append objbin.
           clear: objbin.
        CLEAR:it_display2.
        REFRESH it_display2.
        it_display2-werks = 'Plant|'.
        it_display2-matnr = 'Material Number'.
        it_display2-qty = '|Qty > 45 days'.
        it_display2-amount = '      |Amount'.
        APPEND it_display2.
        it_display2-werks = ''.
        it_display2-matnr = ''.
        it_display2-qty = ''.
        it_display2-amount = ''.
        APPEND it_display2.
        CLEAR : it_display2.
        sort it_display1 by amount descending.
        LOOP AT it_display1 WHERE werks = it_email-vkbur.
         AT FIRST.
    *CONCATENATE 'Plant    '   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           objbin-line SEPARATED BY space.
           append objbin.
           clear: objbin.
         ENDAT.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = it_display1-matnr
            IMPORTING
              output = it_display1-matnr.
          it_display1-qty = TRUNC( it_display1-qty ).
          MOVE-CORRESPONDING it_display1 TO it_display2.
          APPEND it_display2.
          CLEAR:it_display1,it_display2,objbin.
          CLEAR:it_display1.
        ENDLOOP.
        objbin[] = it_display2[].
        DESCRIBE TABLE objbin LINES tab_lines.
        objhead = 'Suug'.
        APPEND objhead.
        objpack-transf_bin = 'X'.
        objpack-head_start = 3.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'RAW'.
        objpack-obj_name = 'Run_prog'.
        objpack-obj_descr = 'Agestock.txt'.
        APPEND objpack.
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    =====================================================================
        CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            commit_work                = 'X'
          TABLES
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            OTHERS                     = 99.
        CLEAR : it_email.
      ENDLOOP.
    ENDFORM.                    "send_mail
    Message was edited by:
            Sugumar Ganesan

  • How to send ASCII character to the read buffer?

    how to send ASCII character to the read buffer?

    I assume you mean the serial port read buffer. You can't the only way data gets there is by coming in on the receive line.
    What exactly is it that you are trying to do?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Override default send from email id and attachment name in email delivery

    How to override the default send from email ID and attachment name to send an outbound document using Email Transport protocol in Oracle Integration B2B ?. I've seen that "[email protected]" and subject of the email message were used as send from email ID and attachment name respectively

    Ramesh,
    I set the send from email ID as Generic Identifier for host and send to email ID as Generic Identifier for trading partner and used it in the agreement. How ever still the email message is generated with "[email protected]" as send from email ID.
    However I noticed that the "FROM" field in the wire message is updated with the correct send from email ID which I used as the Generic Identifier for host.
    Please advise.

  • How is it posible to get the File name, size and type from a File out the H

    How is it posible to get the File name, size and type from a File out the HttpServletRequest. I want to upload a File from a client and save it on a server with the client name. I want to conrole before saving the name, type and size of the file.How is it posible to get the File name, size and type from a File out the HttpServletRequest.
    form JSP
    <form name="form" method="post" action="procesuploading.jsp" ENCTYPE="multipart/form-data">
    File: <input type="file" name="filename"/
    Path: <input type="text" readonly="" name="path" value="c:"/
    Saveas: <input type="text" name="saveas"/>
    <input name="submit" type="submit" value="Upload" />
    </form>
    proces JSP
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="FileUploadBean" %>
    <jsp:useBean id="TheBean" scope="page" class="FileUploadBean" />
    <%
    TheBean.doUpload(request);
    %>
    BEAN
    import java.io.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletInputStream;
    public class FileUploadBean {
    public void doUpload(HttpServletRequest request) throws IOException
              String melding = "";
              String filename = request.getParameter("saveas");
              String path = request.getParameter("path");
              PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("test.java")));
              ServletInputStream in = request.getInputStream();
              int i = in.read();
              System.out.println("filename:"+filename);
              System.out.println("path:"+path);
              while (i != -1)
                   pw.print((char) i);
                   i = in.read();
              pw.close();
    }

    Thanks it works great.
    Here an excample from my code
    import org.apache.commons.fileupload.*;
    public class FileUploadBean extends Object implements java.io.Serializable{
    String foutmelding = "geen";
    String path;
    String filename;
    public boolean doUpload(HttpServletRequest request) throws IOException
         try
         // Create a new file upload handler
         FileUpload upload = new FileUpload();
         // Set upload parameters
         upload.setSizeMax(100000);
         upload.setSizeThreshold(100000000);
         upload.setRepositoryPath("/");
         // Parse the request
         List items = upload.parseRequest(request);
         // Process the uploaded fields
         Iterator iter = items.iterator();
         while (iter.hasNext())
         FileItem item = (FileItem) iter.next();
              if (item.isFormField())
                   String stringitem = item.getString();
         else
              String filename = "";
                   int temp = item.getName().lastIndexOf("\\");
                   filename = item.getName().substring(temp,item.getName().length());
                   File bestand = new File(path+filename);
                   if(item.getSize() > SizeMax && SizeMax != -1){foutmelding = "bestand is te groot.";return false;}
                   if(bestand.exists()){foutmelding ="bestand bestaat al";return false;}
                   FileOutputStream fOut = new FileOutputStream(bestand);     
                   BufferedOutputStream bOut = new BufferedOutputStream(fOut);
                   int bytesRead =0;
                   byte[] data = item.get();
                   bOut.write(data, 0 , data.length);     
                   bOut.close();
         catch(Exception e)
              System.out.println("er is een foutontstaan bij het opslaan de een bestand "+e);
              foutmelding = "Bestand opsturen is fout gegaan";
         return true;
         }

Maybe you are looking for

  • Opening and Closing Stock Monthwise

    hi, I need to display month wise Stock details like below month-year Opening-Stock STock-In Stock-Out closing-Stock I have made the query, but this query gives only monthwise stock-in and stock-out. How do i get Opening-Stock and closing-Stock. SELEC

  • How can I get Lightroom 5.7 into the "Open With" menu on an external Harddrive?

    Using Lightroom 5.7, I imported photo images as a .dng.  I edited the images in lightroom.  Then I dragged the file from the local Disk (C) to an external Hard drive (left panel of Library).  When I look in the External harddrive, I would like to see

  • How to clear Vendor Debit item Through F110

    Hi All, I have a new requirement, I have a vendor for which transactions are posted in multiple currecies, like USD & EUR. I have 2 invoices for this vendor, one is in EUR, and other one is in USD, along with this i have a dabit balance for this vend

  • Oracle Apps 12.03 and dbf file under $FND_TOP/secure

    Hi All, I have a question. Back to 11i, there was a .dbc file under $FND_TOP/secure. To generate it or edit, you could use jre oracle.apps.fnd.security.AdminAppServer with the parameters. For R12 (R12.0.3 with a 10.2.0.2 DB), the file should be under

  • Win10 Browse for networked folder or share

    So I can't seem to get BrowseForFolder, in vbscript, to show mapped or networked drives and locations in Win10 :\ Dim folderOptions, oShell, oFolder, oFolderItem  folderOptions = &H1 + &H8 + &H10 + &H20 + &H40   Set oShell = CreateObject( "Shell.Appl