Modify Java Mapping on Mexico Digital Invoice

I have installed all oss notes related to the Mexico Digital Invoice on our ERP system and XI system.  Since we made additional modifications to the Invoice02 extension, I need to modify the Java mapping on XI.  The note (1296042) states if you make changes to the idoc, you will need to make changes to the java mapping as well, and recompile it to install the class on XI.
I have a java editor, however, I cannot find the java project anywhere.  Does anyone know where I would access this from?  The pdf on the note related to modifying the java mapping only says to open the project; It doesn't have the project in the note, from what I can see.  And I don't see it within XI. 
Anyone know?  Or has anyone done this?

>
Henrique Pinto wrote:
> Just a follow-up.
> Note https://service.sap.com/sap/support/notes/1296042 has been updated with the Java mapping source codes.
>
> BR,
> Henrique.
Hi Henrique,
We are also implementing the mexico invoice and I am trying to change the java mapping and I can't figure out where the '.JAVA' file exist? We could not find it in the imported archives (on the repository)... I have checked most of the attached files on the notes (can you let me know the name of the file with source code?)

Similar Messages

  • Mexico Digital Invoice printout

    Hi Experts,
    I am working on Mexico localisation.We have requirement for Digital invoice printing and also XML file generation.I know SAP has given a functionality for XML file generation and it can be done but for Digital invoice prinout there is no standard form available.But i want to print the  govt certificate and also there is some Legal text in XML file formate it cannot be done by coding which is similar we are getting in XML file.How can we achieve this for Printin digital invoices for Mexico.
    Thanks for your support!
    NR

    Hi,
    Could you please be more specific on your requirement? Do you want to "include" (print) the gov certificate number in the XML file and also some legal texts? or, do you want to print in a smartform the certificate number and those legal texts?
    For first option, the certificate is already included on INVOIC02 idoc, so you only need to map it in PI. For text, usually there´s no legal texts required on XML, if you needed, you can fill it directly on the IDOC and map it directly.
    For the second option, you can use the creation of texts in t-code SO10, regarding certificate number, this data is stored in one text element of the invoice VBBK-ZSNC if the customizing is according to documentation.
    Best regards,
    RP

  • Mexico Digital Invoice Implementation without XI.

    Hi All,
    We are in the process of generating Digital invoice for Mexico.
    Is it possible to generate the Digital invoice without the XI system? If possible then what are the hurdles and challenges in achieving this. I did go through the list of Notes mentioned by SAP to implement Digital Signatures for Mexico. But they dont seem to mention about implementing with out XI system.
    Also is there any standard process to generate the XML required for Mexico. Appreciate any clarification for the above queries..
    Thanks in advance.
    Regards,
    Navin.

    Hi Naveen,
    Is important to consider three points at the moment of implementin Digital Invoice Mexico:
    Enablement of ODN (official document numbering).
    Enable digital signature in SAP.
    Creation of XML.
    You can perform the first two options withount PI/XI but the only problem will be the generation of XML, that for fiscal purposes is the digital invoice. If you are not using PI/XI you can do that by ABAP, Webmethods or any tool that generates XML.
    If you decide to generate the XML with ABAP, you dont need to use IDOC but is still needed to create an output message that generates the XML instead a smartform or other. This can be sent automatically to customers or to any kind of repository to keep the files for fiscal term.
    The structure of the XML must follows all Mexican requirements acording to Anexo 20 that you can find only in spanish.
    I suggest you to read the attachments on the following note, where you can find the structure and requirements and order of each XML field:
    1318342 - Digital Invoice Mexico IDoc basic type INVOIC02 Extension
    Regarding the standard process to generate XML in SAP, the only information provided by SAP is for PI/XI, so your ABAP team needs to take a look for anexo 20 structure:
    ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/publicaciones/cfd/Anexo20RMF2010.pdf
    I hope this may help you.
    Regards,
    RP

  • Mexico Digital invoice - SSF without an External security product

    Hi All,
    We are in the process of implementing Digital Invoice for Mexico. I have few queries regarding this.
    1. Can the digital signature be achieved with out any external security product ?
    2. If it is possible, then will it comply with the legal requirements for Mexico.
    I came across a SAP document wherein it was mentioned that "If you are using the user signature as the signature method, you require an external security product that is connected to your SAP system through SSF." Does  it mean that SAP standard SAPSECULIB supports only system signature  and not user signature ?
    Any pointers regarding the digital Signature implementation steps will be appreciated.

    Hi Sri,
    Would you pls check the installation of the security toolkit on your application server?
    Which security product do you use?
    The standard security product is SAPSECULIB (library sapsecu.dll).
    Please check the SSF initialization messages which are contained in each dev_w## developer trace (transaction ST11). When successful, the initializaion messages look like this:
    N  =================================================
    N  === SSF INITIALIZATION:
    N  ===...SSF Security Toolkit name SAPSECULIB .
    N  ===...SSF trace level is 0 .
    N  ===...SSF library is /usr/sap/<SID>/SYS/exe/run/sapsecu.dll .
    N  ===...SSF hash algorithm is SHA1 .
    N  ===...SSF symmetric encryption algorithm is DES-CBC .
    N  ===...sucessfully completed.
    N  =================================================
    General information for SAPSECULIB can be found in SAP note 354819.
    Best regards,
    Christoph
    P.S.: Please reward points for useful information.

  • Issue with java mapping in a multi-mapping scenario

    Hi
        We have  a 1:n multiple mapping scenario in XI and the source is R3 proxy and target side is files. So, creating multiple file from a single message from R3 .
    R3 --> XI --> Multiple files
    Structure of the output of the multi-mapping is
    - <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    - <ns0:Message1>
    <Transaction>
    </Transaction>
    <Transaction>
    </Transaction></ns0:Message1>
    </ns0:Messages>
    wherein each Transaction node represents a file.
    Now, we need to introduce a constant /string like
    <!DOCTYPE Transaction PUBLIC \"-//XXXXXX//DTD BatchReceiptAuthorization//EN\" \"http://dtd.XXXXXXX.com/dtds/ReceiptAuthorization.dtd\">
    on each of the files at the very beginning - i.e within each transaction node , in the above structure, we need the above DTD string to be written.  To do this, we added a java mapping as the second mapping after the message mapping that creates this string. Is this the right approach and would it produce what we are expecting ?
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.DynamicConfiguration;
    import com.sap.aii.mapping.api.AbstractTrace;
    public class ModifyRootAndDelay implements StreamTransformation {
         AbstractTrace myTrace;
    public void execute(InputStream input, OutputStream output) throws StreamTransformationException {
              try{
                   BufferedReader reader = new BufferedReader(new InputStreamReader(input));
                   String NameSpacePrefix = "<!DOCTYPE Transaction PUBLIC \"-//innotrac//DTD BatchReceiptAuthorization//EN\" \"http://dtd.innotrac.com/dtds/ReceiptAuthorization.dtd\">";
                   String sLine = null;
                   StringBuffer XmlMsg= new StringBuffer();
                   String Result,PayloadBody;
                   int indexOfFirst;
                   while ((sLine = reader.readLine()) != null) {
                        XmlMsg.append(sLine);
                   String StartingTag = XmlMsg.toString();
                   indexOfFirst = StartingTag.indexOf("<MerchantID>") ;
                   PayloadBody=new String(XmlMsg.substring(indexOfFirst));
                   Result=NameSpacePrefix.concat(PayloadBody);
                   output.write(Result.getBytes());
              /*     Thread.sleep(200000); */
              }catch(Exception e){
                   myTrace.addWarning("Exception raised in the JavaMapping:modifyNamespace.java""\n The Exception Message: " e.getMessage());
                   throw new RuntimeException(e.getMessage()) ;
            }     public void setParameter(Map param) {
              myTrace = (AbstractTrace) param
                        .get(StreamTransformationConstants.MAPPING_TRACE);

    Hi XI Gurus
                       In my scenario, I sent the inputstream that is being passed to the Java execute method - to trace and I see that the whole of the xml file - as shown below  - which is the output of message mapping ( from the first mapping step ) in sent to the execute method of the java mapping a single call
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    <Transaction> </Transaction>
    <Transaction> </Transaction>
    </ns0:Message1>
    <ns0:Messages>
    So, I modified Java mapping program to look for multiple occurences of <Transaction> tag and prefix them with my constant DTD Literal - which is the primary reason , why I had to use Java mappings after the message mapping.
    Now, I get an error is XI- SXMB_MONI
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="MAPPING" />
      <SAP:P1>unexpected symbol; expected '<', '</', entity refe</SAP:P1>
      <SAP:P2>rence, character data, CDATA section, processing i</SAP:P2>
      <SAP:P3>0</SAP:P3>
      <SAP:P4>113</SAP:P4>
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>The exception occurred (program: CL_XMS_MAIN===================CP, include CL_XMS_MAIN===================CM00A, line: 609)</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Should I create multiple outputs - as many as the numberof target split files ( of type outputstream ) from the execute method in the java program ?

  • Digital Invoice for Mexico

    Hi All,
    We are in the process of implementing Digital Invoice for Mexico. I have few queries regarding that. I did search SDN regarding this topic but couldn't get a clear picture SSF process . Hence i am posting this thread.
    Below are my queries.
    1. Can the Digital Signatures be achieved through SSF using standard SAPSECULIB alone and not using any third party toolkit?
    2. Is there any pre-requisite for imlpementing SSF?
    3. How can the documents created with digital signature using SSF, verified by a third party system?
    Also it would helpful if you can provide me the steps to implement SSF.
    Thanks in advance.
    Regards,
    Navin.

    Hi Navin,
    I´m SD consultant but maybe this may help you:
    1.- If you mean the transformation of the certificate provided by Mexican goverment, you can use the open source software (OpenSSL) suggested by SAP. The digital signature is the sealing of the Original Input Message created by the solution relased by SAP applying the hash algorithm.
    2.- According to note 1300880,where the process to import the certificates is explaned,  you previously need to implement note 1303712.
    3.- The verification process of a thrird party provider can be performed by simply sending the XML generated by SAP to that provider, but this is ussually not for free so you need to hire them. There´s also one link provided by the goverment to manually validate each invoice:
    https://www.consulta.sat.gob.mx/SICOFI_WEB/ModuloECFD_Plus/ValidadorComprobantes/Validador.html
    For detailed steps for implementing certificates I strongly suggest you to review note 1300880.
    I hope this may help you.
    Regards
    RP

  • Java Mapping to Digital Signature (web service scenarios)

    Hi All,
    I'm working with Web Service Scenarios and I have a problem.
    The Web Service has a Schema for validation data and I send data to method of WS, example:
    Web Service Description
    <SendData xmlns="http://www.sdn.com/schema.xsd">
       <InputXML>string</InputXML>
    </SendData>
    For send data to "InputXML" is obligatory digital signature in Java.
    I created a Java Mapping where get message of schema xsd, clear prefixes of tag and convert all schema to string.
    Now Web Service response a error, because string is not contain "<" ">" just contain asc & lt; & gt;
    Ex:
    & lt;CodigoMunicipio& gt;2927408& lt;/CodigoMunicipio& gt;
    In Debug Java Mapping in statement:
    before
    <CodigoMunicipio>2927408</CodigoMunicipio>;
    rootelement.appendChild(element);
    After
    & lt;CodigoMunicipio& gt;2927408& lt;/CodigoMunicipio& gt;
    And If use a rotine to convert it, in sxi_monitor generate a exception because not understand string field.
    Can you help me?
    Regards,
    Bruno

    Hi Bruno,
    there are two ways to nest a xml document into another xml document.
    The first one is escaping the XML, just like you did:
    <document_one>
    <input_xml>
    &gt;document_two&lt;&gt;tag_a&lt;value&gt/tag_a&lt;&gt;/document_two&lt;
    </input_xml>
    </document_one>
    http://stackoverflow.com/questions/1091945/where-can-i-get-a-list-of-the-xml-document-escape-characters
    The other is using the CDATA tag.
    <document_one>
    <input_xml>
    <![CDATA[<document_two><tag_a>value</tag_a></document_two>]]>
    </input_xml>
    </document_one>
    http://www.w3schools.com/xml/xml_cdata.asp
    Then, if your webservice expects to receive a XML document inside the InputXML tag, probably it will be able to handle one of these techniques.
    Best regards,
    JN

  • Digitally Signing specific SOAP elements using Java Mapping

    Hello SDNers,
    Iu2019m having trouble creating java mappings to sign and verify digital signatures.  Iu2019m new to Java so this is proving difficult.  I understand the basic concepts of OO programming and utilizing classes/objects to build the program, but Iu2019m having trouble with the conceptual understanding of how I would like to get this done.
    I have outbound and inbound messages.  The outbound messages are originating from an ECC backend.  The messages are processed through PI with a basic Message Mapping, then it is wrapped in a SOAP envelope with specific information using a XSL mapping and then I would like to use a Java Mapping to Digitally Sign specific portions of the entire message; specifically around an element in the SOAP header and sign the SOAP body.  I also need to verify these sections for all inbound messages.
    The simple pseudo code I have for the outbound messages is as follows:
    <ol>
    <li>1. read in xml (file input stream)</li>
    <li>2. find the (specific information)</li>
    <ol>
    <li>a. assign that string to a variable</li>
    <li>b. sign this variable with the security profile (keystore, private key)</li>
    <li>c. e-write the variable into the main xml file</li>
    </ol>
    <li>3. find the soap body</li>
    <ol>
    <li>a. assign that string to a variable</li>
    <li>b. sign this variable with the security profile (keystore, private key)</li>
    <li>c. re-write the variable into the main xml file</li>
    </ol>
    <li>4. write the output file with both variables written (file output stream)</li>
    </ol>
    Currently Iu2019m using PI 7.1 so there is no more Visual Administrator tool.
    Iu2019ve seen the examples from the last link, but I canu2019t seem to put it together when mixed with basic java mapping example.  I have been searching the SDN forums for a while now, but hereu2019s my specific question:  how do you create a java mapping to sign and verify specific elements of a SOAP message?
    Thanks in advance,
    Jason

    Hi Jason, did you ever architect a solution for this?

  • Digital Invoice Mexico

    Hello everybody!
    We implemented the digital invoice Mexico.
    But we find a problem with a process of IVA RETENIDO.
    In our price, the IVA RETENIDO is being calculated using a Z condition, to account for the same amount of tax in a different account, But this value making the total value that comes out in the XML file is incorrect.
    I have doubts about the pricing procedure tha We are using here.
    Is there a price stand of SAP to show me how a process is calculated IVA RETENIDO?
    What is the tax code is valid for this process? We are using the B4.
    Any tips will be helpful.
    I thank everyone's attention
    Mary Nuvoloni
    SD Consultant

    Hi,
    Withholding tax in sales for Mexico can be customized in several ways so SAP released a BADI in order to correctly determine the source of this amout: IDMX_DI_SDDATA_DET
    With this BADI you can change the data determination for the OIM (Original Input Message) and also the field in the IDOC that will be maped in the XML.
    Usually withholding conditions would use "W" as condition type in customizing and this can help you to access KOMV table for the rigth amount.
    Regards,
    RP

  • Digital Invoice - Mexico new compliance (approval reqd?)

    We are implementing Digital mexico invoice and I am looking at different notes for implementation...
    I came across this post in SCN,
    http://weblogs.sdn.sap.com/cs/mobile/view/wlg/21066?x-topic=85
    u2022 Take effect January 1, 2011
    u2022 Eliminate folio numbers which are replaced by digitally signing and archiving an invoice with a valid timbre number
    u2022 Require regulatory compliance checks with government certified organizations for both senders and receivers of invoices
    u2022 Invoices in excess of 2,000 pesos must be approved digitally
    Companies will be required to integrate with the SAT for invoice approvals in real time. 
    Outgoing invoices must be prepared in a specific XML format and authorized in advance as part of the logistics process before shipments can be delivered.
    When I look at the scope document attached to  in SAP Note 1280467 - FAQ Digital Invoice Mexico, it has no reference to this requirements (it still refers to a monthly report to be sent to govt and has no reference regarding govt. approval)..also the PI note has reference to synchronous interface?
    Do we need to manually implement the additional / new requirements?

    We had raised a OSS message and it looks like SAP does not support the latest requirements (CFDI).  We are in the process of evaluating our options.
    I will keep this thread open for a while to see the approach that is expected to be taken by others.

  • Mexico E-Invoicing

    Hi
    Can anyone  please explain me how can we achieve e-invoicing for Mexico according to SAT guidelines. I went through couple of forms here, but not clear enough with process.
    thanks,
    Vaishnavi

    Hi Vaishnavi.
    Please see below:                                                                               
    1. ERP notes:                                                               
    Basis:                                                                      
    - import certificates for the encryption (note 1300880).                    
    - "core" note of the digital invoice (note 1303712)                         
    - ODN: Official Document Numbering (note 1301160)                                                                               
    ABAP:                                                                       
    - Consulting notes to extend the standard Idoc to be able to have all       
    the required data for the                                                   
    digital invoices (notes: 1109487, 1318342, 1321680, 1313457)                
    - If required, activate the different Badis available to complete the       
    data. The list of the Badis is in the                                       
    documentation of the "core" note 1303712.                                   
    - Modify the SAPScript (or the tool used) to add into the print invoice     
    all the Digital Invoice data                                                
    required by the government (SAT).                                                                               
    SD / FI:                                                                    
    - Configurations defined in the documentation of the "core" note 1303712    
    and in note 1301160 (ODN).                                                                               
    2. XI/PI note:                                                              
    PI / ABAP                                                                   
    - Note 1296042 (some parts of this note have to be defined in the ERP       
    too). This note allows the                                                  
    generation of the XML based on the Idoc data imported into PI  
    Due to technical restrictions concerning the shipment of IMG structures
    in SAR files, we are not able to                                       
    provide the IMG structure as an attachment to an SAP Note.                                                                               
    In this case I kindly ask you to review this documentation and also    
    check the SAR file 603_E38K096525.zip                                                                               
    I hope it helps you.                                                        
    Regards
    Ruy Castro

  • Keystore access in Java Mapping Program - user J2EE_GUEST

    Dear Gurus,
    I have the following problem:
    I need to validate the digital signature of a XML document and I'm using some examples provided by SAP as follows:
              InitialContext ctx = ctx = new InitialContext();          
              Object o = (Object) ctx.lookup("keystore");          
              KeystoreManager manager = (KeystoreManager) o;          
              KeyStore ks = manager.getKeystore("Serasa");
    {/code}
    But I get the error below, saying that user J2EE_GUEST is not authorized. How do I change the user who executes java mapping, because I granted permissions in Visual Admin to another user.
         at com.sap.aii.ibrun.sbeans.mapping.MappingServiceObjectImpl0_0.processFunction(MappingServiceObjectImpl0_0.java:131)
         at sun.reflect.GeneratedMethodAccessor267.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
         at $Proxy218.processFunction(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor266.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:284)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:254)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:219)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    Caused by: com.sap.engine.services.keystore.exceptions.BaseKeystoreException: User is not authorized to execute keystore operation[{GET_VIEW Serasa }]
         at com.sap.engine.services.keystore.impl.security.UserBasedSecurityConnector.checkUserPermission(UserBasedSecurityConnector.java:889)
         at com.sap.engine.services.keystore.impl.security.SecurityRestrictionsChecker.checkUserPermission(SecurityRestrictionsChecker.java:52)
         at com.sap.engine.services.keystore.impl.security.SecurityRestrictionsChecker.isUserAuthorized(SecurityRestrictionsChecker.java:148)
         at com.sap.engine.services.keystore.impl.security.SecurityRestrictionsChecker.checkPermission(SecurityRestrictionsChecker.java:174)
         at com.sap.engine.services.keystore.impl.ParameterChecker.checkPermission(ParameterChecker.java:35)
         at com.sap.engine.services.keystore.impl.KeystoreManagerImpl.checkPermission(KeystoreManagerImpl.java:46)
         ... 28 more
    Caused by: java.security.KeyStoreException: (thread: SAPEngine_Application_Thread[impl:3]_56,view:Serasa, entry: , user: J2EE_GUEST) - checkPermissions  'getView': com.sap.engine.services.security.exceptions.BaseSecurityException: Caller not authorized.
         at com.sap.engine.services.keystore.impl.security.UserBasedSecurityConnector.checkFailed(UserBasedSecurityConnector.java:1097)
         at com.sap.engine.services.keystore.impl.security.UserBasedSecurityConnector.checkPermissions_getView(UserBasedSecurityConnector.java:773)
         at com.sap.engine.services.keystore.impl.security.UserBasedSecurityConnector.checkUserPermission(UserBasedSecurityConnector.java:823)
         ... 33 more
    {/code}
    Thank you very much

    Hi Fabio,
    first of all have you checked if standard functions to verify digital signature for pi adpaters would work for you?
    We have used the following code to access the Keystore in a custom adapter. It accesses the keystore with the access rights of a JEE application (it has a reference to the sample adapter "sap.com/com.sap.aii.adapter.sample.ra"). Check out if it works in your mapping, too.
    import java.security.Key;
    import java.security.KeyStore;
    import java.security.KeyStoreException;
    import java.security.NoSuchAlgorithmException;
    import java.security.PublicKey;
    import java.security.UnrecoverableKeyException;
    import java.util.HashMap;
    import java.util.Map;
    import javax.resource.ResourceException;
    import com.sap.aii.af.service.resource.SAPSecurityResources;
    import com.sap.aii.security.lib.KeyStoreManager;
    import com.sap.aii.security.lib.PermissionMode;
    public class XIKeystoreAccessor {
        private static final XITrace TRACE = new XITrace(XIKeystoreAccessor.class.getName());
        static XIKeystoreAccessor instance = null;
        SAPSecurityResources securityResources;
        KeyStoreManager keystoreManager;
        Map<String, KeyStore> keystores = null;
        private XIKeystoreAccessor() throws ResourceException {
         final String SIGNATURE = "XIKeystoreAccessor()";
         TRACE.entering(SIGNATURE);
         keystores = new HashMap<String, KeyStore>();
         securityResources = SAPSecurityResources.getInstance();
         try {
             keystoreManager = securityResources.getKeyStoreManager(PermissionMode.SYSTEM_LEVEL,
                  new String[] { "sap.com/com.sap.aii.adapter.sample.ra" });
         } catch (KeyStoreException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         TRACE.exiting(SIGNATURE);
         * Get a key from AS Java keystore
         * @param view
         * @param alias
         * @param password
         * @return
         * @throws ResourceException
        public Key getPrivateKey(String view, String alias, String password) throws ResourceException {
         final String SIGNATURE = "getPrivateKey()";
         TRACE.entering(SIGNATURE);
         KeyStore keystore = getKeystore(view);
         Key privateKey = null;
         try {
             privateKey = keystore.getKey(alias, password.toCharArray());
             if (privateKey == null) {
              throw new ResourceException("Key not found. alias=" + alias);
         } catch (KeyStoreException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         } catch (NoSuchAlgorithmException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         } catch (UnrecoverableKeyException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         TRACE.exiting(SIGNATURE);
         return privateKey;
        public PublicKey getPublicKey(String view, String alias) throws ResourceException {
         final String SIGNATURE = "getPublicKey()";
         TRACE.entering(SIGNATURE);
         KeyStore keystore = getKeystore(view);
         PublicKey publicKey = null;
         try {
             publicKey = keystore.getCertificate(alias).getPublicKey();
             if (publicKey == null) {
              throw new ResourceException("Key not found. alias=" + alias);
         } catch (KeyStoreException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         TRACE.exiting(SIGNATURE);
         return publicKey;
         * Get a keystore i.e. a view from AS Java
         * @param view
         * @return
         * @throws ResourceException
        public KeyStore getKeystore(String view) throws ResourceException {
         final String SIGNATURE = "getKeystore()";
         TRACE.entering(SIGNATURE);
         KeyStore keystore;
         try {
             if (keystores.containsKey(view) == true) {
              keystore = keystores.get(view);
             } else {
              keystore = keystoreManager.getKeyStore(view);
              if (keystore == null) {
                  throw new ResourceException("Keystore not found. view=" + view);
              keystores.put(view, keystore);
             TRACE.exiting(SIGNATURE);
             return keystore;
         } catch (KeyStoreException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
        static public XIKeystoreAccessor getInstance() throws ResourceException {
         if (instance == null) {
             instance = new XIKeystoreAccessor();
            return instance;

  • Problems with Java Mapping in Bpm

    Hello to All.
    I have a simple scenario...
    1) Receiver ( XML1)
    2) Transformation
    3) Sender (XML3)
    I have 3 variables.  
    Variable 1  XML1
    Variable 2  XML2
    Variable 3  XML3
    In my transformation have two source.. an XML and XML2 and my mapping program is java mapping.
    The java mapping modify the XML1 according the XML2 and transform in XML3.
    When I run BPM . I have problem , because the flow stop in transformation.

    Yes I have tested. But I found the solution.. The java mapping generate a header like <xsi : Message1></>... <xsi : Message2> </>
    Thanks.

  • Java mapping help please

    Hi all,
    I need help with java code please.
    My source is a csv file and target is multiple idocs.
    Source file structure is as follows:
    Header (field 1, field 2, ........ field 10)
    Item 1a (field 1, field 2, field 3, .........    field 180)
    Item 1b (field 1, field 2, field 3, .........    field 180)
    Item 2a (field 1, field 2, field 3, .........    field 180)
    Item 2b (field 1, field 2, field 3, .........    field 180)
    Item na (field 1, field 2, field 3, .........    field 180)
    Item nb (field 1, field 2, field 3, .........    field 180)
    First line is header. Second is VAT line. Third is Price line for that VAT. Now VAT and Price lines repeat. There need not be VAT line for non-European countries. So a VAT line may or may not preceed a Price line.
    For example: the lines can be like:
    Header
    VAT1
    Price1
    VAT2
    Price2
    Price3
    1) Now, it should produce 3 idocs like:
    Header, VAT1, Price1
    Header, VAT2, Price2
    Header, Price3
    2) One idoc should be created per a pair of VAT and Price lines and they will be identified by a co-relation of a particular field. So first I have to sort all the lines based on this field value. Then I have to read the lines in pairs. If no Vat line, I should just read the Price item and produce an idoc.
    Can you please help me with the java code for this?
    Many thanks in advance.
    Ramesh.

    Many thanks Ram.
    The reason for thinking to go for java mapping is that there is no keyfield for price line. The source file is a pipe delimited csv file. There is a keyfield for VAT line. The same field will be empty for the Price line. I am trying to ask them to at least provide a space for that field between the pipes for price line so that I can use in FCC. It looks like they can't modify the source file.
    Any inputs please?
    Regards.
    Ramesh.

  • Java mapping help pls

    hi all,
    I've a source structure like this below in PI.
    <MAT>
    <doc type>pdf</doc type
    <subnumber>1234</subnumber>
    <id>45ABC<id>
    <matno>ABCD</matno>
    <filename>transaction1.pdf</filename>
    </MAT>
    target structure would be the same but one more field <filecontent> which is bytearray content such as content=[101, 115, 116, 13, 10, 84, 101, 115, 116, 13, 10, 84, 101, 115, 116, 13, 10, 84, 101, 115, 116, 13, 10, 13, 10, 84, 101, 115, 116, 13, 10, 84, 101, 115, 116, 13, 10, 13, 10, 84, 101, 115, 116, 13, 10, 13, 10, 84, 101, 115, 116, 13, 10, 84, 101, 115, 116, 13, 10]
    <MAT>
    <doc type>pdf</doc type
    <subnumber>1234</subnumber>
    <id>45ABC<id>
    <matno>ABCD</matno>
    <filename>transaction1.pdf</filename>
    <filecontent>bytearraycontent</filecontent
    </MAT>
    And target is HTTP post for posting the above attribute names and values in the body of HTML
    I am writing a java mapping program because I have to read the <filename> tag value from the incoming xml and read the file from PI server location and convert the file content to bytearray and also to map it to target structure for HTTP post. I am requesting help from java experts here in modifying the program according to this requirement. pls help
    package com.usahealth.mapping;
    import java.io.InputStream;
    import java.net.URL;
    import java.net.URLConnection;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class ReadAttrMap extends AbstractTransformation {
      @Override
      public void transform(TransformationInput in, TransformationOutput out)
      throws StreamTransformationException {
      AbstractTrace trace = null;
      try {
      // Initialize Trace
      trace = getTrace();
      // Get Input Message as DOM
      DocumentBuilderFactory docBFactory = DocumentBuilderFactory
      .newInstance();
      docBFactory.setNamespaceAware(true);
      DocumentBuilder docBuilder = docBFactory.newDocumentBuilder();
      Document inDoc = docBuilder.parse(in.getInputPayload()
      .getInputStream());
      inDoc.getDocumentElement().normalize();
      // Read from PayLoad  - here is where I need help to read the filename - convert it to byte array and read other xml tag values and pass  to target structure for HTTP post. I am using HTTP receiver adapter for posting
      } catch (Exception e) {
      trace.addInfo(e.getMessage());
      throw new StreamTransformationException("Mapping Exception: "
      + e.getMessage(), e);
    thx
    mike

    Indrajit, thx again
    So I believe, the java mapping has to be changed to not pass MAT for create element
    // building the target structure   Element target = newdoc.createElement("MAT");  - I have to remove this
    newdoc.appendChild(target);  - have to remove this.   Element doctype = newdoc.createElement(root.getChildNodes().item(1)  will be changed to item(0)
      .getNodeName()); 
    And also to add the logic for  [    ]
    String data = "["; 
    if (fileArray != null) { 
    for (int i = 0; i < fileArray.length; i++) { 
    if data = "[";
    data = data + fileArray[i]; 
    else
    if (i < fileArray.length - 1) { 
    data = data + ","; 
    endif.
    data = data + "]";
    is this right?
    thx indrajit
    -mike

Maybe you are looking for

  • IWeb "Original Size" download option? -- Not Even Close!

    Unless I'm doing something very wrong -- which I sincerely hope is the case -- then iWeb's photo prefs are guilty of seriously false advertising. I'm trying to create a "My Albums" page, such that the photos in the various albums it indexes can be do

  • All of Microsoft Office has disappeared.  Can't open files in Dropbox.  Help!

    All of Microsoft Office has disappeared.  Can't open files, even in Dropbox, even after installing LibreOffice.  Can you help me?

  • Convert physical standby to logical

    Hi everybody!! This is my first message on this forum, altought i have been reading few time before (around 4 months) I have a "problem" in my database environment. I must change a physical standby to a logical standby. This cahnge is possible with d

  • Autoconfig error on DB Tier after changing apps password

    Hi, I have changes APPS password in my new cloned instance. Autconfig on db tier encountered below error. we are on application 12.1.2, RDBMS 11.1.0.7, OS RHEL 5.4. =================================================== Executing script in InstantiateFi

  • Creating Multiple Windows

    Hi, I am trying to create a java applet that links to multiple windows when clicked. Basically I will have an applet with 2 buttons, one saying "show calculator," the other saying "mortgage." Upon clicking each one, it should open the corresponding w