Controlling filenames using PayloadZipBean

Hello
I am struggling with names of the zipped files using payloadzipbean. The Scenario is as follows: we want to transfer an invoice including attachments to an external partner consisting of an xml message and one or more pdf files as attachments. the attachments are added to the message in an ABAP proxy on the sending R/3 system. The message is transferred to PI,where it si routed to an ftp communication channel. The xml message is zipped using the payloadzip bean and transferred to the external partner using ftp. The partner requires an approriate file extension to identify the types of files on the receiving side. Originally we managed this pay using the parameter zip.filenameKey and set it ContentType. The files inside the zip file are then named "untitled.xml" for the xml message and "untitled.pdf" for the attachments. However when there is more than one attachment the zipping of the file crashed, as both attachments have the same filename. We can fix this by adding an unique name to the attachment when it is attached to the proxy, and changing the zip.filenameKey to payloadName. The problem then is that the main payload file is called MainDocument without the .xml extension. I need to change the name of the payload or find another way to make the attachment filenames unique with zip.filenameKey set to ContentTyoe, Any suggestions ?
Eivind Langsæter

it is a bit tricky.
You might have to code a module to build the attachments and then use zipbean to zip it for you.
to set the name of the main document you can have a look into the sinppet of code below;
Vector_attachementFileName contains the name for the attachment
attachmentFileMainPayload has the data of the main payload
XMLPayload MainDocumentPayload = message.createXMLPayload();
        MainDocumentPayload.setContent(
          this.attachmentFileMainPayload.getBytes());
        message.setDocument(MainDocumentPayload);
        Audit.addAuditLogEntry(
          this.auditMKey,
          AuditLogStatus.SUCCESS,
          "Main Document Successfully Set");
        TextPayload txtpayload = message.getDocument();
        txtpayload.setContentType("text/plain");
        txtpayload.setName(
          this.Vector_attachementFileName
          .elementAt(lengthOfVector - 1)
          .toString());
        Audit.addAuditLogEntry(
          this.auditMKey,
          AuditLogStatus.SUCCESS,
          "File Created: " +
          this.Vector_attachementFileName
          .elementAt(lengthOfVector - 1)
          .toString());

Similar Messages

  • Can I control  filenaming when archiving  files using the file adapter?

    Hi folks,
    Is there anyway to control the filename used when the File Adapter writes out to an archive?
    Second question, I also need to be able to pass a "filename" to the adapter from an "input file." Is there a way to do this in the file adapter?
    Sincerely,
    lpac

    Hi,
    I have done that with the ftp adapter. In the .xsl file I wrote the following after the <xsl:stylesheet version="1.0" ....> tag:
    <xsl:variable name="INFILENAME" select="ehdr:getRequestHeader('/fhdr:InboundFTPHeaderType/fhdr:fileName','fhdr=http://xmlns.oracle.com/pcbpel/adapter/ftp/;')"/>
    <xsl:template match="/">
    <xsl:variable name="OUTFILENAME"
    select="ehdr:setOutboundHeader('/fhdr:OutboundFileHeaderType/fhdr:fileName', $INFILENAME, 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/>
    <opaque:opaqueElement>
    <xsl:value-of select="/opaque:opaqueElement"/>
    </opaque:opaqueElement>
    </xsl:template>
    </xsl:stylesheet>
    To use this with the file adapter, you would have to wirte file where is written ftp.
    Hope this helps,
    Zaloa

  • Unzip file using PayloadZipBean in Sender FILE adapter

    I am trying to unzip a flat file in Sender FILE adapter using PayloadZipBean.
    I am getting mapping error. The problem is File adapter is reading data without unzipping. I am getting weird characters/data, so mapping error.
    I searched all the blogs/ forum threads and help.sap.com, everywhere the focus is on zipping, not unzipping.
    the file I have is with .gz extension, but I tried with .zip extension also.
    Please help in resolving this issue.
    Edited by: Gopal Janagama on May 2, 2008 11:42 PM

    Gopal,
    GZIP and ZIP format are slightly different, as stated here :
    "GZIP compresses only one file and does not have a header. ZIP contains header information about what files are contained in the file."
    So I'm not sure the PayloadZipBean supports GZIP format ... Try to ungzip and then zip its content and see if the bean works for it
    Rgds
    Chris

  • My Bluetooth USB wireless transmitter for my portable speakers has quit working.  Preferences says, "The selected device has no output controls", it used to work just fine.  Can anybody help?

    My Bluetooth USB wireless transmitter for my portable BT speakers has quit working.  Preferences says, "The selected device has no output controls", it used to work just fine.  The internal and a pair of wired external speakers work fine.  Can anybody help?

    Just tested something and it worked.
    If I put the headphones all the way in, the mac recognizes it as a digital output.
    But if i don't put it all the way in, it recognizes it as headphones and works perfectly.
    It's probably this crappy headphones.
    If anyone has the same problem, try this out.

  • Have an airplay enabled AV Receiver - how do i set up Airplay    I have a Yamaha RX-V673 which is Airplay enabled, but i can't get Airplay to work either on my Mac book or my iphone. The receiver is connected to my network and i can control it using the

    have an airplay enabled AV Receiver - how do i set up Airplay
    I have a Yamaha RX-V673 which is Airplay enabled, but i can't get Airplay to work either on my Mac book or my iphone. The receiver is connected to my network and i can control it using the iphone App and via the web browser option.
    Do I need Apple TV or to change some settings somewhere?
    Any help would be greatly appreciated

    You are making some progress with setup of wireless network. Apparently there is reliability problem with the wireless connection. Perhaps you want to refer to following Apple support documents and start tweaking parameters in the router to improve the reliability. I used to have third-party routers such as Belkin and Netgear but switched to Apple Airport routers (Time Capsule then Airport Extreme for now) because of incompatibility issues whenever Apple upgrade Mac OS X. But since Apple develops Airplay protocol as alternative to Bluetooth for wireless audio/video streaming (with much better bandwidth) and must be deployed in any wireless network, there is no reason third-party routers not working for Airplay protocol.
    About AirPlay Mirroring in OS X Mountain Lion:
    http://support.apple.com/kb/HT5404
    iOS: Recommended settings for Wi-Fi routers and access points:
    http://support.apple.com/kb/HT4199
    Troubleshooting AirPlay and AirPlay Mirroring:
    http://support.apple.com/kb/TS4215
    Good luck in setting up 802.11 wirelesss network.

  • Appending a creation date/time stamp to a filename using MS Command Language

    I need to access the creation date and time of an existing file and then append that date/time to the filename using MS command language in a .bat file.  The code executes on a Windows server.   I'm looking at different options for doing
    this.  I know it can be done using MS Powershell scripting.  Any other suggestions appreciated.  Thanks

    I tested the answer you supplied here:
    http://social.technet.microsoft.com/Forums/en-US/38873a13-f3f2-40f2-bb96-c1c63722caab/adding-a-datetime-stamp-to-a-file-using-ms-command-language?forum=winserverpowershell
    and it worked.
    Richard Mueller - MVP Directory Services

  • The CC control panel use to show my 4 applications CC, CS6, LR5 and Bridge, now LR5 is no longer showing up. I pay for the photographer bundle, which includes LR5 and CC, why has it been dropped off? Is there any way to bring it back in the panel, because

    The CC control panel use to show my 4 applications CC, CS6, LR5 and Bridge, now LR5 is no longer showing up. I pay for the photographer bundle, which includes LR5 and CC, why has it been dropped off? Is there any way to bring it back in the panel, because in the listed applications which can be added below it is not listed.  Thanks!

    If you're a paying Creative Cloud member, you may not see Lightroom in the Creative Cloud if your computer doesn't meet the minimum system requirements. Check to make sure that your system meets the minimum requirements for the latest release of Lightroom.
    If you're using a trial version of Creative Cloud, the Lightroom trial is not available through Creative Cloud. It is, however, available as a stand-alone trial. See Install Lightroom trial | Creative Cloud membership. 
    Please refer to : Lightroom and Creative Cloud FAQ
    Regards
    Rajshree

  • Change Filename using XSLT mapping without variable subtitution

    Hi,
    My scenario is IDOC to file...i am using XSLT mapping, i want to change the filename format to OUT_<Purchase Number>_<DDMMYYYYhhmmss>_KKKK.txt, i cannot use UDF function as i do XSLT mapping i also i cannot use variable substitution as the target structure doesn't have PO and timestamp as tag elements. Can i acheive using writing a adapter module? I appreciate if anyone could help me with this..
    Many thanks

    >
    Ravibabu Adari wrote:
    > Hi,
    > If i go with Option1: what changes i need to do in the file adapter to tell the adapter to pick the filename from XSLT ?
    > If i go with Option2: To which element to the target structure should i map the filename using UDF ? do i have to add additional element to the target structure? what changes i need to do in the file adapter to tell the adapter to pick the filename from Message mapping ?
    >
    > Many thanks
    Hi,
         in both cases you need to enable file adapter specific properties and enable the file name...
    for this you need to use the dynamic configuration properties for the same...
    usage of this option using udf in message mapping is rather easy than to use in XSLT...for this you dont need to change the structure in the message mapping...message mapping is just needed for execution of the udf.. thats it..
    HTH
    Rajesh

  • Unzip using PayloadZipBean

    Hi,
    I was looking to use PayloadZipBean module to unzip a zipped file with three text files inside.
    From the receiver adapter Audit log files, I see that the PayloadZipBean,is unzipping all the three files(first file as main payload and rest of the two files as additional payloads), but while writing the files, it only writes one file with the Main Payload content and the file name from File Name Scheme parameter.
    In module configuration, i gave name as zip.mode and value as unzip. Are there any other parameters where we can specify the names for additional files and also how do we extract other two files.
    Already looked at 'SAP Note:965256 - XI 3.0 Adapter Framework Zip Module' where not much information is available on unzipping piece.
    Thanks in advance.
    Pradeep

    I dont think you can use all the unzipped files as payloads. You might want to crate two scenarios where it writes all the unzipped files to disk (using receiver file adapter) then another file to X scenario as per your requirement.
    VJ

  • Error while using PayloadZipBean module

    hi,
    For sending the data in zipped format in JDBC Adapter i used "PayloadZipBean" module.
    While Communication channel Monitoring at Receiver end I am getting this Error:--
    "Message processing failed. Cause: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at loacalejbs, the whole lookup name is localejbs/loacalejbs/AF_Modules/PayloadZipbean."**
    Is there any need to write this module in adapter engine?

    Hi,
    Have a Look at these
    Working with the PayloadZipBean module of the XI Adapter Framework
    Zip-Transfer-Unzip: Increase the performance of your Java-ABAP applications
    Regards
    Seshagiri

  • Unzip using Payloadzipbean/file content conversion

    Experts,
    I have a scnario, I get a zip file with .gz extension, unzip it read th file using file adapter.
    I am using Payloadzipbean module to unzip(zip.mode = unzip).
    The problem is File adapter converting the zip file into xml and unzipping the file.
    How do I force File adapter to unzip first and do content conversion.
    thanks

    Hi man.
    How did you solve this. I have to pick up a zip file with a .txt file then I need to convert this file to xml with module MessageTransformBean but Im getting this error:
    com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
    This is my structure
    row (1..n)
    >TRANSPORTES (1)
    >ENTREGAS (1..n)
    I have configured the module tag in this way:
    AF_Modules/PayloadZipBean - zip
    AF_Modules/MessageTransformBean - transform
    CallSapAdapter - 0
    zip - zip.mode - unzip
    transform - Transform.Class - com.sap.aii.messaging.adapter.Conversion
    transform - xml.ENTREGAS.endSeparator - 'nl'
    transform - xml.ENTREGAS.fieldFixedLengths - 1,30
    transform - xml.ENTREGAS.fieldNames - TIPO,NUM_ENTREGA
    transform - xml.ENTREGAS.keyFieldValue - E
    transform - xml.TRANSPORTES.endSeparator - 'nl'
    transform - xml.TRANSPORTES.fieldFixedLengths - 1,30
    transform - xml.TRANSPORTES.fieldNames - TIPO,NUM_TRANSPORTE
    transform - xml.TRANSPORTES.keyFieldValue - T
    transform - xml.keyFieldType - CaseSensitiveString
    transform - Transform.ContentType - text/plain;charset=utf-8
    transform - xml.conversionType - StructPlain2XML
    transform - xml.documentName - MPrueba_Zip
    transform - xml.documentNamespace - http:/XXXXXX.es/XXXX/sap/prueba
    transform - xml.keyFieldName - TIPO
    transform - xml.processFieldNames - fromConfiguration
    transform - xml.recordsetName - row
    transform - xml.recordsetStructure - TRANSPORTES,1,ENTREGAS,*
    If I use only the MessageTransformBean directly from .txt everything works ok!!!
    What am I doing wrong???
    Thanks a lot!!!

  • Control the use of material code

    Hi there,
    which field of the DB table MARA (or whichever) controls the use of material as sales code and manufacturing code - DISST? Like STLAN of the structue RC29N.
    The request is to list all material codes with its "flag" to build a list of 2 columns:
    Sales material code >< Parcel code/lower item
    Thanks for your inputs
    RB

    I found it. EXIT_SAPLV01Z_001 does the trick. A package contains many User-Exits, BADIs and enhancement points, so it took me a while to go thru all of them.

  • Change the value of a SharePoint List lookup control value using javascript

    hi,
    could you please help in changing the value of a SharePoint List lookup control value using javascript.
    Please note that i have to change the lookup value which is in the form of a drop down from the infopath form.
    Thanks

    https://stackoverflow.com/questions/5678210/select-dropdown-menu-option-with-javascript
    Does that help?

  • How can I control instrument using its RS232 port in VB or VC++?

    1)How can I control instrument using its RS232 port in VB or VC++?
    2)What's the module or .h file need I add-in to VB or VC++?
    3)Can you provide me some easy examples for that?
    Thanks!

    Kevin,
    I've used Measurement Studio - Tools for Visual Basic and Tools for Visual C++ (ActiveX component) for instrument control.
    I've used both the VISA and non VISA versions and they are pretty straight forward to use for GPIB, Serial or VXI.
    You might find the following page useful.
    http://www.ni.com/mstudio/cworks.htm#ICC
    Regards,
    Kamran

  • How do I turn off the requirement to press control when using a function key

    When using my wireless keyboard, it requires me to press controls to use the function keys (F3, F5, F70.) However, this makes it so some of my games controls won' work,(For example, in Minecraft I can't access the debug menu.) Is there any way to disable this.Thank you for your support

    Please take these steps if you're prompted for a password when moving items in your home folder to the Trash.
    1. Triple-click anywhere in the line below on this page to select it:
    ~/.Trash
    2. Right-click or control-click the highlighted line and select
    Services ▹ Show Info in Finder (or just Show Info)
    from the contextual menu.* An Info dialog should open.
    3. The dialog should show "You can read and write" in the Sharing & Permissions section. If that's not what it shows, click the padlock icon in the lower right corner of the window and enter your password when prompted. Use the plus- and minus-sign buttons to give yourself Read & Write access and "everyone" No Access. Delete any other entries in the access list.
    4. In the General section, uncheck the box marked Locked if it's checked.
    5. From the action menu (gear icon) at the bottom of the dialog, select Apply to enclosed items and confirm.
    6. Close the Info window and test.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. Open a TextEdit window and paste into it (command-V). Select the line you just pasted and continue as above.

Maybe you are looking for

  • Queue propagation error---ORA-23603

    Hi Experts, I got lots of error as ORA-23603: STREAMS enqueue aborted due to low SGA for Destination "STRMADMIN"."STREAMS_APPLY"@sale2.net. However, destination SGA taeget and Max as 2552M. and source target/Max SGA is 1888M. In source database EM, I

  • Critical Error in the Enterprise Server

    I am having a critical error in my process in the Enterprise Server.. It works fine inside Studio.. The following is the error:- Error while persisting the transaction data: 'An error occurred while accesing the database. Detail:SQL statement: 'unkno

  • Tables for Contract data

    Hi all, if you know any tables for contract data(For Contract report), please tell me..... Thanks, kishore.

  • How do I reorganise individual colums on Pages?

    I am using Numbers 09 version 2.3 (554) The spending report I created does not sort by colum. I can sort one but it always messes up the other ones. Reorganize selected colums does not work. Does it got something to do with the first line beeing a me

  • Deleting tracks from zen mi

    I have deleted tracks and albums from both the player and the mediasource, yet when I put it on 'random play all' the deleted tracks still play! Am I doing something wrong? I can't see what else I can do to get rid of these! Please help!