Filename of a attachment: *.csv XML IDOC

Hi folks,
our scenario is:
1. are receiving mails with a csv file as an attachment
2. we use a senderChannel with the Mail adapter to get the mails
3. we swap the mail content with the attachment with localejbs/AF_Modules/PayloadSwapBean
4. we transform the "attachment" to XML with
localejbs/sap.com/com.contentmaster.CMTransformModule/CMTransformBean
5. we use the mail adapter
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
My question:
We need the filename in SAP but I have no idea how I can get the filename after the swap. Is it possible to get the filename and how can I integrate the filename into the XML or IDOC?
Andreas Solf

Hello again,
still searching for a solution.
The payload data are:
Content-ID: <[email protected]>
Content-Type: application/octet-stream;name="filename.csv"
Content-Disposition: attachment;filename="MailAttachment-1.bin"
Content-Description: MailAttachment-1
<?xml version="1.0" encoding="UTF-8"?>
How can I get the filename out of the headerdata to include it into the XML.
Cheers Andreas
P.S. I start my first steps in XI and I'm not a XI professional. So please send me a step by step solution.

Similar Messages

  • CSV to IDOC

    Hi friends,
    My scenario is CSV to IDOC. Everything is ok but in MOIN payload main document my structure is not right way.
    My original structure :20110929,20110929,GR/GI Slip No.,Header Text,ABCD,MIGO,Massdata..Like this ..But in XML it will appears like Below.  Help me friends.
    - <Header>
      <DocumentDate>,2011092</DocumentDate>
      <PostingDate>9,201109</PostingDate>
      <RefDocNumber>29,GR/GI Slip</RefDocNumber>
      <DocHeaderText>No.,HEADER</DocHeaderText>
      <BillOfLading>TEXT</BillOfLading>
      <CurrentTcode>,ABC</CurrentTcode>
      <UserName>D,MIGO,M</UserName>
      <CompanyID>ASSD</CompanyID>
      </Header>
    - <Item>
      <MaterialNumber>,NMH-145-P5K</MaterialNumber>
      <Plant>G,10</Plant>
      <StorageLocation>01,</StorageLocation>
      <BatchNumber>0101,9102</BatchNumber>
      <MovementType>360</MovementType>
      <ConsumptionPosting>1</ConsumptionPosting>
      <QuantityInUnitOfEntry>3</QuantityInUnitOfEntry>
      <UnitOfEntry>,3</UnitOfEntry>
      <RecievingIssuingMaterial>11,V,5,EA,NM</RecievingIssuingMaterial>
      <IssuingPlant>H-14</IssuingPlant>
      <IssuingStorageLocation>5-P</IssuingStorageLocation>
      <IssuingBatch>5KG,1001,</IssuingBatch>
    Thanks
    hari

    hi Hari,
    I am not sure how your input file structure is .. however, here i assume you have one header and several item fields in your file. If this is the case, use the following content conversion :-
    xml.recordsetstructure = Header,1,Item,*
    ignoreRecordsetName=true
    Header.fieldSeparator = ','
    Header.fieldNames= DocumentDate,PostingDate,RefDocNumber,DocHeaderText,BillOfLading,CurrentTcode,UserName,CompanyID
    Header.endSeparator='nl'
    Item.fieldSeparator = ','
    Item.fieldNames=MaterialNumber,Plant,StorageLocation,BatchNumber,MovementType,ConsumptionPosting,QuantityInUnitOfEntry,UnitOfEntry,RecievingIssuingMaterial,IssuingPlant,IssuingStorageLocation,IssuingBatch
    Item.endSeparator='nl'
    If you are getting an error please paste your error here from cc monitoring or moni
    Regards,
    ninu
    Edited by: NinuPSankar on Oct 13, 2011 12:37 PM

  • XML IDoc file to IDOC .

    Hi,
    I am receiving XML idoc (Orders05) file from 3rd party to PI system , PI needs to create sales order IDoc ( Orders05) in ECC system. 
    1) Do I need to create source structure for XML IDoc file ? If yes should I create the structure as Orders05 ?
    2) How to map line items of xml file to Orders05 IDoc line items ?
    Please help.
    Thanks - Vinay.

    Hi Vinay,
    Please see Mikes reply in this thread. You may follow the same procedure:
    XML to FlatFile IDOC
    Regards,
    ---Satish

  • Problem in attaching a xml file in Email Notification

    Hi,
    I am new to BPEL. I am using 10.1.3.4 Jdev. Facing a problem in attaching a xml file in Email Notification process. I do not get any email when ever the attachment is a xml. Whereas when the attachment is a pdf, i get the pdf in the mail. I have put the mime type as text/xml. Used ora:doc() to read the xml. Dont know what i am missing. Please help me out. Thanks.
    Edited by: friendsforever on Oct 6, 2010 1:05 AM

    actually i want that when a user open my website register form then he must attached their resume in it
    so i want to know how can i make a field of attaching.
    please reply
    I am waiting for your reply

  • Create XML-IDOC from outgoing invoice data

    Hi!
    A customer would like to get informations from our invoice with XML. The XML-file should be a XML-IDOC. Can I create this file by printing the invoice?  Is there a function module to create the XML?
    Thanks
    Markus

    >
    Markus Deutschmann wrote:
    > Can you explane your solution a little bit more?
    > Wher ecan I create a XML-Port?
    Check tcode for creating ports : WE21.

  • XML IDOC post to R/3 Via WAS - want to see error content with JavaScript

    Hi,
    I am posting XML IDOCs to our R/3 system via a webpage that I have built with JavaScript.  I am posting to the WAS, which is configured to read the XML IDOC with SAP's standard class handler CL_HTTP_IDOC_XML_REQUEST.  We are on basis 620 support pack SAPKB62041.
    In my webpage, I have the JavaScript code set to read the status and statusText so I can see the response from WAS when I post my XML IDOC.  However, I am getting back very generic information when I encounter a 409 error.  THe statusText is always "input_not_found".  So I debugged the class handler code and found that SAP is returning back the more descriptive error info in HTML format.
    I ran a packet sniffer to see what WAS returns and the info looks like this:
    <html><head><title>IDoc-XML-inbound not ok</title><h1>IDoc-XML-inbound not ok</h1></head><body>
    E:Table Lookup Error:300 Cannot map value for field MESCOD in table ZFI_IF_IDOCORG using values
    SNDSAD = |TE|  and RCVLAD = |GL|  and MESTYP = |ACC_DOCUMENT|</body></html>
    I want to know how I can get my webpage to read this HTML info and store that into an alert so I can read this text that I'm returning back to the HTTP post.
    This is how my script looks.  I'm using IE6.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>Test XML</title>
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
    <!--
    function XMLHTTPButton_onclick(DataToSend) {
         var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
         xmlhttp.Open("POST","http://some_server:1089/sap/bc/zxml_idoc?sap-client=200&sap-language=EN",false);
         xmlhttp.setRequestHeader("Content-Type", "text/xml");
         xmlhttp.send(DataToSend);
            alert(xmlhttp.Status);
            alert(xmlhttp.statusText);
         alert(xmlhttp.responseXML.xml);
    //-->
    </SCRIPT>
    </head>
    <body>
    <BR>
    This page posts to
    <BR>
    http://some_server:1089/sap/bc/zxml_idoc?sap-client=200&sap-language=EN
    <FORM name=xmlform method=post >
    <P><TEXTAREA style="WIDTH: 623px; HEIGHT: 369px" name=xmlData rows=23 cols=77>
    </TEXTAREA>
    <P>
    <INPUT type="button" value="Submit XMLHTTP" id=XMLHTTPButton name=XMLHTTPButton
    LANGUAGE=javascript onclick="return XMLHTTPButton_onclick(document.xmlform.xmlData.value)">
    </form>
    Previously with this class handler, SAP returned the detailed info back to the "alert(xmlhttp.statusText)" and I had no problem seeing the return info.  But now they have decided to format it in HTML and I don't know how to view this text since it has no ID on it to pull this into an alert box.
    If anyone has any ideas, please let me know.
    Thanks,
    Andrea

    Ok!
    I have solve the problem. So, I was trying to connect via SSO within an user that was not registered in R/3 and I forgot it.
    Sorry for the inconvenience.

  • Read filename of email attachment for sender mail adapter

    Hi All,
    We have a requirement to read filename of email attachment received from Sender email adapter and send details to SAP by Proxy call.
    Can we retrieve the filename of email attachment ?
    Any help on this will be really useful.
    Regards,
    Ashish

    Hi,
    >>>Can we retrieve the filename of email attachment ?
    Please see the below link, it might be useful to you.
    http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
    Regards,
    P.Rajesh

  • How to get filename from mail attachment

    Hi all,
    I have a XI scenario Mail->XI->RFC. I have created my own adapter module which handle all attachments from incoming mail.
    Everything work fine, but in my module I try to get information about filename of mail attachment. I use getContentType() metod to get the filename but this method return only the mimetype of the document. The getDescription() method return olny string "mail attachment". I need to get the original filename of the attachment or at least the file extension. 
    Is it possible to get the whole filename from mail attachment?
    Thanks
    Peter

    Hi,
    You can tryout with adapter modules . You can make use of following Adapter attributes also -
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/bf93409c663228e10000000a1550b0/content.htm
    Similar discussion-
    Email attachment file names
    PayloadSwapBean-
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Regards,
    Moorthy

  • Loading Invoice XML IDoc with digital signature via XI into R/3

    Hi,
    I received an Invoice XML IDoc with digital signature via Mail (for test purposes) and want to load it via XI into an R/3 systeme.
    My idea is to load the Invoice XML IDoc file via the File Sender Adapter into XI and send it to the R/3 system via the IDoc Inbound adapter.
    Due to the digital signature the file looks like this:
    0‚ S      *†H†÷
        ‚ D0‚ @   1 0       +      0‚ '      *†H†÷
        ‚   ‚   ‚ –0‚ ’0‚ û      etc.
    When I load the file like this with the File Sender Adapter, an error message occurs in the XI Monitoring as the XML Parser cannot read the file due to the digital signatur (as expected).
    Has anybody an idea how I can configure the File Sender Adapter Communication Channel to be able to load only the XML IDoc and ignore the digital Signature strings?
    Thanks in advance for your support.
    Alex

    BTW
    do use the second way you need:
    Security Settings for the Sender Mail Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/27/c0524257a1b56be10000000a155106/content.htm
    and
    Key Storage Service
    http://help.sap.com/saphelp_webas630/helpdata/DE/e9/a1dd44d2c83c43afb5ec8a4292f3e0/content.htm
    apart from adapter module config
    Regards,
    michal

  • Mail attachment (.csv) to File (.csv)

    Hi mates,
    I have a requirement where I have to pick the attachment(.csv format) of an incoming mail and store this file ( in .csv format)onto a file server using  a reciever file adapter.
    Please suggest how can i go about it ?

    Jai,
    After changing the transfer mode from text to Binary.
    The XI system is creating a file but the data inside that file is junk. For e.g :
      "  "$"#,##0.00_);[Red]("$"#,##0.00)  7 * 2  ("$"* #,##0);_("$"* (#,##0);_("$"* "-"_);_(@_)  . ) )  (* #,##0);_(* (#,##0);_(* "-"_);_(@_)  ? , :  ("$"* #,##0.00);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)  6 + 1  (* #,##0.00);_(* (#,##0.00);_(* "-"??_);_(@_)à       õÿ            À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à       õÿ   ô        À à
    This looks like when you open a CSV file in a notepad.
    Please help how can i format this data so that it lokks like normal comma seperated form.

  • XML IDOC data (hosted on a web server)   &  handling multiple WSDLs

    Hi ALL,
    1)how to design an Interface for picking up an XML IDOC data (hosted on a web server) which will be uploaded to SAP or converted to a file
    this is what the customer has given me ..can any one explain me this and help me how to more forward
    2).This Interface must use UDDI concept because we are going to use multiple BAPIs /RFCs as WSDLs
    what is this mean can any send me some document on this
    3).Use web-service navigator concept as we will be handling multiple WSDLs
    i worked on 1. to define a place holder in WebAS for holding the
    wsdls.
    2. publish the wsdls in WebAS UDDI Repostory
    but i have never used web-service navigator concept as we will be handling multiple WSDLs what is the difference ..send me some step by step docs ..
    thanks very much
    RK..

    1.I am not clear with the requirement too. THere is no big deal in sending XML to IDOC or File. Based on your requirement you have to import IDOC structure or ify ou are using file, create a structure for the file.
    If u are asking about sendin the XML directly without mapping, even you can do that without MM and even IM.
    Please be more elaborate and if you are not clear with what client said, paraphrase them or ask again. Its not good to start work unless we are very clear with the requirement.
    you can say to my understanding i feel this, now pI will send data like this. Is it correct?
    2. More information on UDDI
    http://en.wikipedia.org/wiki/UDDI
    I dont think you need to worry much about this now with many features provided in ESR especially
    3. http://<Host>:<port>/wsnavigator/
    The webservices going out of PI are published here.
    provide host and port are host and port details of ext system.
    Once you enter link in your browser, it shows the available webservices hosted there.
    All you need is to click on the required wsdl and test it.
    It is as good as sending your data from PI to other system.
    It is similar to Altova XML spy but the difference here is you enter the values directly here but in XML spy we send XML .

  • Attach an xml to a pdf using ADS

    Hi all,
    I have a scenario where we are sending a Base64 encoded PDF (a bill) and the corresponding xml data from SAP backend on level 4.6C to PI 7.1. In PI we should attach the xml data to the PDF. I have already succeeded to do this using iText but we have a requirement to do this with ADS instead. In Netweaver Developer Studio I created an example project where I am reading a PDF as a byte array, also reading an XML file and try to attach the XML to the PDF using the ADS api. The project successfully built in NWDS but when I am running the project it failes.
    I am using standard code to attach the xml stream to the pdf, the error message is thrown when the following line is executed:
    IWDPDFDocument document = context.execute();
    Exception in thread "main" java.lang.ExceptionInInitializerError
         at com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.impl.PDFDocumentAccessibleContextWDImpl.execute(PDFDocumentAccessibleContextWDImpl.java:99)
         at com.eon.xi.dijnet.base64.PdfWithAttachment.addAttachmentWithSap(PdfWithAttachment.java:129)
         at com.eon.xi.dijnet.base64.PdfWithAttachment.main(PdfWithAttachment.java:218)
    Caused by: java.lang.NullPointerException
         at com.sap.tc.webdynpro.services.sal.deployment.core.DeployableObjectInternal.getSystemDeployableObjectName(DeployableObjectInternal.java:53)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.AdobeFormHelper.<clinit>(AdobeFormHelper.java:115)
         ... 3 more
    Is it the problem with the PDF that it is not an Interactive Form?
    Or the problem is simply that I am trying to run the project on my local machine where ADS is not available?
    Thanks for your help.
    Pal
    Edited by: Pal Somogyi on Oct 17, 2010 10:30 PM
    Edited by: Pal Somogyi on Oct 18, 2010 11:44 AM

    Hi Pal,
    There is a requirement to generate an Adobe Form using SAP Interactive forms, and then, send this PDF to a non-SAP system using Base-64 encoding. The receiving system will decode this file and re-generate a PDF.
    I have heard that this could be done in the PI layer, using the Conversion Agent.
    Another approach which I can think of is convert PDF to binary and then use the cl_http_utility=>encode_base64 to convert binary to base64.
    You have mentioned that you have had to send a base 64 encoded pdf. Could you pelase guide me through the process?
    Thanks,
    Preethi.

  • Reading Filename of a attachment

    Hi everyone,
    in the QM03 Transaction I can place some file attachments to the Object. In the attachment window are the attachments listed and with a doubleclick the documents will be opened.  So far so good.
    I can read some informations about the attachments with the   CALL METHOD cl_binary_relation=>read_links and with the 'SWL_GET_OBJECT_INFORMATION'
    function I can read some Information's about the attachments to the object, but not the filename of the attachment.
    How can I get the filename of the attachment?
    Thx in advance.
    Regards Ralf.

    these methods sounds good,the question is,  which value have  these parameters.
    (Classname,client, object_key).
    CALL METHOD cl_bds_document_set=>get_info
      EXPORTING
       logical_system      =
    <b>   classname           =
        classtype           =</b>
       client              =
    <b>*    object_key          =</b>
       check_state         = ' '
    IMPORTING
       connections         =
       extended_components =
    CHANGING
       components          =
       signature           =
    EXCEPTIONS
       nothing_found       = 1
       error_kpro          = 2
       internal_error      = 3
       parameter_error     = 4
       not_authorized      = 5
       not_allowed         = 6
       others

  • Automate flat IDOC to XML IDOC using one interface

    Hello all,
    We are currently going through a migration process where XI will be replacing a legacy system.  As part of our testing procedure, we are using historical data pairings from the legacy system and using an automated tool to compare if the interfaces we develop in XI match.  The catch is we need the data that we are comparing in XML format for the automated tool to be able to do the comparison, and unfortunately the legacy data is a flat format.  So now I would like to automate a way to convert this data to XML format.
    Specifically for IDOCs, I would like to have an interface which picks up the flat files, transforms them to XML, and then drops them back into another file directory in the XML format.  It would need to be able to pick up any kind of IDOC (given that XI has the metadata already imported), recognize what message type it is, then do the conversion.
    I have been reading on SDN and found that there is a standard tool to do the conversion, but it appears it can only handle one kind of IDOC at a time, and it appears it only picks up one specifically named file at a time.
    Has anybody tried to implement a scenario like this?  Any help is appreciated (A walkthrough would be the best!).
    Thanks in advance,
    Mike

    Mike,
    What version of PI will you be using? PI 7.11 can now auto-convert Flat File IDocs to XML IDoc and vice versa.
    Here is the documentation:
    http://help.sap.com/saphelp_nwpi711/helpdata/en/b5/bd93642dd3410f90ebea702399fac4/frameset.htm (flat to XML)
    http://help.sap.com/saphelp_nwpi711/helpdata/en/74/a45bc07e2043fb9b63295229178903/frameset.htm (XML to flat)
    I have not tried this personally, but seems like you might be able to use a "File to File" scenario with no mapping, and use the "IDOCFlatToXmlConvertor" Module in your File Adapter Comms Channel and it may just work, giving you files that are the IDoc XML version of the flat file it is reading. It looks like it does an RFC call to the back-end SAP system where the IDocs are originally from (or could be any system as long as you know the IDocs in there are identical), and reads the IDoc metadata (which has always included flat file field offsets for each IDoc Segment Field), and applies that either to convert from flat file IDoc to XML IDoc, or XML IDoc to flat file IDoc.
    It does mention that there is a limitation that there can only be one IDoc in the source flat file - could be a problem if you have many in one file, which is pretty typical.
    Regards,
    Brendan

  • Receiving binary IDOC via Queue and convert it to XML-IDOC

    Hello,
    we are focusing the following scenario:
    We receive an plain, binary IDOC in a MQSeries Queue. We want to pick it, transform it and place it into R/3 (of course using XI 3.0). Afterwards the other way around.
    I know the Howto for the ABAP mapping from XML-Idoc to plain IDOC. This may also work for our scenario. Do you agree?
    The other way around is more difficult. I assume that - since the IDOC adapter resides in the ABAP stack - we cannot re-use an existant adapter module in the JMS adapter. Right?
    I heared about JCO capabilities of "xmlizing" Idocs - but did not find hints within the javadoc. Anyway, would this really be the preferred way - writing an user exit for the adapter using JCO - to handle this? There must be a way to do it better, must it not?
    How did you guys face this problem - I think its a common one...
    Any starting points for a discussion are appreciated....
    Greets,
    helge

    Hi Helge,
    For the conversion of the incoming flat message, one could imagine a similar ABAP mapping as the one described for the XML->flat message conversion. The function module IDX_IDOC_TO_XML could be a good starting point for your search.
    To perform conversions in the Java stack (e.g. in an adapter module) might be a quite complex task since you first have to get the IDoc metadata. And there you cannot reuse existing function modules.
    Best regards
    Joachim

Maybe you are looking for

  • My HP LaserJet Professional M1132 MFP Is Not Print Or It Offline

    My HP LaserJet Professional M1132 MFP Is Not Print & i think it offline. I Do Not Know What To Do. I Look on google but the things there tell you do not work. I Rest my computer, & I Plug in my printer acdpeter right but it not printer. If There Any

  • How do I make my flash banner change frames on a timer?

    Hello, I'm new to flash and I recently just made a flash banner where you can click buttons to change frames. I also want to add the ability for it to automatically change frames after 7 seconds. I've put all of the pictures on the same frame and gav

  • Burning an iMovie?

    Hi, I just created a movie in iMovie HD, but iMovie does not recognize my Pioneer 111D internal drive. I have had success burning with aftermarket software, but I can't burn from iMovie. iMovie is also looking for iDVD, which, according to Apple, req

  • Help needed get JSF final release running on tomcat 5

    Hi there, I know my topic seems to be a easy thing which is often discusseb but I tell you it's not. And after searching the forum an the web... it's driving me crazy I want to make some development and tests but I can' get my stuff running on tomcat

  • After extracting the SDK I have only examples folder

    I downloaded the sdk and there I can see only examples folder present. Is that all for the SDK?. There is no SDK set up installation. I new to AE plugin development please guide me. Thanks