Text file as an attachment in reciever mail adapter

Hi Experts,
I want to pick the text file using sender file adapter using file content converion, same file i need to send an attachment in reciever mail adapter.
Can anybody help me how can i do this.
Kind Regards,
Praveen.
Edited by: Praveen Kumar on Mar 10, 2010 9:08 AM

Hi,
>>>I want to pick the text file using sender file adapter using file content converion, same file i need to send an attachment in reciever mail adapter.
use payload swap bean to put the attachment in place of the message payload - do the content conversion using
content conversion adapter module, then do the same in the reverted order at the receiver
there are dozenz of blogs showing how to use the two adapter modules I mentioned so just do a little search in blog section
Regards,
Michal Krawczyk

Similar Messages

  • 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

  • How to download / read  text attachment  in Sender Mail Adapter  IN XI

    Hi
    I would like to know how to download / read text attachment in sender mail Adapter & sent same attachment to target system using file adapter.
    Please help how to design / resolve this concept.
    Regards
    DSR

    I would like to know how to download / read text attachment in sender mail Adapter & sent same
    attachment to target system using file adapter.
    Take help from this blog:
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    From the blog:
    However in most cases
    our message will not be a part of the e-mail's payload but will be sent as a file attachment.
    Can XI's mail adapter handle such scenarios? Sure it can but with a little help
    from the PayloadSwapBean adapter module
    Once your message (attachment) is read by the sender CC, you can perform the basic mapping requirement (if any) to convert the mail message fromat to the file format.....configure a receiver FILE CC and send the message...this should be the design...
    Regards,
    Abhishek.

  • Adapter Module Error-Sending excel file as an attachment of the mail

    Hi ,
    My scenario is as follows
    1)I am sending an excel file as an attachment of the mail.I need to read that excel attachment as a payload.
    So mail adapter is used in sender side.
      To configure this, have used standard PayloadSwapBean  module with proper module key.
      Next to convert excel to XML another custom adapter module is being used.
    Both this adapter module , I configured into the CC of sender mail adapter.
    The order in which adapter modules are being used in the sender CC are as follows
    1)localejbs/AF_Modules/PayloadSwapBean
    2)localejbs/MDPExcelToXMLConversion
    3)sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    MDPExcelToXMLConversion-Custom adapter module written to convert excel to xml.
    I am getting the following error
    exception caught during processing mail message [4899]com.sap.aii.af.lib.mp.module.ModuleException
    And also,
    no messages in coming MONI of PI.
    Pls suggest what to do.
    Thanks
    Ayan

    Shabarish,
    Will the ordering in which the adapter modules(In this case there are two-PayloadSwapBean & MDPExcelToXML) are appearing into Module tab of sender adapter matter?
    Firstly, what is happenning
    1)If I take out the custom  adapter module MDPExcelToXML and put only PayloadSwapBean  then it is successfully converting mail attachment into the main Payload i.e PayloadSwapBean   module is working.
    2)Nextly, my local code( i.e java code without including standard Module specific method like ejbActivate(),ejbPassivate(),process()  etc etc.)) for MDPExcelToXML is successfuly converting the excel file into the XML file.Then I am making the local code into adapter module specific code and deploying that.
    A few question arises here,
    Do I need to do any specific configurations here in PI for this particular things.Maybe both the adapter module is clashing with each other.
    And also using tracing and logging into my custom adapter module code.Getting the following error,
    java.io.IOException: Unable to read entire header; 116 bytes read; expected 512 bytes#
    Thanks
    Ayan

  • Body and Signature not getting in reciever mail adapter

    Hi Friends,
    My requirement is the reciever mail adapter having the Attachment and Body and signature.
    Here i am getting Attachment only. I am not getting Body( example: the ftp successfully genrated this file abbc_12/03/2014.txt) and Signature.
    Signature  like
    Thanks
    company name.
    Thanks
    Bhanu

    Hi Galla,
    I have some doubts about your scenario, Is your scenario FTP to MAIL?,  do you want to send the file as attachment or you want the file content as mail body or where the body is taken? where is the signature, inside the file?
    Meantime, you can check these documents about file-mail scenario:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0a27c01-26b0-2c10-bd8a-94498efa7ff6?quicklink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/5083371b-5bd2-2e10-3f8b-ad877d24c9ce?QuickLink=index&overridelayout=true&52475910426407
    Regards.

  • Using header paramter SHeaderX-MS-HAS-ATTACH  in Sender mail adapter

    I am trying to check if an e-mail contains attachment in reciever determintion
    I set the Variable Header XHeaderName1 to be SHeaderX-MS-HAS-ATTACH
    in Sender mail adapter
    I added a condition in the receving determintation
    XHeaderName1 = yes
    I see the DynamicConfiguration tab in sxmb_moni and the value of SHeaderX-MS-HAS-ATTACH is "yes"
    but the message fails with the error
    No receiver could be determined
    any ideas?

    Hi,
    In Receiver determination you need to set SHeaderX-MS-HAS-ATTACH = yes instead of XHeaderName1.
    As far my understanding, in receiver determination you need to verify the condition with  SHeaderX-MS-HAS-ATTACH = yes (check with syntax also ie. case sensitive and all)
    Thanks
    Swarup

  • MIME settings in reciever mail adapter.

    Hi,
    We are trying to send the emails from XI system through SMTP adapter to a legacy system.
    The Legacy system wants file in the MIME format.
    At the XI end we have done the java mapping for the email configuration. Also, the configuration has been done to set the outgoing message format as MIME.
    The issue is the legacy system is not accepting the mail sent by our system.
    The issue has been found in few files. As in the legacy system is accepting randomly some files sent by our system.
    Please advice whether the error can be at the XI configuration end or it is at the legacy system end.
    Appreciate your quick responses.
    Regards,
    Alpa.

    Hi Jyothi,
    The MIME settings was there in the reciever mail adapter.
    Please note that the system was working fine since last month.
    The legacy system was recieveing the data sent by XI system since last month.
    There has been no changes done at the XI end and the reciever adapter end till now.
    Moreover now some files are being accepted by the legacy system.
    for eg. lets say if the system sends the files in sequence-1 2 3 4 5
    Randomly the legacy system is accepting file 1 and 4.
    We dont see any difference in the way the files are being created and sent in the XI end.
    The legacy party is claiming that no changes has been done.
    So wanted to know where to look for the possible cause of error.
    Regards,
    Alpa.

  • Error in reciever mail adapter

    Hi all,
           I am testing my reciever mail adapter by sending message from runtime workbench.
    In sxmb_moni i get successfull status.But it is giving following error in reciever mail adapter :
    Message processing failed. Cause: com.sap.aii.af.sdk.xi.srt.BubbleException: Failed to call the endpoint  [null "null"]; nested exception caused by: java.net.UnknownHostException:XYZ
    failed to send mail: java.net.UnknownHostException: XYZ
    where xyz = My microsoft exchange server name  taken from tools->options->mail setups ->Email Accounts -->email tab  here we get microsoft exchange server name.
    Thanks
    Deepak

    Hi  Deepak ,
    Please refer this forum post .. if this helps.
    Reg:Receiver Mail Adapter
    Regards,
    srinivas

  • Need of security parameters in reciever mail adapter

    helo all.
    i just want to know the need of security parameters  and persist duration in reciever mail adapter.
    waiting for ur response.
    bye.
    regards.
    seeta ram.

    Hi Seeta Ram,
    If you want to encrypt e-mails and give them a digital signature in the corresponding receiver agreement in the Integration Server then Security Parameters are used.
    Persist Duration is used for security archiving.
    This link will help you
    http://help.sap.com/saphelp_nw70/helpdata/en/4e/c153426da9bd30e10000000a155106/content.htm
    Regards,
    Sreenivas
    Message was edited by:
            Sreenivas Nettem

  • How to configure reciever mail adapter

    Hi All,
    I have gone through your weblog for configuring reciever mail adapter BY PRASAD ULAGAPPAN.
    I have few doubts .
    Message protocol  ==      XIALL.
    If I am providing my mail address in MAIL ATTRIBUTES-TO parameter
    then what do we have to exactly specify in connection parameters.
    I want to send a mail from XI to my ID.  Suppose my id is [email protected] .
    So if I am providing this ID in " TO " parameter then what should I specify in connection parameters
    i.e       url = ?
               user = ?
               password = ?  (which password to specify  , usually we dont require to give password to recieve mails )
    Please help me with this.
    Waiting for your reply.
    Thanks in advance

    Hi Yomesh,
    The below help URL gives explanation for 'Connection Parameters for Mail Server':
    http://help.sap.com/saphelp_nw04/helpdata/en/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm
    You need to provide your mail server details. When you send a mail normally, say from outlook, you configure it to connect to some SMTP/IMAP server, using username/password.
    Provide that server details in URL.
    If you dont use user/password to connect to it, leave it blank.
    Also fill the 'From' mail address.
    For eg., if there is a internet connectivity to your XI server, and you want to use SMTP server of yahoo to send out mails,  then you can give:
    URL: smtp://smtp.mail.yahoo.com
    userid: yomeshsharma
    password: <your yahoo password>
    In this case, both your From & TO details are same.
    You can change 'TO' to send to a different mail address.
    regards,
    Pops V
    Message was edited by: Pops V

  • Dynamic file name of the attachment in sender mail adapter

    Hi
    I have configured a sender mail adapter which receives some attachments.
    Right now the file name of the attachment is hardcoded to "MailAttachment-1" "MailAttachment-2" using the content-description from "AF_Modules/PayloadSwapBean" module.
    I want to set it to dynamic ie. instead of "MailAttachment-1"... i want it with real name of the attach.
    please suggest a solution w/o the need to develop a custom adapter module.
    Thanks!
    Regards,
    Mariano.

    Thanks Prateek,
    Now, i can see that the name of the original file is into the content type named as  text/xml; name"name of the file.xml" when i send the email from outlook.
    If i send it from hotmail, this is not happend.
    Do you know why happend this?
    If i always would have the original name inside the content type, my problem will be solved.
    Edited by: Mariano Vidal on Feb 13, 2009 2:26 PM

  • How to attach a text file as an attachment to email message?

    Hello Everybody,
    I have a .csv file, in which details about emp-id, emp-name, e-expenses for Reimbursement and email address are stored.
    My application reads this .csv file, and sends a mail to each employee with his id, salary details in text format. (by changing content type to "text/plain") The code is working fine. But,
    My problem is:
    The message is sent as message body to the end user.
    The end user / the person who receives this mail will not be a technical person. So,
    1) If he trys to take a print out of this e-mail, He get only half of it.(as no. of colums will be more than paper size).
    2) I am finding alignment problem. IF employee name is too big, other columns will shift to right and data will not be exactly under column header. (it is going in zig zag way)
    So, I thought sending text file with all the details as an attachment might do well.
    But, I don't know how to attach a text file to email-message body.
    code
    try
                   {               String s1="";
                                  File f1 = new File(the path);
                                  FileInputStream fstream = new FileInputStream(f1); //new
                                  BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
                                  int count=0;
                                  while((s1=br.readLine())!=null )
                                                 count++;
                                                 //out.println("within while loop "+count);
                                                 StringTokenizer st = new StringTokenizer(s1,",");
                                                 if ((st.hasMoreTokens())&&(count>1))
                                            String a=st.nextToken().trim();
                                                 String b=st.nextToken();
                                                 String c=st.nextToken();
                                                 String d=st.nextToken();
                                                 String e=st.nextToken();
                                                 String f=st.nextToken();
                                                 String g=st.nextToken();
                                                 String h=st.nextToken();
                                                 String i=st.nextToken();
                                                 String j=st.nextToken();
                                                 String k=st.nextToken();
                                                 String l=st.nextToken();
                                                 String m=st.nextToken();
                                                 String n=st.nextToken();
                                                 String o=st.nextToken();
                                                 String p=st.nextToken();
                                                 String q=st.nextToken();
                                                 String mail=st.nextToken();
                                                 String s=st.nextToken();
                                                 //out.println("b="+b+"c="+c+"d="+d+"e="+e+"f="+f+"mail="+mail);
                                                 %>
    <%
                                            String to =mail;
                                                 String from =request.getParameter("fromadd");                                        
                                                 String subject ="Statement of Expenses";
                                                 String smtp ="mail.xxxxxxxxxx.com";
                                                 String message="";                                        
                                                 message=message.concat("EMP ID");
                                                 message=message.concat("     ");
                                                 message=message.concat("Name");
                                                 message=message.concat("          ");
                                                 message=message.concat("Dept No.");
                                                 message=message.concat("     ");
                                                 message=message.concat("Acc No.");
                                                 message=message.concat("     ");
                                                 message=message.concat("*****************************************************************************************");     
                                                 message=message.concat(a);
                                                 message=message.concat("     ");
                                                 message=message.concat(b);
                                                 message=message.concat("          ");
                                                 message=message.concat(c);
                                                 message=message.concat("     ");
                                                 message=message.concat(d);
                                                 Properties props = System.getProperties();
                                                 // Puts the SMTP server name to properties object
                                                 props.put("mail.smtp.host", smtp);
                                                 // Get the default Session using Properties Object
                                                 Session session1 = Session.getDefaultInstance(props, null);
                                                 // Create a New message
                                                 MimeMessage msg = new MimeMessage(session1);
                                                 // Set the From address
                                                 msg.setFrom(new InternetAddress(from));
                                                 // Setting the "To recipients" addresses
                                            msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
                                            /* // Setting the "cc recipients" addresses
                                            msg.setRecipients(Message.RecipientType.CC,InternetAddress.parse(cc, false));
                                            // Setting the "Bcc recipients" addresses
                                            msg.setRecipients(Message.RecipientType.BCC,InternetAddress.parse(bcc, false)); */
                                            // Sets the Subject
                                            msg.setSubject(subject);
                                            // set the meaasge in HTML format
                                            msg.setContent(message,"text/plain");
                                            // Set the Date: header
                                            msg.setSentDate(new java.util.Date());
                                            // Send the message
                                            Transport.send(msg);
                                            // Display Success message
                                            result =result.concat("<tr><td>"+b+"</td>"+"<td>"+to+"</td></tr>");
                                                      }//end of if of hasmore element
                                       }// end of while loop
                        out.println(result);                    
    }catch(Exception e)
                        // If here, then error in sending Mail. Display Error message.
                        result="Unable to send your message";
                        out.println("e="+e);
    Any help will be appreciated.
    Thanks and regards.
    Ashvini

    <html>
    <p>
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setText("Your Messages");
    MimeBodyPart mbp2 = new MimeBodyPart();
    FileDataSource fds = new FileDataSource("Your Attachments");
    mbp2.setDataHandler(new DataHandler(fds));
    mbp2.setFileName(fds.getName());
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    mp.addBodyPart(mbp2);
    msg.setContent(mp);
    msg.saveChanges();
    msg.writeTo(System.out);
    msg.setSubject(subject);
    Transport.send(msg);
    </p>
    <B><U>See you can add above code in your program and see the magic</U></B>
    Bye
    regards--
    Ashish
    </html>

  • Send text file as an attachment

    Hi All,
    We have a requirement wherein we need to send the contents of an
    internal table in a text pipe delimited file as an attachment in to an
    external mail id.
    The problem is that the total record length of the internal table is
    around 450 char while the structure SOLI accepts only 255 char.
    This causes the record to be split into 2 lines.
    Is it possible to send the entire 450 char in one line? If yes, how can
    this be done?
    Thanks,
    fractal

    I think u shd use this FM for line width change:-
    CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
       EXPORTING
         LINE_WIDTH_SRC                    = 134 "ur source width
         LINE_WIDTH_DST                    = 255
        TRANSFER_BIN                      = ' '
        TABLES
          CONTENT_IN                        = GT_PDF  "ur itab name
          CONTENT_OUT                       = LT_ATT
      EXCEPTIONS
        ERR_LINE_WIDTH_SRC_TOO_LONG       = 1
        ERR_LINE_WIDTH_DST_TOO_LONG       = 2
        ERR_CONV_FAILED                   = 3
        OTHERS                            = 4

  • SENDING TEXT FILE AS AN ATTACHMENT

    Hi,
    I want to send an email as a TEXT file attachment.
    Thanks
    Vikranth Khimavath

    hi,
    Use the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with an attachment. Here is the sample code.
    FUNCTION Z_SEND_MAIL.
    ""Local interface:
    *" IMPORTING
    *" VALUE(MESSAGE) TYPE STRING OPTIONAL
    *" VALUE(RECEIVER_MAIL) TYPE STRING OPTIONAL
    *" VALUE(TO) TYPE STRING OPTIONAL
    data for send function
    DATA doc_data TYPE sodocchgi1.
    DATA object_id TYPE soodk.
    DATA objcont TYPE TABLE OF soli INITIAL SIZE 10.
    DATA wa_objcont LIKE LINE OF objcont.
    DATA receiver TYPE TABLE OF somlreci1 INITIAL SIZE 1.
    DATA wa_receiver LIKE LINE OF receiver.
    move message
    TO doc_data-obj_descr .
    This is the subject for your mail.
    WRITE 'Sub:test Mail' TO doc_data-obj_descr.
    This is the body of your mail.
    concatenate ' Hi ' to into wa_objcont-line separated by space.
    append wa_objcont to objcont.
    wa_objcont-line = message.
    append wa_objcont to objcont.
    Specify receipent id.
    MOVE: RECEIVER_MAIL TO wa_receiver-receiver,
    'X' TO wa_receiver-express,
    'U' TO wa_receiver-rec_type.
    APPEND wa_receiver TO receiver.
    Finally call the function module.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
    document_data = doc_data
    put_in_outbox = 'X' "Save Document in Outbox
    COMMIT_WORK = 'X'
    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.
    SUBMIT rsconn01 USING SELECTION-SET 'SAP&CONNECTINT' AND RETURN.
    ENDFUNCTION.
    REPORT RSCONN01 MESSAGE-ID XS NO STANDARD PAGE HEADING.
    INCLUDE <SYMBOL>. " 11.11.96
    TYPE-POOLS: SX.
    TYPE-POOLS: KKBLO.
    PARAMETERS: MODE(3) TYPE C DEFAULT '*',
    OUTPUT TYPE C DEFAULT ' '. "B20K072036 new parameter
    selection-screen skip.
    parameters maxjobs type sx_maxjobs default 1.
    parameters rfcgroup type bdfields-rfcgr.
    selection-screen skip.
    parameters maxpsize type sx_maxpsize default 1000.
    parameters minpsize type sx_minpsize default 20.
    parameters maxsel type sx_maxqrows default 20000.
    parameters timepo type sx_timepo default 2.
    parameters timeout type sx_arfctimeout default 100.
    parameters commit type sx_commit default 1.
    data address_types type sx_addrtab.
    data job_params type sxjobs.
    data jobdata type sxjobdata.
    --- initialization -
    initialization.
    get default parameters
    call function 'SX_JOBDATA_GET'
    changing
    jobdata = jobdata.
    give defaults to parameters
    maxjobs = jobdata-maxjobs.
    maxpsize = jobdata-maxpsize.
    minpsize = jobdata-minpsize.
    maxsel = jobdata-maxsel.
    timepo = jobdata-timepo.
    timeout = jobdata-arfc_timeout.
    commit = jobdata-commit_after.
    --- start-of-selection -
    start-of-selection.
    perform addr_type_to_table using mode
    changing address_types.
    job_params-maxjobs = maxjobs.
    job_params-rfcgroup = rfcgroup.
    job_params-maxpsize = maxpsize.
    job_params-minpsize = minpsize.
    job_params-maxsel = maxsel.
    job_params-timepo = timepo.
    job_params-arfc_timeout = timeout.
    job_params-commit_after = commit.
    call function 'SX_OBJECTS_SEND'
    exporting
    address_types = address_types
    output = output
    job_params = job_params
    exceptions
    others = 1.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    exit.
    TABLES: SXADDRTYPE.
    DATA: selection type SX_ADDRTAB,
    NR_SO_OBJECTS TYPE I,
    OBJ_CAT TYPE SX_OBJ_CAT OCCURS 20 WITH HEADER LINE.
    if sy-batch = 'X'.
    message I078 with 'RSCONN01' SY-HOST SY-MANDT.
    endif.
    *fill selection table
    refresh selection.
    if mode = '*'.
    clear mode.
    endif.
    IF NOT ( MODE IS INITIAL ).
    SELECT SINGLE * FROM SXADDRTYPE WHERE ADDR_TYPE EQ MODE.
    IF SY-SUBRC NE 0.
    IF OUTPUT EQ 'X'.
    WRITE: MODE, TEXT-001, TEXT-002.
    ENDIF.
    EXIT.
    ENDIF.
    IF SXADDRTYPE-METHOD NE 'SAPCONNECT'.
    IF OUTPUT EQ 'X'.
    WRITE: MODE, TEXT-003, TEXT-004, TEXT-005.
    ENDIF.
    EXIT.
    ENDIF.
    append sxaddrtype-addr_type to selection.
    ELSE.
    select * from sxaddrtype
    where method = 'SAPCONNECT'
    and extern = sx_true.
    case sxaddrtype-addr_type.
    when 'INT' or 'FAX' or 'PAG' or
    'PRT' or 'RML' or 'X40'.
    append sxaddrtype-addr_type to selection.
    endcase.
    endselect.
    ENDIF.
    CALL FUNCTION 'SX_OBJECTS_SEND'
    EXPORTING
    ADDRESS_TYPES = SELECTION
    IMPORTING
    NR_SO_OBJECTS = NR_SO_OBJECTS
    TABLES
    OBJ_CAT = OBJ_CAT
    EXCEPTIONS
    INTERNAL_ERROR = 1
    OTHERS = 2.
    IF SY-SUBRC NE 0.
    IF OUTPUT EQ 'X'.
    Always write out this error message:
    WRITE: TEXT-006, SY-SUBRC.
    ENDIF.
    EXIT.
    ENDIF.
    IF NR_SO_OBJECTS = 0.
    IF OUTPUT EQ 'X'.
    WRITE: TEXT-007.
    ENDIF.
    EXIT.
    ENDIF.
    IF OUTPUT EQ 'X'.
    PERFORM DISPLAY_OBJECT_CATALOGUE.
    ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR MODE.
    PERFORM F_SHOW_ADDR_TYPES CHANGING MODE.
    AT SELECTION-SCREEN ON HELP-REQUEST FOR OUTPUT.
    PERFORM F_HELP_OUTPUT.
    *& Form addr_type_to_table
    text
    form addr_type_to_table using address_type type sx_addrtyp
    changing address_types type sx_addrtab.
    data adrtp_wa type sxaddrtype.
    data adrtp type sx_addrtyp.
    if address_type <> '*'.
    adrtp = address_type.
    endif.
    if not adrtp is initial.
    select single * from sxaddrtype into adrtp_wa
    where addr_type = adrtp.
    if sy-subrc <> 0.
    message i009 with adrtp.
    exit.
    endif.
    if adrtp_wa-method ne 'SAPCONNECT'.
    message i027 with adrtp.
    exit.
    endif.
    append adrtp_wa-addr_type to address_types.
    else.
    select * from sxaddrtype into adrtp_wa
    where method = 'SAPCONNECT'
    and extern = sx_true.
    case adrtp_wa-addr_type.
    when 'INT' or 'FAX' or 'PAG' or
    'PRT' or 'RML' or 'X40'.
    append adrtp_wa-addr_type to address_types.
    endcase.
    endselect.
    endif.
    endform. " addr_type_to_table
    *& Form DISPLAY_OBJECT_CATALOGUE
    Anzeige der Liste der zum Versenden selektierten Objekte
    --> p1 text
    <-- p2 text
    FORM DISPLAY_OBJECT_CATALOGUE.
    DATA: FIELD_LST TYPE KKBLO_T_FIELDCAT.
    DATA: FIELD_CAT TYPE KKBLO_FIELDCAT.
    DATA: IS_LAYOUT TYPE KKBLO_LAYOUT.
    IS_LAYOUT-NO_ZEBRA = 'X'.
    FIELD_CAT-REF_TABNAME = 'SXOBJCAT'.
    FIELD_CAT-NO_SUM = 'X'.
    FIELD_CAT-JUST = 'L'.
    FIELD_CAT-OUTPUTLEN = 3.
    FIELD_CAT-REPTEXT = 'Trc'.
    FIELD_CAT-FIELDNAME = 'DISPL_TRC'.
    FIELD_CAT-HOTSPOT = 'X'.
    FIELD_CAT-SYMBOL = 'X'.
    APPEND FIELD_CAT TO FIELD_LST.
    FIELD_CAT-SYMBOL = ' '.
    FIELD_CAT-OUTPUTLEN = 0.
    FIELD_CAT-HOTSPOT = ' '.
    FIELD_CAT-REPTEXT = ' '.
    CLEAR: FIELD_CAT-NO_ZERO, FIELD_CAT-KEY .
    FIELD_CAT-FIELDNAME = 'ID'. APPEND FIELD_CAT TO FIELD_LST.
    FIELD_CAT-FIELDNAME = 'TITLE'. APPEND FIELD_CAT TO FIELD_LST.
    FIELD_CAT-FIELDNAME = 'TYPE'. APPEND FIELD_CAT TO FIELD_LST.
    FIELD_CAT-FIELDNAME = 'NR_RECIP'. APPEND FIELD_CAT TO FIELD_LST.
    LOOP AT FIELD_LST INTO FIELD_CAT.
    FIELD_CAT-COL_POS = SY-TABIX.
    MODIFY FIELD_LST FROM FIELD_CAT.
    ENDLOOP.
    LOOP AT OBJ_CAT.
    OBJ_CAT-DISPL_TRC = SYM_PENCIL.
    MODIFY OBJ_CAT.
    ENDLOOP.
    CALL FUNCTION 'K_KKB_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = 'RSCONN01'
    I_CALLBACK_USER_COMMAND = 'CB_OL_UCOMM'
    I_CALLBACK_TOP_OF_PAGE = 'CB_OL_TOP'
    I_CALLBACK_PF_STATUS_SET = 'CB_OL_PFSTATUS'
    I_TABNAME = 'OBJ_CAT'
    IS_LAYOUT = IS_LAYOUT
    IT_FIELDCAT = FIELD_LST
    TABLES
    T_OUTTAB = OBJ_CAT
    EXCEPTIONS
    OTHERS = 1.
    ENDFORM. " DISPLAY_OBJECT_CATALOGUE
    *& Form CB_OL_PFSTATUS
    Callback Funktion (wird aus Listtool heraus gerufen) *
    --> p1 text
    <-- p2 text
    FORM CB_OL_PFSTATUS
    USING EXTAB TYPE KKBLO_T_EXTAB.
    SET PF-STATUS 'CATALOG' EXCLUDING EXTAB.
    SET TITLEBAR 'CAT'.
    ENDFORM. " CB_OL_PFSTATUS
    *& Form CB_OL_TOP
    Callback Funktion (wird aus Listtool heraus gerufen) *
    --> p1 text
    <-- p2 text
    FORM CB_OL_TOP.
    ENDFORM. " CB_OL_TOP
    *& Form CB_OL_UCOMM
    text *
    --> p1 text
    <-- p2 text
    FORM CB_OL_UCOMM
    USING UCOMM LIKE SY-UCOMM
    SELFIELD TYPE KKBLO_SELFIELD.
    DATA: NUMC5(5) TYPE N.
    NUMC5 = SELFIELD-TABINDEX.
    CASE UCOMM.
    WHEN 'PIC1'.
    CASE SELFIELD-SEL_TAB_FIELD.
    WHEN 'OBJ_CAT-DISPL_TRC' OR 'OBJ_CAT-TITLE' OR 'OBJ_CAT-ID'.
    READ TABLE OBJ_CAT INDEX SELFIELD-TABINDEX.
    IF SY-SUBRC NE 0.
    MESSAGE E042.
    ENDIF.
    SUBMIT RSWTTR01
    WITH P_TYPE = 'D'
    WITH P_UNAME = SPACE
    WITH P_OBJ = OBJ_CAT-ID AND RETURN.
    WHEN OTHERS.
    MESSAGE I041 WITH NUMC5 SELFIELD-SEL_TAB_FIELD UCOMM.
    ENDCASE.
    WHEN OTHERS.
    MESSAGE I041 WITH NUMC5 SELFIELD-SEL_TAB_FIELD UCOMM.
    ENDCASE.
    ENDFORM. " CB_OL_UCOMM
    *& Form F_SHOW_ADDR_TYPES
    text
    <--P_MODE text *
    FORM F_SHOW_ADDR_TYPES CHANGING A_TYPE.
    DATA: HELP_INFO LIKE HELP_INFO
    , sel_value like help_info-fldvalue
    , CUCOL LIKE SY-CUCOL
    , CUROW LIKE SY-CUROW
    , value like help_info-fldvalue value 'SE38'
    , IND LIKE SY-INDEX
    , C_SY_SUBRC(3) TYPE C
    DATA: BEGIN OF FIELDS OCCURS 5.
    INCLUDE STRUCTURE HELP_VALUE.
    DATA: END OF FIELDS.
    DATA: BEGIN OF LIST_OF_FIELDS OCCURS 5,
    NAME(21) TYPE C.
    DATA: END OF LIST_OF_FIELDS.
    DATA: BEGIN OF FULL_LIST OCCURS 5,
    ADDRESS_TYPE LIKE SXADDRTYPE-ADDR_TYPE,
    END OF FULL_LIST.
    REFRESH FIELDS.
    REFRESH LIST_OF_FIELDS.
    REFRESH FULL_LIST.
    HELP_INFO-TABNAME = 'SXADDRTYPE'.
    HELP_INFO-FIELDNAME = 'ADDR_TYPE'.
    SELECT * FROM SXADDRTYPE.
    IF SXADDRTYPE-METHOD NE 'SAPCONNECT'
    OR SXADDRTYPE-EXTERN NE SX_TRUE.
    CONTINUE.
    ENDIF.
    MOVE SXADDRTYPE-ADDR_TYPE TO FULL_LIST-ADDRESS_TYPE.
    APPEND FULL_LIST.
    ENDSELECT.
    MOVE '*' TO FULL_LIST-ADDRESS_TYPE.
    APPEND FULL_LIST.
    LIST_OF_FIELDS-NAME = 'SXADDRTYPE-ADDR_TYPE'.
    APPEND LIST_OF_FIELDS.
    CALL FUNCTION 'TRANSFER_NAMES_TO_FIELDS'
    EXPORTING
    SELECTFIELD = HELP_INFO-FIELDNAME
    TABLES
    FIELDS = FIELDS
    NAMELIST = LIST_OF_FIELDS
    EXCEPTIONS
    WRONG_FORMAT_GIVEN = 1
    OTHERS = 2.
    CALL FUNCTION 'HELP_VALUES_GET_WITH_VALUE'
    EXPORTING
    DISPLAY = ' '
    FIELDNAME = HELP_INFO-FIELDNAME
    TABNAME = HELP_INFO-TABNAME
    GIVEN_VALUE = HELP_INFO-FLDVALUE
    TITEL = TEXT-002
    IMPORTING
    SELECT_VALUE = HELP_INFO-FLDVALUE
    SELECT_INDEX = IND
    TABLES
    FIELDS = FIELDS
    VALUETAB = FULL_LIST
    EXCEPTIONS
    FIELD_NOT_IN_DDIC = 1
    MORE_THEN_ONE_SELECTFIELD = 2
    NO_SELECTFIELD = 3
    OTHERS = 4.
    C_SY_SUBRC = SY-SUBRC.
    CASE SY-SUBRC.
    WHEN '0'.
    READ TABLE FULL_LIST INTO A_TYPE INDEX IND.
    WHEN OTHERS.
    MESSAGE E022 WITH C_SY_SUBRC.
    ENDCASE.
    ENDFORM. " F_SHOW_ADDR_TYPES
    *& Form F_HELP_OUTPUT
    text
    --> p1 text
    <-- p2 text
    FORM F_HELP_OUTPUT.
    DATA: CANCELLED TYPE C,
    C_SY_SUBRC(8) TYPE C.
    CALL FUNCTION 'POPUP_DISPLAY_TEXT'
    EXPORTING
    LANGUAGE = SY-LANGU
    POPUP_TITLE = 'SAPconnect'
    TEXT_OBJECT = 'RSCONN01_F1_OUTPUT_40B'
    IMPORTING
    CANCELLED = CANCELLED
    EXCEPTIONS
    TEXT_NOT_FOUND = 1
    OTHERS = 2.
    C_SY_SUBRC = SY-SUBRC.
    IF SY-SUBRC NE 0.
    MESSAGE E035 WITH C_SY_SUBRC. leads to dump !
    ENDIF.
    ENDFORM. " F_HELP_OUTPUT
    Regards,
    Richa

  • Dynamic file name as mail attachment in receiver Mail Adapter?

    Hi,
    Can any one tell the possibility of attaching file as a mail attachment without using mail Package with dynamic filename.
    Business requirement is to send error response as mail attachment with dynamic name.
    Ex: Error_Response_20110802_13.24 where 20110802 is Date and next part represents time stamp.
    File attachment name should change dynamically in Mail receiver Adapter. Thanks
    Regards,
    Sreeramulu Konjeti.

    there is no standard way.
    you will have to write a module to get this in place.
    other ways are;
    XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping - /people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping
    Dynamic name in the mail attachment - pseudo "variable substitution" :
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution

Maybe you are looking for