Receive attachment using Custom Document

Hi ,
I have done integration with an external service where in response , they send me a gz attachment.
I am not able to read it. I want to read it using callout and den process it.Also in below mail trail, you can see my callout code.
Protocol Transport Binding
X-Powered-By=ASP.NET Cache-control=private Content-Length=329 CLIENTIP=Server=Microsoft-IIS/6.0 Date=Thu, 10 Apr 2014 07:15:51 GMT deliverToFabric=TRUE Content-Disposition=attachment; filename=PRREQ10042014101551N36951.95.gz Content-Type=application/octet-stream; Charset=UTF-8 Connection=close
Message Digest
Message Digest
Digest Algorithm
Transport Protocol
HTTP
Transport Protocol Version
HTTP/1.1
Url
security
Transport Headers
X-Powered-By=ASP.NET Cache-control=private Content-Length=329 CLIENTIP=Server=Microsoft-IIS/6.0 Date=Thu, 10 Apr 2014 07:15:51 GMT deliverToFabric=TRUE Content-Disposition=attachment; filename=PRREQ10042014101551N36951.95.gz Content-Type=application/octet-stream; Charset=UTF-8 Connection=close
certificates
certificates
State
ERROR
=============================================================================================================================================
import java.io.ByteArrayInputStream;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.io.FileInputStream;
import java.util.List;
import java.util.Properties;
import oracle.tip.b2b.callout.Callout;
import oracle.tip.b2b.callout.CalloutMessage;
import oracle.tip.b2b.callout.CalloutContext;
import oracle.tip.b2b.callout.exception.*;
import oracle.tip.b2b.domain.B2BParameters;
import oracle.tip.b2b.system.B2BRuntimeException;
import oracle.tip.b2b.system.ErrorKeys;
import org.apache.commons.codec.binary.Base64;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Security;
import java.security.Signature;
import java.security.cert.X509Certificate;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Map;
import java.util.UUID;
import javax.crypto.Cipher;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;
import org.bouncycastle.cert.jcajce.JcaCertStore;
import org.bouncycastle.cms.CMSProcessableByteArray;
import org.bouncycastle.cms.CMSSignedData;
import org.bouncycastle.cms.CMSSignedDataGenerator;
import org.bouncycastle.cms.CMSTypedData;
import org.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilder;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.operator.ContentSigner;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
import org.bouncycastle.util.Store;
import sun.misc.BASE64Encoder;
import java.util.zip.*;
import org.apache.commons.io.IOUtils;
public class _MT100_Payroll_Ack_Receiver implements Callout
    public void execute(CalloutContext context, List input, List output)
        System.out.println("  _MT100_Payroll_Ack_Receiver execute() called - Start");
        try {
            CalloutMessage cmIn = (CalloutMessage)input.get(0);
            System.out.println(" _MT100_Payroll_Ack_Receiver execute() called -  string that came in as input" +
                               cmIn.toString());
            String s = "";
            if (cmIn.getBody() instanceof String) {
                System.out.println("_MT100_Payroll_Ack_Receiver:cmIn.getBody() is instanceof String[]):");
                s = cmIn.getBodyAsString();
            if (cmIn.getBody() instanceof byte[]) {
                System.out.println("_MT100_Payroll_Ack_Receiver:cmIn.getBody() is instanceof byte[]):");
                byte[] inputasBytes = cmIn.getBodyAsBytes();
                System.out.println("inputasBytes:" + inputasBytes);
                byte[] decompressedByte = decompress(inputasBytes);
                System.out.println("decompressedByte:" + decompressedByte);
                s = decompressedByte.toString();
            System.out.println("_MT100_Payroll_Ack_Receiver:cmIn.getBody()"+ cmIn.getBody().getClass());
            System.out.println("_MT100_Payroll_Ack_Receiver:cmIn.getBody().getName"+ cmIn.getBody().getClass().getName());
            s = s.replaceAll(" xmlns:ns1=\"http://MT100_Rq\"", "");
            System.out.println(" Callout execute() called - replaced MT100_Rq:1" +
                               s);
            s = s.replaceAll("ns1:", "");
            System.out.println(" _MT100_Payroll_Ack_Receiver execute() called - replaced string" +
                               s);
            System.out.print("Inserting into DB");
            boolean isDbInserted = dbInserter(s);
            System.out.print("Inserted into DB" + isDbInserted);
            System.out.println((new StringBuilder()).append("Callout execute() - End Callout  = "));
        } catch (Exception e) {
            // System.out.println("Exception: "+ e.printStackTrace())
            System.out.println((new StringBuilder()).append("Callout execute() - Exception = ").append(e).toString());
            e.printStackTrace();
    public static byte[] decompress(byte[] contentBytes) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            IOUtils.copy(new GZIPInputStream(new ByteArrayInputStream(contentBytes)),
                         out);
        } catch (IOException e) {
            throw new RuntimeException(e);
        return out.toByteArray();
    public static boolean dbInserter(String TransactionResponse) {
        try {
            PreparedStatement prepareStatement = null;
            String MT940Output = "";
            Class.forName("oracle.jdbc.driver.OracleDriver");
            String URL =
                "jdbc:oracle:thin:" + MaadenPropertiesConstants.DB_USER + "/" +
                MaadenPropertiesConstants.DB_PASSWORD + "@" +
                MaadenPropertiesConstants.DB_HOSTNAME + ":" +
                MaadenPropertiesConstants.DB_PORT + ":" +
                MaadenPropertiesConstants.DB_SID;
            Connection conn = DriverManager.getConnection(URL);
            System.out.println(conn.isValid(30));
            String StatusCode =
                (TransactionResponse.substring(TransactionResponse.lastIndexOf("<StatusCode>"),
                                               TransactionResponse.indexOf("</StatusCode>"))).replaceFirst("<StatusCode>",
            String StatusDetail =
                TransactionResponse.substring(TransactionResponse.lastIndexOf("<StatusDetail>"),
                                              TransactionResponse.indexOf("</StatusDetail>")).replaceFirst("<StatusDetail>",
            String PayrollMessageRef =
                TransactionResponse.substring(TransactionResponse.lastIndexOf("<PayrollMessageRef>"),
                                              TransactionResponse.indexOf("</PayrollMessageRef>")).replaceFirst("<PayrollMessageRef>",
            String isProcessed = "2";
            if (StatusCode.equalsIgnoreCase("PENDING")) {
                isProcessed = "1";
            System.out.println("StatusCode:" + StatusCode);
            System.out.println("StatusDetail:" + StatusDetail);
            conn.setAutoCommit(true);
            String updateQuery =
                "update xxmac.xxmdn_bank_payroll_summary_tbl set STATUS_CODE='" +
                StatusCode + "' ,STATUS_DESCRIPTION='" + StatusDetail +
                "', IS_PROCESSEDBY_BPM='" + isProcessed +
                "'  where payroll_action_id = '" + PayrollMessageRef + "'";
            System.out.println("Query is :" + updateQuery);
            prepareStatement = conn.prepareStatement(updateQuery);
            prepareStatement.executeUpdate();
            conn.commit();
            //add logic of the task that needs to be done like archiving, manipulating the payload
        } catch (Exception e) {
                e.printStackTrace();
                return false;
        return true;
    private static java.sql.Date getCurrentDate() {
        java.util.Date today = new java.util.Date();
        return new java.sql.Date(today.getTime());
    public String encoder(String input) throws Exception {
        String KEYSTORE_FILE = MaadenPropertiesConstants.keystoreLocation;
        String KEYSTORE_INSTANCE = MaadenPropertiesConstants.KEYSTORE_INSTANCE;
        String KEYSTORE_PWD = MaadenPropertiesConstants.KEYSTORE_PWD;
        String KEYSTORE_ALIAS = MaadenPropertiesConstants.KEYSTORE_Alias;
        System.out.println((new StringBuilder()).append("Callout execute() - input = ").append(input));
        Security.addProvider(new BouncyCastleProvider());
        KeyStore ks = KeyStore.getInstance(KEYSTORE_INSTANCE);
        ks.load(new FileInputStream(KEYSTORE_FILE),
                KEYSTORE_PWD.toCharArray());
        Key key = ks.getKey(KEYSTORE_ALIAS, KEYSTORE_PWD.toCharArray());
        //Sign
        PrivateKey privKey = (PrivateKey)key;
        Signature signature = Signature.getInstance("SHA1WithRSA", "BC");
        signature.initSign(privKey);
        signature.update(input.getBytes());
        //Build CMS
        X509Certificate cert =
            (X509Certificate)ks.getCertificate(KEYSTORE_ALIAS);
        List certList = new ArrayList();
        CMSTypedData msg = new CMSProcessableByteArray(input.getBytes());
        System.out.println("msg: " + msg.toString() + "\n");
        certList.add(cert);
        Store certs = new JcaCertStore(certList);
        CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
        ContentSigner sha1Signer =
            new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(privKey);
        gen.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()).build(sha1Signer,
                                                                                                                                               cert));
        gen.addCertificates(certs);
        System.out.println("gen.getGeneratedDigests().toString(): " +
                           gen.getGeneratedDigests().toString() + "\n");
        CMSSignedData sigData = gen.generate(msg, true);
        BASE64Encoder encoder = new BASE64Encoder();
        String signedContent =
            encoder.encode((byte[])sigData.getSignedContent().getContent());
        System.out.println("Signed content: " + signedContent + "\n");
        String envelopedData = encoder.encode(sigData.getEncoded());
        System.out.println("Enveloped data: " + envelopedData);
        return envelopedData;

Hi ,
I have done integration with an external service where in response , they send me a gz attachment.
I am not able to read it. I want to read it using callout and den process it.Also in below mail trail, you can see my callout code.
Protocol Transport Binding
X-Powered-By=ASP.NET Cache-control=private Content-Length=329 CLIENTIP=Server=Microsoft-IIS/6.0 Date=Thu, 10 Apr 2014 07:15:51 GMT deliverToFabric=TRUE Content-Disposition=attachment; filename=PRREQ10042014101551N36951.95.gz Content-Type=application/octet-stream; Charset=UTF-8 Connection=close
Message Digest
Message Digest
Digest Algorithm
Transport Protocol
HTTP
Transport Protocol Version
HTTP/1.1
Url
security
Transport Headers
X-Powered-By=ASP.NET Cache-control=private Content-Length=329 CLIENTIP=Server=Microsoft-IIS/6.0 Date=Thu, 10 Apr 2014 07:15:51 GMT deliverToFabric=TRUE Content-Disposition=attachment; filename=PRREQ10042014101551N36951.95.gz Content-Type=application/octet-stream; Charset=UTF-8 Connection=close
certificates
certificates
State
ERROR
=============================================================================================================================================
import java.io.ByteArrayInputStream;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.io.FileInputStream;
import java.util.List;
import java.util.Properties;
import oracle.tip.b2b.callout.Callout;
import oracle.tip.b2b.callout.CalloutMessage;
import oracle.tip.b2b.callout.CalloutContext;
import oracle.tip.b2b.callout.exception.*;
import oracle.tip.b2b.domain.B2BParameters;
import oracle.tip.b2b.system.B2BRuntimeException;
import oracle.tip.b2b.system.ErrorKeys;
import org.apache.commons.codec.binary.Base64;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Security;
import java.security.Signature;
import java.security.cert.X509Certificate;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Map;
import java.util.UUID;
import javax.crypto.Cipher;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;
import org.bouncycastle.cert.jcajce.JcaCertStore;
import org.bouncycastle.cms.CMSProcessableByteArray;
import org.bouncycastle.cms.CMSSignedData;
import org.bouncycastle.cms.CMSSignedDataGenerator;
import org.bouncycastle.cms.CMSTypedData;
import org.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilder;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.operator.ContentSigner;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
import org.bouncycastle.util.Store;
import sun.misc.BASE64Encoder;
import java.util.zip.*;
import org.apache.commons.io.IOUtils;
public class _MT100_Payroll_Ack_Receiver implements Callout
    public void execute(CalloutContext context, List input, List output)
        System.out.println("  _MT100_Payroll_Ack_Receiver execute() called - Start");
        try {
            CalloutMessage cmIn = (CalloutMessage)input.get(0);
            System.out.println(" _MT100_Payroll_Ack_Receiver execute() called -  string that came in as input" +
                               cmIn.toString());
            String s = "";
            if (cmIn.getBody() instanceof String) {
                System.out.println("_MT100_Payroll_Ack_Receiver:cmIn.getBody() is instanceof String[]):");
                s = cmIn.getBodyAsString();
            if (cmIn.getBody() instanceof byte[]) {
                System.out.println("_MT100_Payroll_Ack_Receiver:cmIn.getBody() is instanceof byte[]):");
                byte[] inputasBytes = cmIn.getBodyAsBytes();
                System.out.println("inputasBytes:" + inputasBytes);
                byte[] decompressedByte = decompress(inputasBytes);
                System.out.println("decompressedByte:" + decompressedByte);
                s = decompressedByte.toString();
            System.out.println("_MT100_Payroll_Ack_Receiver:cmIn.getBody()"+ cmIn.getBody().getClass());
            System.out.println("_MT100_Payroll_Ack_Receiver:cmIn.getBody().getName"+ cmIn.getBody().getClass().getName());
            s = s.replaceAll(" xmlns:ns1=\"http://MT100_Rq\"", "");
            System.out.println(" Callout execute() called - replaced MT100_Rq:1" +
                               s);
            s = s.replaceAll("ns1:", "");
            System.out.println(" _MT100_Payroll_Ack_Receiver execute() called - replaced string" +
                               s);
            System.out.print("Inserting into DB");
            boolean isDbInserted = dbInserter(s);
            System.out.print("Inserted into DB" + isDbInserted);
            System.out.println((new StringBuilder()).append("Callout execute() - End Callout  = "));
        } catch (Exception e) {
            // System.out.println("Exception: "+ e.printStackTrace())
            System.out.println((new StringBuilder()).append("Callout execute() - Exception = ").append(e).toString());
            e.printStackTrace();
    public static byte[] decompress(byte[] contentBytes) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            IOUtils.copy(new GZIPInputStream(new ByteArrayInputStream(contentBytes)),
                         out);
        } catch (IOException e) {
            throw new RuntimeException(e);
        return out.toByteArray();
    public static boolean dbInserter(String TransactionResponse) {
        try {
            PreparedStatement prepareStatement = null;
            String MT940Output = "";
            Class.forName("oracle.jdbc.driver.OracleDriver");
            String URL =
                "jdbc:oracle:thin:" + MaadenPropertiesConstants.DB_USER + "/" +
                MaadenPropertiesConstants.DB_PASSWORD + "@" +
                MaadenPropertiesConstants.DB_HOSTNAME + ":" +
                MaadenPropertiesConstants.DB_PORT + ":" +
                MaadenPropertiesConstants.DB_SID;
            Connection conn = DriverManager.getConnection(URL);
            System.out.println(conn.isValid(30));
            String StatusCode =
                (TransactionResponse.substring(TransactionResponse.lastIndexOf("<StatusCode>"),
                                               TransactionResponse.indexOf("</StatusCode>"))).replaceFirst("<StatusCode>",
            String StatusDetail =
                TransactionResponse.substring(TransactionResponse.lastIndexOf("<StatusDetail>"),
                                              TransactionResponse.indexOf("</StatusDetail>")).replaceFirst("<StatusDetail>",
            String PayrollMessageRef =
                TransactionResponse.substring(TransactionResponse.lastIndexOf("<PayrollMessageRef>"),
                                              TransactionResponse.indexOf("</PayrollMessageRef>")).replaceFirst("<PayrollMessageRef>",
            String isProcessed = "2";
            if (StatusCode.equalsIgnoreCase("PENDING")) {
                isProcessed = "1";
            System.out.println("StatusCode:" + StatusCode);
            System.out.println("StatusDetail:" + StatusDetail);
            conn.setAutoCommit(true);
            String updateQuery =
                "update xxmac.xxmdn_bank_payroll_summary_tbl set STATUS_CODE='" +
                StatusCode + "' ,STATUS_DESCRIPTION='" + StatusDetail +
                "', IS_PROCESSEDBY_BPM='" + isProcessed +
                "'  where payroll_action_id = '" + PayrollMessageRef + "'";
            System.out.println("Query is :" + updateQuery);
            prepareStatement = conn.prepareStatement(updateQuery);
            prepareStatement.executeUpdate();
            conn.commit();
            //add logic of the task that needs to be done like archiving, manipulating the payload
        } catch (Exception e) {
                e.printStackTrace();
                return false;
        return true;
    private static java.sql.Date getCurrentDate() {
        java.util.Date today = new java.util.Date();
        return new java.sql.Date(today.getTime());
    public String encoder(String input) throws Exception {
        String KEYSTORE_FILE = MaadenPropertiesConstants.keystoreLocation;
        String KEYSTORE_INSTANCE = MaadenPropertiesConstants.KEYSTORE_INSTANCE;
        String KEYSTORE_PWD = MaadenPropertiesConstants.KEYSTORE_PWD;
        String KEYSTORE_ALIAS = MaadenPropertiesConstants.KEYSTORE_Alias;
        System.out.println((new StringBuilder()).append("Callout execute() - input = ").append(input));
        Security.addProvider(new BouncyCastleProvider());
        KeyStore ks = KeyStore.getInstance(KEYSTORE_INSTANCE);
        ks.load(new FileInputStream(KEYSTORE_FILE),
                KEYSTORE_PWD.toCharArray());
        Key key = ks.getKey(KEYSTORE_ALIAS, KEYSTORE_PWD.toCharArray());
        //Sign
        PrivateKey privKey = (PrivateKey)key;
        Signature signature = Signature.getInstance("SHA1WithRSA", "BC");
        signature.initSign(privKey);
        signature.update(input.getBytes());
        //Build CMS
        X509Certificate cert =
            (X509Certificate)ks.getCertificate(KEYSTORE_ALIAS);
        List certList = new ArrayList();
        CMSTypedData msg = new CMSProcessableByteArray(input.getBytes());
        System.out.println("msg: " + msg.toString() + "\n");
        certList.add(cert);
        Store certs = new JcaCertStore(certList);
        CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
        ContentSigner sha1Signer =
            new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(privKey);
        gen.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()).build(sha1Signer,
                                                                                                                                               cert));
        gen.addCertificates(certs);
        System.out.println("gen.getGeneratedDigests().toString(): " +
                           gen.getGeneratedDigests().toString() + "\n");
        CMSSignedData sigData = gen.generate(msg, true);
        BASE64Encoder encoder = new BASE64Encoder();
        String signedContent =
            encoder.encode((byte[])sigData.getSignedContent().getContent());
        System.out.println("Signed content: " + signedContent + "\n");
        String envelopedData = encoder.encode(sigData.getEncoded());
        System.out.println("Enveloped data: " + envelopedData);
        return envelopedData;

Similar Messages

  • Using custom document protocal in B2B for Binary data transfer

    Hello All,
    Below are the steps that I am performaing in my project
    1) I am enquing the message using B2b adapter to JMS queue on SOA server
    2) I have selected opaque and binary fomat while configuring the JMS adapter
    3) Before invoking b2b adapter to push the message, trying to set below proeprties in bpel
    <bpelx:toProperty name="b2b.fromTradingPartnerId"
    variable="varFromParty"/>
    <bpelx:toProperty name="b2b.toTradingPartnerId" variable="varToParty"/>
    <bpelx:toProperty name="b2b.documentTypeName"
    variable="varDocTypeName"/>
    <bpelx:toProperty name="b2b.documentProtocolVersion"
    variable="varDocTypeRevision"/>
    <bpelx:toProperty name="b2b.documentProtocolName"
    variable="varEventName"/>
    <bpelx:toProperty name="b2b.documentDefinitionName"
    variable="varDocDefName"/>
    <bpelx:toProperty name="jca.jms.JMSMessageID" variable="varMsgId"/>
    <bpelx:toProperty name="jca.jms.JMSProperty.FROM_PARTY"
    variable="varFromParty"/>
    <bpelx:toProperty name="jca.jms.JMSProperty.TO_PARTY"
    variable="varToParty"/>
    <bpelx:toProperty name="jca.jms.JMSProperty.DOCTYPE_NAME"
    variable="varDocTypeName"/>
    <bpelx:toProperty name="jca.jms.JMSProperty.DOCTYPE_REVISION"
    variable="varDocTypeRevision"/>
    <bpelx:toProperty name="jca.jms.JMSProperty.MESSAGE_TYPE"
    variable="varMsgType"/>
    <bpelx:toProperty name="jca.jms.JMSProperty.DOCPROT_NAME"
    variable="varEventName"/>
    on B2b console
    1) I have configured JMS listenign channel, file deliver channels properly
    2) I have defined docuemnt definition under custom document protocal without xsd
    custom->1.0->Binary->Binary_def
    3) created agrement and selected file as deleivery channel
    when testing this case
    - bpel- B2b adapter successfully pushing message into jms queue on soa server
    - b2b jms listening channel is able to pickup the message from jms-queue but encountering with the document protocal definition error
    - if I check reports section - sender and reciever are showing as same partner name where as in wired message all the properties(to_party, from_party etc..) are getting populated with the values that we sent from bpel
    I am not able to figure out the issue so please let us know what extra parameteres that I need to send from bpel to come out of this issue. PLease treat this as imp since i have deliverable.
    Thanks,
    Anjana

    Hi Anuj,
    Thanks for the quick response. This option fixed the issue. thanks for your suggestion.
    I tried this option earlier when I was doing some R&D, at that time message iteself was not picked up by B2b listening channel from jms queue so I have unchecked and didn't try this option again.
    Regards,
    Anjana

  • Can you edit an email attachment using google documents or somethiing similar

    I was wondering if anyone knows if there is a way to edit an email document attachment. Is there something similar to google documents.

    Documents to Go, Pages (or Numbers as appropriate), at least half a dozen "office" apps for the iPhone are available. You could save it to box.net or dropbox and then transfer it to google docs, but I've found google documents on the iPhone to be frustrating to use at best for editing.

  • How to download splist item attachment using custom ribbon button

    Hi All,
    I have a requirement to download sp list items attachments in a zip format to file share. Is there a way to do this? please do let me know.
    Your quick turnaround is much appreciated
    MercuryMan

    Hi,
    According to your post, my understanding is that you want to download list items attachments in a zip format to file share.
    You can create custom ribbon action.
    More information:
    SharePoint 2010 Download as Zip File Custom Ribbon Action
    Download files as Zip File in SharePoint
    Create a SharePoint Custom Action to Zip and Download a Document Set
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • If I attach a scanned document to a mail, it's impossible for the persons receiving my mail to open the file

    I'm a MacBook Pro user and scanning documents with an hp Officejet 7500A.
    If I send a mail with an attached file, SCANNED document, the person receiving my mail will be totaly unable to open it.
    If I send the very same mail, always with my Mac computer and attaching the very same scanned document but using my professional mailbox wich is NO MAC MAIL, things are working perfectly well.mail.
    Thanks for your help,
    Ph.

    Try right clicking the file on your desktop, and compressing it, then send it to the intended recepient. Of course you will want to advise them to extract the document from the *.zip file afterwards. A ZIP file is sort of like a briefcase for other data, you put it inside and send that fully intact for the other person to open. Good luck, let me know if it fails.
    Regards,
    Kip

  • What transactions can be used to receive a pallet of documents for retention purposes that is not an inventory item?

    What transactions can be used to receive a pallet of documents for retention purposes that is not an inventory item?

    Petr,
    Thank you for the question, I think it is easier to explain my current process which I hope you can translate into SAP EWM processes.
    I currently have a SKU description of THIRD PARTY STORAGE, this SKU is always a quantity of 1 for stock check purposes. This SKU can be many things but not inventory (in the sense of not a component or finished good). The pallet can be documents for retention, samples for QC, trial parts etc. This pallet can be received onto the WMS without a Purchase Order number, the SKU is set up to be able to be received 999999 times before a re-set is necessary. The SKU has a putaway algorythm for the high bay warehouse and is sub-zoned into an aisle.
    I hope this clarifies what I'm asking for in SAP.
    Regards
    Chris

  • How to use custom pipeline dlls in Biztalk Projects so that they appear in the send/receive pipeline configuration after deployment?

    I have a existing Biztalk application that uses custom pipelines for receiving excel files. I have the dll of that custom pipeline. Now i created another BT application that needs to use that same custom pipeline. But after i deploy the application in
    Biztalk, i can't see the  pipeline available in Receive pipeline configuration combo box during configuration. I have referenced the custom pipeline dll in my project before deploying, but that doesn't help. I also copied the dll in the C:\Program Files
    (x86)\Microsoft BizTalk Server 2010\Pipeline Components folder and C:\Program Files (x86)\Microsoft BizTalk Server 2010 folder, but that doesn't make the pipelines appear during configuration too.
    Can anyone give any idea on how can i use these custom pipeline dlls in project so that they appear in configuration after deployment?

    If you plan on using the deployed pipeline across multiple applications in BizTalk, the BizTalk Application (using the BizTalk Server Administration Console) should have the other application [where the pipeline is deployed] as reference.
    For e.g.: Custom Pipeline (myCustomPipeline) part of a BizTalk Project (dll - myCustomProject.dll) deployed under Application [Some Application] also to be used in another BizTalk Application [Some Other Applicaiton] then using BizTalk Server Administartor
    right click the "Some Other Application" and select "Properties"
    on the "Properties" page, left hand side, select "References"
    on the right-hand side, use "Add" to add the "Some Project" as a reference.
    Doing so will ensure that ALL resources (maps, schemas, orchestrations, send ports, receive locations, rules, etc.) deployed for "Some Application" are available/referensible in "Some Other Application".
    Regards.

  • Unable to display customs document in SAP GTS

    Hello,
    I am using SAP GTS 7.2 Compliance services. SPL and Embargo services are working well (I am not using License determination).
    Indeed, when I save a sales order in ERP, it is effectively checked for compliance, as I receive a message when it is blocked by GTS..
    In GTS, I can check that concerning business partners are effectively blocked, using:
    "Display Blocked Business Partners" and "Display Business Partners with Embargo Situation".
    But I cannot display any customs document in SAP GTS, using transaction /SAPSLL/CUHD_DISPLAY (Display all documents) or SAPSLL/CON_BLOCKED_DOCS_EXP (Display blocked documents).
    I get the following error message "No data was found for the selection criteria specified".
    As I understood, SAP GTS performs the compliance checks not on ERP documents but on corresponding GTS customs document. Thus I guess they are effectively created somewhere! If it was not the case, I guess the process should not work.
    When I look in the audit trail of SPL for documents, I can see all the SPL checks that have been performed. Looking in the corresponding table "/SAPSLL/SPLAUD", I can even find the numbers of the different customs documents...
    But there is nothing in table "/SAPSLL/CUHD", where they should be copied... The only entries I found concern biling documents that were transferred for customs purposes...
    Could you please help me on this matter?
    Many thanks,

    Hi Sameer,
    Thank you for your fast answer. I checked in the debug mode creating a breakpoint at statement RFC and it effectively stops at RFC /SAPSLL/API_6800_SYNCH.
    But when I check the log in transaction SLG1, nothing appears concerning /SAPSLL/API_6800_SYNCH.
    I think the customs document is effectively created in GTS as I can see it has a number assigned in the audit trail for SPL screening. And compliance services work.
    Though when going through the transaction of displaying all documents in GTS there is nothing. Table "/SAPSLL/CUHD" is empty (except some billing documents that were transferred for customs purposes).
    This is really weird... Anyway, thank you for your help.
    Kind Regards,

  • Purchase order received directly in customer consignment

    We are entering a business relationship with a company where we will send the goods on consignment basis  (W stock) procured directly from a vendor. The SAP documentation tells about using the consignment fill up process etc., that we would have to do a receiving in our plant (even though we won't touch the product) and then do another document (the consignment fill-up) to transfer it to the customer as 'W' stock. What we would like to do is write a purchase order for the material have it received at the customer directly into 'W" stock. Does this functionality exist in the SAP purchase order? Can this be easily achieved?

    [http://help.sap.com/bestpractices/BBLibrary/Documentation/J58_BPP_EN_KO.doc]
    [http://help.sap.com/bestpractices/BBLibrary/Documentation/J58_BB_ConfigGuide_EN_KO.doc]
    After creating the Sales order, you can trigger a purchase order from a Vendor through MRP and change the delivery address as the customer. So that the Vendor delivers the product to your customer and you can do the goods receipt in your plant. Then you can do the consignment issue from the delivery to the customer in your system.

  • Invoice image in vendor and customer document

    Hello,
    We have got following requirement.
    Currently we are storing pysical invoice copies of vendor and customer in a pysical file. But now we want to see the image of invoices in vendor and customer document respectively.
    It means, if it is possible to have an attachment button or some icon available when we see vendor and customer document.
    Please advise how can we link the pysical invoice with SAP document. And is this something related to DMS or Archivieng Link.
    Please suggest.
    Best Regards,
    Tapan

    Hi Tapan,
    At my company we are currently doing just this.
    We have a server outside of SAP that stores our images.  We did not want to store the images within SAP.
    We use the SAP document number to link the image to the SAP document.
    We do all our AP input from images. After an invoice is entered, and the document number is generated, we forward the image to a
    e mail address for the server using the document number in the subject line. The image gets attached to the document. Then the image can be viewed by clicking on the Services for object icon.
    I am sure there is some more techical stuff that goes this, like an RFC connection. I am sorry I am not technical. I am the functionala AP person. We also have a program that takes the image and attaches it to the cross company document if there is one.
    Hope this gives you some ideas.
    Alicia

  • Build error when using custom error codes

    When I try to build my application using custom error codes I receive the following error:
    Error 1 occurred at Copy in AB_Engine_Copy_Error_Files.vi->AB_Application.lvclass:Copy_Error_Files.vi->AB_Application.lvclass:Copy_Files.vi->AB_Build.lvclass:Build.vi->AB_EXE.lvclass:Build.vi->AB_Engine_Build.vi->AB_Build_Invoke.vi->AB_Build_Invoke.vi.ProxyCaller
    Possible reason(s):
    LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
    =========================
    NI-488:  Command requires GPIB Controller to be Controller-In-Charge.
    C:\Program Files\National Instruments\LabVIEW 8.5\user.lib\errors\BPMS-errors.txt
    This only occurs the first time I attempt to build my application. If I build again immediately after receiving the error, everything works fine. My custom error codes were created using the provided editor, and I have included the file in my project. I have also checked the "Copy error codes" box in the advanced build specification settings.

    Hi Donovan,
    The attached project is giving me the error previously discussed. Thanks for your help.
    Attachments:
    BuildError.zip ‏10 KB

  • 'BAPI_DOCUMENT_CREATE2': store attachment using 'SAP-SYSTEM'

    while i am checkin a document (attachment) using storage category KPRO ,the document is getting stored but when i use SAP-SYSTEM the Document is not getting stored. How can I get it stored using 'SAP-SYSTEM'
    Following is the code;
    DATA:
    lv_docnum TYPE bapi_doc_aux-docnumber,
    lw_docdata TYPE bapi_doc_draw2,
    lw_return TYPE bapiret2,
    lw_dsp TYPE bapi_doc_drat,
    lw_objlink TYPE bapi_doc_drad,
    lw_docfile TYPE bapi_doc_files2,
    lt_dsp TYPE STANDARD TABLE OF bapi_doc_drat,
    lt_objlink TYPE STANDARD TABLE OF bapi_doc_drad,
    lt_docfile TYPE STANDARD TABLE OF bapi_doc_files2.
    START-OF-SELECTION.
    *CALL 'SAPCORE' ID 'ID' FIELD 'VERSION'
    ID 'TABLE' FIELD kernel_version-sys*.
    *READ TABLE kernel_version INDEX 11.
    *w_hostname = kernel_version-data.
      CLEAR lw_docdata.
      lw_docdata-documenttype = 'ZAP'.
      lw_docdata-documentversion = 'A0'.
      lw_docdata-documentpart = '000'.
      lw_docdata-laboratory = '001'.
      CLEAR lw_dsp.
      lw_dsp-description = 'Test created by xyz'.
      lw_dsp-language = 'E'.
      APPEND lw_dsp TO lt_dsp.
      lw_docfile-docfile = 'C:\test.pdf'.
       lw_docfile-docpath = 'C:\test.pdf'.
    LW_DOCFILE-ORIGINALTYPE = '1'.
      lw_docfile-storagecategory = 'SAP-SYSTEM'.
    lw_docfile-storagecategory = 'DMS_C1_ST'.
      lw_docfile-wsapplication = 'PDF'.
      lw_docfile-language = 'E'.
      lw_docfile-checkedin = ' '.
    lw_docfile-checkedin = 'X'.
      lw_docfile-active_version = 'X'.
      APPEND lw_docfile TO lt_docfile.
      CLEAR lw_objlink.
      lw_objlink-objecttype = 'VBAP'.
      lw_objlink-objectkey = '0040011233000010'.
      lw_objlink-documentdirection = 'X'.
      APPEND lw_objlink TO lt_objlink.
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        EXPORTING
          documentdata         = lw_docdata
    pf_ftp_dest = 'SAPFTPA'
    pf_http_dest = 'SAPHTTPA'
        IMPORTING
          documentnumber       = lv_docnum
          return               = lw_return
        TABLES
          documentdescriptions = lt_dsp
          objectlinks          = lt_objlink
          documentfiles        = lt_docfile.
      IF lw_return-type CA 'EA'.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        MESSAGE ID lw_return-id
        TYPE lw_return-type
        NUMBER lw_return-number.
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
        CLEAR lw_return.
        CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
          EXPORTING
            documenttype    = 'ZAP'
            documentnumber  = lv_docnum
            documentpart    = '000'
            documentversion = 'A0'
          IMPORTING
            return          = lw_return
          TABLES
            documentfiles   = lt_docfile.
        IF lw_return-type CA 'EA'.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          MESSAGE ID lw_return-id
          TYPE lw_return-type
          NUMBER lw_return-number.
        ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait = 'X'.
        WRITE: / 'document number = ', lv_docnum.
        ENDIF.
      ENDIF.

    Hi,
    based on the posted coding I think that the reason for this behavior is that the used document type has set the flag 'Use KPRO' in transaction DC10. Because the storage category 'SAP-SYSTEM' is not a KPRO storage category like DMS_C1_ST. So if this flag is set in the customer then only originals checked in to a KPRO storage category are displayed. Without this flag the originals in "older" storage categories are displayed (e.g. SAP-SYSTEM, archive,...).
    Regarding the limitation of 2 originals per document info record, I can inform you that this is a standard restriction of you do not
    check in your originals to a KPRO. With the KPRO storage there is no such limitation.
    Generally I'm asking myself why you are using the BAPI_DOCUMENT_CREATE2 and then also the CHECKIN BAPI. Because you can enter the original data also at the CREATE2 BAPI. If you want to checkin files to the KPRO then the filedata has to be
    handed over in table DOCUMENTFILES. If you want to check in originals to SAP-SYSTEM then the data has to be entered in table DOCUMENTDATA. For further information please see SAP note 766277 which has a complete BAPI documentation added in its attachment area.
    Best regards,
    Christoph

  • Attaching a PDF document for a Invioce Parking thru FB60 in background

    Dear Friends,
    I am working on a requirement to build an interface for Invoice posting/Parking.
    Transaction used: FB60
    Invoice data will be stored in a staging server, same has to be read and posted in SAP. Till posting part i am clear with the requirement. Invoice data will be in a flat file which i can read and store in my Custome table.
    But customer is asking to attach a PDF document (which is a kind of supporting document not the invoice data) while doing the posting.
    My queries are:
    1. How to fetch the PDF files placed in an external staging server.
    2. How to attach those files while doing the posting/parking as job is executed in background.
    I want to use BAPI BAPI_INCOMINGINVOICE_PARK for parking the Invoice, but where to attach the PDF.
    Or can i do BDC to attach the document?
    Any info on this is highly appreciated and rewarded.
    Thanks,
    Simha

    Change in requirement..
    Hence i am closing this thread.
    Regards,
    Simha

  • Attaching a PDF document for a Invioce Parki thru FB60 in background

    Dear Friends,
    I am working on a requirement to build an interface for Invoice posting/Parking.
    Transaction used: FB60
    Invoice data will be stored in a staging server, same has to be read and posted in SAP. Till posting part i am clear with the requirement. Invoice data will be in a flat file which i can read and store in my Custome table.
    But customer is asking to attach a PDF document (which is a kind of supporting document not the invoice data) while doing the posting.
    My queries are below:
    1. How to fetch the PDF files placed in an external staging server.
    2. How to attach those files while doing the posting/parking as job is executed in background.
    I want to use BAPI BAPI_INCOMINGINVOICE_PARK for parking the Invoice, but where to attach the PDF.
    Any info on this is highly appreciated and rewarded.
    Thanks,
    Simha

    Change in requirement..
    Hence i am closing this thread.
    Regards,
    Simha

  • Receiver determintation using Abap Mapping

    Hi,
    I configured a scenario in which I'm using extended receiver determination to determine the receiver of an incoming message. (The reason for this is that there is only one XI system and two ECC systems - DEV and QAS. By means of the setting in a customizing table it can be determined whether the message is sent to DEV or QAS. The message can't be sent to both systems because it is a synchronous interface). The receiver determination calls an Interface Mapping which has target interface Receiver Determination. I made an Abap Mapping program in which the customize table is read and the output message is formed as follows (according to the structure of the Receivers message):
          lrf_output_document = lrf_ixml_factory->create_document( ).
          lrf_receivers = lrf_output_document->create_simple_element( name = 'Receivers'
                                                                      parent = lrf_output_document ).
          lrf_receiver  = lrf_output_document->create_simple_element( name = 'Receiver'
                                                                      parent = lrf_receivers ).
          lrf_element   = lrf_output_document->create_simple_element( name = 'Party'
                                                                      value = ' '
                                                                      parent = lrf_receiver ).
          lrf_element->set_attribute( name = 'agency'
                                                 value = ' ' ).
          lrf_element->set_attribute( name = 'scheme'
                                                value = ' ' ).
          lrf_element   = lrf_output_document->create_simple_element( name = 'Service'
                                                        value  = 'DEV'
                                                        parent = lrf_receiver ).
    To fill the RESULT field a stream factory is instantiated and a XSTRING is created. When I send a message to the system, the receiver determination dumps: Error when parsing receiver listLength of XML document 129 Error when parsing receiver listLength of XML Document 129 System expected the element 'Receivers'
    Looks like the XSTRING has not got the right structure and can not be parsed into the Receivers message. However, when I create a CSTRING, the message looks OK. I also changed the encoding (Codepage 4103).
    When I replace the Abap mapping with a message mapping, the receiver determination works OK. However, in that case it is not possible to read the customizing table. I really need the Abap mapping.
    Has anyone ever filled the Receivers massage by means of Abap mapping. Any feedback will be appreciated!

    Hi,
    there is a easier way - totally based on my blogs
    create an abap mapping that will feed the dynamicconfiguration in ABAP (with z "Z" namespace) - similar thing shown in my blog
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
    and you don't need to create the XML in ABAP mapping just parse it, fill DC and send the same source to the target
    (so you don't change the XML)
    then add a message mapping to your interface mapping in which you will only use dynamicconfig value
    to populate the receiver segment
    nice and clean way
    Regards,
    Michal Krawczyk

Maybe you are looking for