Dynamic name for attachment in the Receiver Mail Communication Channel

Hi All,
I want to dynamically set the name of attachment in receiver mail Communication Channel.
Example: IN__9907211000004_4048454000005_20081211_01000000002643
The first two numbers 9907211000004 & 4048454000005 I want to read it from the message
20081211 this is the date and
And againg this number 01000000002643 is read from message.
What is the procedure to create Adapter Module? I am new to Adapter Module.
Any Ideas ideas?
Thank You,
Mukhtar

Hi Michal,
I had a look to your blog and tried to modify according to my requirement.
Here is the code
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
@ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>
@ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>
@ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>
@ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>
@stateless
public class SetAttachmentName implements SessionBean, Module{
     private SessionContext myContext;
     public void ejbRemove() {
     public void ejbActivate() {
     public void ejbPassivate() {
     public void setSessionContext(SessionContext context) {
          myContext = context;
     public void ejbCreate() throws CreateException {
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
                      throws ModuleException{
     try {
Message msg = (Message) moduleData.getPrincipalData();
//creating parsable XML document
InputStream XIStreamData = null;          
XMLPayload xmlpayload = msg.getDocument();
XIStreamData = xmlpayload.getInputStream();
DocumentBuilderFactory  docBuilderFactory = DocumentBuilderFactory.newInstance();               
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(XIStreamData);
//finding the tag's name from the Modules tab in the Directory that will hold the attachment's name
String SenderIDTag = null;
SenderIDTag = moduleContext.getContextData("SenderIDTag");
//finding the content of the tag that will be used as the attachment's name (assuming it's the only tag with this name)
Element element = doc.getDocumentElement();     
NodeList list = doc.getElementsByTagName(SenderIDTag);
mailFileName += "_" + list.item(0).getFirstChild().toString();
String anIDTag = null;
ReceiverIDTag = moduleContext.getContextData("ReceiverIDTag");     
element = doc.getDocumentElement();     
list = doc.getElementsByTagName(ReceiverIDTag);
mailFileName += "_" + list.item(0).getFirstChild().toString();
Date date= new Date(System.currentTimeMillis());
//Add date to the Message
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyyMMdd");
mailFileName += "_" + dateFormat.format(date);
String BillNrTag = null;
BillNrTag = moduleContext.getContextData("BillNrTag");     
element = doc.getDocumentElement();     
list = doc.getElementsByTagName(BillNrTag);
mailFileName += "_" + list.item(0).getFirstChild().toString();
//creating the attachment
byte by[] =  xmlpayload.getText().getBytes();
XMLPayload attachmentXML = msg.createXMLPayload();
attachmentXML.setName(mailFileName);
attachmentXML.setContentType("text/pdf");
attachmentXML.setContent(by);
//adding the message to the attachment
msg.addAttachment(attachmentXML);
        inputModuleData.setPrincipalData(msg);
    } catch (Exception e) {
        throw new ModuleException(e);
    return inputModuleData;
I hope this is right Adapter Module coe for my requirement.
Thank you in Advance,
Mukhtar

Similar Messages

  • JMS ReplyTo Queue Name parameter in the receiver JMS communication channel

    Hi All,
    Can any please explain the use of JMS ReplyTo Queue Name parameter in the receiver JMS communication channel?
    Thanks
    Karthik.

    Hi karthik,
    JMS ReplyTo Queue Name parameter  is used for Specify the name of the queue to which the responses are to be sent.
    Thanks
    Govind.

  • Dynamic name for attachment in User Decision

    Hi...
    I have a requirement wherein the name of the attachment in the user decision has to be populated dynamically. I am using the same BO method for user decision but is triggering 2 different objects. Please advice on how to achieve this.
    Scenario - I am using BUS2081 for Invoice and for Credit Memo. If the credit memo is created, the approver has to see the name of the attachment as Credit Memo xxxx and if an invoice is created, he has to see the attachment as Invoice xxxx. As standard, whatever object is created, the attachment name is Incoming Invoice xxxx (name of the BO Object Bus2081).
    Warm Regards,
    Jubish Jacob

    The object name is static but the default attribute can be changed (use a z-subobject and delegate back) so you can do something like this: instead of: incoming invoice(object name) 12345(invoice number - default attribute) you will have document(new object name) incoming invoice/credit memo 12345(document type & number concatenated - a new default attribute)
    Another option - I think credit memos have an object (BUS2094) or you can create one - in the task have both object types in the container, when its a credit memo transfer only the credit object when it's an invoice transfer only the invoice object.

  • Variable file name through Receiver mail Communication channel

    I need to send a file through receiver communication channel   with the following name ( YYMMDD schema)  . The YYMMDD is current date .  I know how to create these file names throug FCC ( file communication channel) , I tried in the same manner to create this file through Receiver Mail CC , but it did not work  .  If you have any ideas , can you please share with me ?
    ABC_MMYYDD.TXT
    Thanks.
    Ritvik

    Hi Ritvik,
    Also, Please look at this link and see if it helps you. It is generating variable file name through a UDF
    Re: Problem in dynamically file name generation procedure
    Best Regards

  • Receiver SOAP Communication channel -- Target URL

    Hi Experts,
    Can anyone provide some inputs for my below question?
    How the receiver SOAP Communication channel internally calls the Target URL?
    What is the internal process behind this call?
    I would really appreciate you all if could provide answers.
    Thanks & Regards,
    Prabu Muthu

    Hi...
    To be able to send SOAP messages from the Integration Server/PCK to remote clients or Web service servers, you must first configure the receiver SOAP adapter. The receiver adapter supports system acknowledgments but not application acknowledgments
    Find the below link .
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40611dd6-e66e-2910-f383-e80fb44f9cd4
    Regards,
    Leela

  • When I send or receive e-mails, the icon showing that there is an attachment with the e-mail may or may not appear. I have spoken to Apple and they cannot fix.

    When I send or receive e-mails, the icon showing that there is an attachment with the e-mail may or may not appear. I have contacted Apple and they do not have a solution for this issue. This is a huge problem for me.

    No, the senders are in most case sending from corporate servers which are almost certainly not Mac based. Also, remember this happens when I send or receive. So if I send something with an attachment, the attachment will go through, but the sent box will not show the paper clip icon so that I can distinguish the emails sent with attachments versus the emails sent without attachments. I receive the attachments as well, but again the paper clip icon does not show up so that I can distinguish the emails that I have received that contain attachments. Recipients of my e-mails have complianed that when they receive an attachment from me they do not see the paper clip icon which alerts them to the fact that the email contains an attachment.

  • Dynamic name for the physical table

    Hi Guys,
    How to setup dynamic names for the physical table? Where it is useful?*
    Pls help me out on this.
    thanks

    Check this similar post which might be of help dynamic physical table source schema
    Cheers,
    KK

  • Whenever I send an e-mail with my yahoo account which is also my apple ID a small icon (personal) picture is attached to the e-mail. How do I remove this picture from being attached to all of my outgoing messages?

    Everytime I send a message from my yahoo account (which is also my appleID account) a small icon picture (which is a pic of my ex-boyfriend) is attached to the e-mail heading.  I'm able to notice  I want to remove this from happening. The picture is displayed on my iphone when I open up the mail.
    Steps I take:
    1. I write an e-mail message from my yahoo account to my other .edu account on a desktop computer.
    2. I send the e-mail message from my yahoo account to my other .edu account on a desktop computer.
    3. When I open up my .edu account on my iPHONE, there is a new message from my yahoo account.
    4. Upon opening the e-mail message on my iPHONE, in the title heading it has the title of the email along with a small (upper right) picture on the iPHONE.
    Another thing that I tested was the same thing on my iPAD for text messages:
    1. I set up my text messages to my yahoo account (which is also my apple ID account)
    2. I send a text message to a person and the same small icon picture is shown on the ipad with each message that is sent
    3. The person receiving the text message does not get the small icon picture; however, on the ipad it shows this picture (WHICH NEEDS TO BE REMOVED)
    I need to determine how this icon picture is associated with both my yahoo and apple ID account. The funny thing is that I don't have this picture on any of my devices (mac, iphone, ipad). It has been completely removed from all of my technology sources. I'm thinking it has to be something to do with the origniation of my apple ID.
    PLEASE HELP ME....this picture is hurting my professionalism when I send outgoing messages.
    Thanks.

    search google for "iphone remove picture from contact"

  • How can I put a facebook logo in my signature block without it appearing as an attachment to the receiver of the email?

    How can I put a facebook logo in my signature block using the mail program without it appearing as an attachment to the receiver of the email?

    Not sure what OS you're on, but...
    Might see if this helps...
    http://allforces.com/2006/04/14/css-signatures/

  • Dynamic Name for Yellow Interface Table

    Hi All,
    Can anybody guide me how to use dynamic name for Yellow Interface Target Table.
    Eg: T_SESSIONID.
    I tried
    1)Refreshing the SESSIONID in a Variable V1 and using T_#V1 directly
    2) Refreshing the T_#V1 in a Variable V2 and using #V2
    But its not creating properly.
    Please guide.

    You want to create dynamic target table name right?
    You can refresh a variable like #GET_SESSION
    #GET_SESSION= SELECT <%=odiRef.getSession("SESS_NAME")%> FROM DUAL
    My tmp table name like TMP_#GET_SESSION
    then in your package refresh #GET_SESSION variable and you can use it.
    I hope this can be helpful
    Thanks

  • When deleting a user created folder from On My Mac in Mac Mail the sent messages that are part of conversations that reside there are not deleted, only the received mail gets deleted.

    When deleting a user created folder from On My Mac in Mac Mail the sent messages that are part of conversations that reside there are not deleted, only the received mail gets deleted. Any way for both the received and sent mail that resides there to be deleted?
    I create a lot of project folders where i keep all my conversations regarding the project. Once the project is finished i would like to just delete the folder and get rid of all the emails associated with it but when i delete the folder i've noticed that only received messages are deleted. Now I am stuck trying to sort through my sent folder for messages that were returned there after the conversations was supposedly deleted.

    Mail/Preferences/Viewing - un-check include related messages, delete the folder, then go back and reset yo include.

  • How to send concurrent program output file as an attachment in the notification mail

    Hi All,
    We are on Oracle apps version - 11.5.10.2
    We have a requirement wherein we need to send the concurrent program output file as an attachment while sending the notification mail to the user.
    Currently we have tried the approach wherein we are specifying the user id in the OPTIONS tab (Notifying the following people) while submitting the concurrent program.
    But using this approach, the user gets only the URL of the output file in the notification mail and not the output file as an attachment.
    Kindly let us know if anyone has incorporated the logic to send the output file as attachment in the notification mail.
    Please Note - We do not want any custom code to be written to send the attachment.
    Any pointers to this will be helpful.
    Regards,
    Shruti

    Hi All,
    We are on Oracle apps version - 11.5.10.2
    We have a requirement wherein we need to send the concurrent program output file as an attachment while sending the notification mail to the user.
    Currently we have tried the approach wherein we are specifying the user id in the OPTIONS tab (Notifying the following people) while submitting the concurrent program.
    But using this approach, the user gets only the URL of the output file in the notification mail and not the output file as an attachment.
    Kindly let us know if anyone has incorporated the logic to send the output file as attachment in the notification mail.
    Please Note - We do not want any custom code to be written to send the attachment.
    Any pointers to this will be helpful.
    Regards,
    Shruti

  • I've forgetten my password ID and I can't restore it though you send me an e\mail for it but the e-mail isn't arrive to my account at all. what am I suppose to do in order to restore my password ID?

    I've forgetten my password ID for ([email protected]) and I can't restore it though you send me an e\mail for it but the e-mail isn't arrive to my account at all. what am I suppose to do in order to restore my password ID?

    http://iforgot.apple.com

  • Monitoring receiver idoc communication channel

    Hi All
    I have an idoc to idoc scenario.
    I am unable to see my receiving idoc communication channel in communication channel monitoring of RWB. It is not available in the dropdown list.
    I want to have a look at the audit log to see if the idoc is delivered to the receiving system.
    How can i monitor receiver idoc communication channel?
    How can i ensure that the idoc is delivered to the receiving system?
    In sxmb_moni, status is checkered flag.
    Many Thanks
    Chandra Sekhar

    Hi,
    IDOC is on ABAP stack hence u can not monitor IDOC.
    For testing purpose
    1) GO to SXMB_MONI check the status of message.
    2) Go to R3 and enter Tcode WE02 and check the IDOC which is send from XI. enter the idoc name and see the status of IDOC it should be in green status if it is posted successful or else see the status record for checking the error message.
    chirag

  • Schedule Receiver RFC communication channel to call R3 RFC-FM.

    Hi,
    I have requirement that I need to schedule/trigger from PI to RFC call R3 function module. Wonder if anyone here has done similar thing before? I tried to use ATP (Availability time planning) in RWB. But this seem does not success for me as there is no response and error message for this.
    Below is my configuration detail:
    Configured:
    1. Receiver communication channel - RFC
    2. Receiver agreement with the RFC message type assigned.
    3. Scheduled receiver RFC communication channel via ATP daily
    *(It is possible to make scheduling job in R/3 but we are not considering this way)
    Please let me know if anyone has done this before or any other suggestion to do the scheduling from PI.
    Thanks!
    Regards,
    SP

    Hi SP,
    As you mentioned, ATP would allow adapter to be open and in start state. Adapter's RFC, SOAP, JMS would need some other application to trigger the message processing because these are not like pooling adapter's File, JDBC and Mail. RFC adapter channel always listening to the RFC port and FM execution. Once FM from R/3 executed then the RFC adapter would trigger it's message processing.
    For Sender RFC channel: In order to trigger the RFC adapter execution at particular time then you should write a simple ABAP code which would act a batch application and which does the triggering the FM and Sender RFC channel.
    For Receiver Channel: For Receiver RFC channel it's bit trichy because here you have force Receiver RFC adapter to connect backend the execute or initialize the variables without having any XI message triggered from Sender PI channel.
    I have 2 ideas:
    1. A little difficult approach, similar to the ABAPbatch code, you need to write a java adapter module which can trigger RFC receiver channel to connect and do an initialisation at FM at regular interval.
    2. Simple approch configure a File-> 2-> RFC receiver scenario, configure File sender adapter to pick a dummy file at regular interval and RFC receiver channel does the rest.
    Please let me know still you have any doubts,
    Thanks,
    RK

Maybe you are looking for