Can we call a Java Map in Message  Map

Hello,
Can we call a Java Map in Message  Map
Thanks and Regards
Hemant

Hello Vijay,
I think this is your code:
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.AbstractTrace;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import java.util.Map;
import java.io.*;
public class PayloadToXMLField1 implements StreamTransformation {
    String strXML = new String();
   //Declare the XML tag for your XML message
   String StartXMLTag = "<DocumentBody>";
   String EndXMLTag = "</DocumentBody>";
   //String StartXMLTag1 = "<Code>";
   //String EndXMLTag1 = "</Code>";
    AbstractTrace trace;
    private Map param = null;
    public void setParameter(Map param) {
        this.param = param;
    public void execute(InputStream in, OutputStream out) {
        trace =
            (AbstractTrace) param.get(
                StreamTransformationConstants.MAPPING_TRACE);
        trace.addInfo("Process Started");
        try {
            StringBuffer strbuffer = new StringBuffer();
            byte[] b = new byte[4096];
            for (int n;(n = in.read(b)) != -1;) {
                strbuffer.append(new String(b, 0, n));
            strXML = strbuffer.toString();
        } catch (Exception e) {
            System.out.println("Exception Occurred");
        String outputPayload =
            StartXMLTag
         + "<![CDATA["
         + strXML
         + "]]>"
         + EndXMLTag;
        try {
            out.write(outputPayload.getBytes());
         trace.addInfo("Process Completed");;
        } catch (Exception e) {
            trace.addInfo("Process Terminated: Error in writing out payload");;
I need this code to be converted in UDF if Java map cannot be called in Message Map.
Can anyone help me how to write UDF for the same java map.
Thanks and Regards
Hemant

Similar Messages

  • Web Service call from java UDF in message mapping

    Hi,
           Is it possible to call a web service from inside a java UDF in message mapping? The webservice can be any standard one. If this is possible please let me know how this can be done.
    Regards,
    Shiladitya

    Hi Shila,
                 Hope u remember me
    Here is the standard code used to call webservice from Java UDF
    public String setSoapAction(String SOAPAction,Container container){
    try{
    DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey soapurl = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/SOAP" , "THeaderSOAPACTION");
    conf.put(soapurl, SOAPAction);
    return "";
    }catch(Exception e){
    e.getMessage();
    return "";
    Regards,
    Arijit

  • XI 7.0 passing attributes between java mapping and message mapping

    Hi all,
    Here's a newbie question. There is a scenario where an interface mapping has several stages of java mapping and message mapping
    I would like to know how to set attributes in the java mapping so that it can be accessed in a message map (or vice versa). What I intend to do is pass some information from one mapping to the other so that action can be taken based on the values passed.
    Thank you!

    Another option is storing the values in the message header in the same way as the Adapter-Specific Message Attributes:
    http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm
    Just use your own name/namespace combination, which is not used in any adapter.
    If possible use the way that Sandro proposed and add the information which you need to additional tags in the payload.
    Regards
    Stefan

  • Mapping Tracing in Java Section of Message Mapping

    Hi,
    Is it possible to get the Mapping Trace Object in the JAVA SECTION of the Message Mapping?
    To access the<a href="http://help.sap.com/saphelp_nw04/helpdata/en/c8/98e7d5c1620642973565ea3dd319d1/content.htm">Mapping Trace Object</a>, we need the instance of the <a href="http://help.sap.com/saphelp_nw04/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/content.htm">Container Object</a>. SAP help says, Container Object is made available to every User Defined Function .
    What we need is how can we get the current instance of the Container Object in the JAVA Section of Message Mapping. Any ideas?
    Regards,
    Bhavesh

    Hi Bhavesh,
    It seems you can access global container from any part of Graphical mapping.
    According to Access StreamTransformation values in Java initialisation section:
    <b>The mapping program is a class derived from the interface GlobalContainer. So you can use the methods of GlobalContainer all the time during the mapping program.</b>
    Plz refer the link to the related thread.
    Regards,
    Ananth

  • How can I call a java object from Web dynpro ABAP application?

    I made Web dynpro ABAP application and posted it to SAP EP.
    For certain business purpose, we need to call external 3rd party java object using 3rd party's java api in Web dynpro application.
    Is there anybody who experienced this kind of java interface issue?
    I know Web dynpro Java environment can fully support this kind of requirement. but regarding Web dynpro ABAP, I couldn't find any clue for this.
    Any comment or suggestion would be greatly appreciated.
    Thanks,
    Raymond, ABAP Consultant

    if you have jco configured, then you can make calls to java api from ABAP .
    check out this weblog.
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    Raja

  • TS3992 How can I back up an iphone when I haven't set the phone up for back ups & the touch screen doesn't work? The phone can receive calls (not answer) & the pictures & messages can be seen but touch screen doesn't work to unlock the phone or select any

    How can I back up an iphone when I haven't set the phone up for back ups & the touch screen doesn't work? The phone can receive calls (not answer) & the pictures & messages can be seen but the touch screen doesn't work to unlock the phone or select anything. We want to save/transfer pictures, contacts, and music to the replacement phone.

    Try backing it up to your computer with iTunes.  Connect it to your computer, open iTunes, click on the name of the phone in iTunes, go to the Summary tab of your iTunes sync settings and click Back Up Now.  Also go to File>Devices>Transfer Purchases to transfer you apps and other purchased media to your iTunes library.

  • Exchanging data between interface mapping and message mapping possible?

    Hi,
    please have a look at my interface mapping:
    source message -
    >
    mapping programs
    1. Java mapping
    2. XSL mapping
    3. message mapping
    > target message
    in my scenario a Java Class (1) is called for the interface mapping. There, some information ist read from the xml structure. Next, a xslt mapping (2) takes place that strips some information. The remaining data is passed to the message mapping (3)
    The reason for this is that the source message consists of a xml message inside an xml message.
    I am looking for a way to access the informationen gained in step 1 (Java class) in the message mapping (step 3). I was hoping that the global container (used by user-defined function within message mapping) is accessible from the java mapping, but I could not find out how.
    Anybody with some ideas how to pass information from step 1 to step 3? I cannot put the Information in the xml that is passed to the message mapping, because the schema of the inner xml cannot be changed.
    Thanks very much, best regards,
    Wolfgang

    Hi Wolfgang!
    I have used the "Dynamic Configuration" section in the XI Message header for this issue. You could write something into the Dynamic Configuration Section in step 1 (Java-Mapping) and read it out again in steps 2 or 3. You could use a section for a adapter you are not using in your interface for the real receiver. So if you have a File-Receiver Adapter at the "end" you could use some section of the e.g. SOAP adapter not to interfere with your receiver-adapter when using Dynamic Configuration Settings there ...
    See also: http://help.sap.com/saphelp_nw04/helpdata/de/43/09b16006526e72e10000000a422035/content.htm
    or
    http://help.sap.com/saphelp_nw04/helpdata/de/43/0a7d1be4e622f3e10000000a1553f7/content.htm
    Best regards,
    Andi

  • Hi , friends pls explain abap mapping and message mapping

    1) pls explain abap mapping and message mapping
       send me screen shorts also.

    Hi
    Mapping Techniques
    XI provides 3 standard ways of interface mapping between source and target.
    Graphical mapping
    Java Mapping
    XSLT Mapping
    Two more additional mapping types can be activated in XI by making changes to the exchange profile. Those two mappings are
    ABAP mapping
    XSLT mapping with ABAP Extensions
    Graphical Mapping
    Graphical mapping is a common approach followed by everyone for generating desired target structure. It involves simple drag-n-drop to correlate respective nodes (fields) from source and target structure. It hardly involves coding. (Exception - User defined functions). But sometimes with graphical mapping it is difficult to produce required output. For example ... text/html output, namespace change, sorting or grouping of records etc.
    ABAP Mapping
    A person comfortable with Object Oriented ABAP can go for ABAP mapping instead.
    Java Mapping
    Java Mapping uses 2 types of parsers. DOM and SAX. DOM is easier to use with lots of classes to help you create nodes and elements, but , DOM is very processor intensive.
    SAX parser is something that parses your XML one after the other, and so is not processor intensive. But, it is not exaclty easy to develop either.
    XSLT Mapping
    One can also think of Java mapping as another option but it is a bit complex and required knowledge of Java. In such cases, XSLT mapping can be the best approach to meet the requirements.
    A few example cases in which an XSLT mapping can be used:-
    When the required output is other than XML like Text, Html or XHTML (html displayed as XML)
    When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
    When data is to be filtered based on certain fields (considering File as source)
    When data is to be sorted based on certain field (considering File as source)
    When data is to be grouped based on certain field (considering File as source)\
    Advantages of using XSLT mapping
    XSLT program itself defines its own target structure.
    XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
    XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
    File content conversion at receiver side can be avoided in case of text or html output.
    Multiple occurrences of node within tree (source XML) can be handled easily.
    XSLT can be used in combination with graphical mapping.
    Multi-mapping is also possible using xslt.
    XSLT can be used with ABAP and JAVA Extensions.
    Disadvantages of using XSLT mapping
    Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
    Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
    XSLT mapping requires more memory than mapping classes generated in Java.
    XSLT program become lengthier as source structure fields grows in numbers.
    XSLT program sometimes become complex to meet desired functionality.
    Some XSL functions are dependent on version of browser.
    Different types of Mappings
    MAPPING SUPPORTED BY XI
    Message Mapping -> Graphical Design and testing environment. Default Provided By XI. Queue based modelling allow handling or large documents. Extensible via user defined functions
    XSLT Mapping - > Based on openstandard, Portable across application platform, Extensible using user defined functions kewl but disadvantage is Memory overload while handling large documents.
    SAX -> Simple Api For XML. -> Allows you to parse through a XML document. Doesn't consume any memory. But the message can be parsed only once from top to bottom. It Has evolved by contributions made by group of ppl itz a open architecture.
    DOM -> Document Object Model -> Itz designed by W3C. Consumes Memory as the message will be loaded. Allows parsing of document in both way top down and bottom up.
    Send me your email id.Shall send you very good docs for both ABAP Mapping and message mapping.
    Thanks

  • Interface Mapping VS Message Mapping

    What is the meaning of Interface mapping and Message mapping in real business?
    I think it is something like the difference between the class and object. object is an instance of class.
    While talking about the mapping, there are the source interface and target interface. Can two source intefaces map to only one interface, and what about the vs verse? And how about the message mapping?
    Thanks a lot

    Hi -
    First, an Interface Mapping is not only linked with "Message Mappings" (which is the XI term for a mapping created with the XI graphical tool), but any other XI supported mapping type (e.g. XSLT, Java, or ABAP).  So basically, an Interface Mapping is used to link a source interface to a target interface via a mapping (of any of the supported types).  At runtime, you can't have an interface mapping without a mapping and a mapping without an interface mapping - they need each other.
    <i>>>>Can two source intefaces map to only one interface, and what about the vs verse? And how about the message mapping?</i>
    Yes, the ratio of source to target interfaces are n:m.  In those multiple cases, Multi-Mappings are typically involved as mentioned in the previous post.
    Also, remember that in one interface mapping, you are not limited to one mapping.  More than one mapping (of any type) can execute in the sequence you have set up in the Interface Mapping.  However, watch out for performance in these back-to-back(to-back) mappings.
    Regards,
    Jin

  • How can I call a java class from within my program?

    I was wondering if there's a platform independent way to call a java class from my program.

    Here's my scenario. I'm working on a platform independent, feature rich, object-oriented command prompt program. The way I'm designing it is that users can drop classes they write into my bin directory and gain access to the class through my program. For example, they drop a class named Network.class in the bin directory. They would type Network network at my command prompt and gain access to all the methods available in that class. They can then type system.echo network.ipaddress() at my prompt and get the system's ip address. I have it designed that there's a server running in the background and the clients connect to my port. Once connected the end-user can enter their user name and password and gain access to the system. When they type a command they actually call another java program which connects to my server using a seperate thread. They can then communicate back and forth. I have it set that everything has a process id and it's used to keep track of who called what program. Once the program is done it disconnects and closes. Rather than getting into the nitty gritty (I didn't want to get into heavy detail, I know how everything will work) I'm really interested in finding out how I can call a java program from my program. I don't want it to be part of the app in any way.

  • How to call external java functions in XSLT Mapping Programs

    Hi All,
    I am unable to call java programs in XSLT MAPPING.
    I tried by following the blog...but getting error :
    XSLT Mapping With JAVA Enhancement ( For Beginners)
    I need some input from you all.
    Waiting For quick reply.
    Rgds Somu.

    i wrote the code...
    and getting error in interface mapping..
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:MyLib="java:datetime.DateandTime">
         <xsl:template match="/">
              <Order DocType="OrderCreate" Version="2.0.2">
                   <Header>
                        <RequestingDocumentIdentifier>
                             <DocumentIdentifier>
                                  <xsl:value-of select="concat('IDOC',//EDI_DC40/DOCNUM)"/>
                             </DocumentIdentifier>
                        </RequestingDocumentIdentifier>
                        <RequestingDocumentDateTime>
                             <DateTime DateTimeQualifier="On">
                                            <xsl:if test="function-available('MyLib:getDateValue')">
                       <xsl:value-of select="MyLib:getDateValue()"/>                   
      </xsl:if>
                                        </DateTime>
                        </RequestingDocumentDateTime>
                        <From>
                             <PartnerInformation>
                                   <PartnerName>BASF SA</PartnerName>
                                    <PartnerIdentifier Agency="AssignedByBASF">
                                     <xsl:value-of select="//E1EDK14[QUALF='014']/ORGID"/>
                                    </PartnerIdentifier>
                             </PartnerInformation>
                        </From>
                        <To>
                        <PartnerInformation>
                             <PartnerName>BASF CORP CHEM DIV</PartnerName>
                             <PartnerIdentifier Agency="D-U-N-S">001307032</PartnerIdentifier>
                        </PartnerInformation>
                   </To>
                   </Header>
              </Order>
         </xsl:template>
    </xsl:stylesheet>

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' &#0124; &#0124; good_ids &#0124; &#0124; ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • How can I call a java-program as receiver

    Hi Folks,
    I have to call a java program, based on the XI-Server as receiver. My qustions are:
    What is the right adapter type
    What are the parameters to give the xml to the program
    Thanks a lot
    matthias

    Hi Mathias,
    I would suggest, generate a java proxy of ur inbound interface (reciever).
    1. In the java proxy implementation method you will
        have  access to the message sent to the interface,
    2. You could then use this message(XML) and Call ur
        custom java program from the java proxy.
    here is a link on how to implement java proxies
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Naveen

  • Can we call Plain JAVA Code online via MDM Cient

    Hi SDNers,
    For some validation purpose i need to write a JAVA Code(Some body told me that it can be possible i.e we can Java Code for doing Validation)
    i have two Questions.
    1. Can we call JAVA Code online via MDM Client.
    2. where i have to write this JAVA Code and what will be steps of writing this Code.
    Thanx in Advance.

    Hi Tanveer,
    Thanx a lot for ur prompt reply
    Pls reply my this Question also promptly i will be highly thankful for it.
    Q.
      My Requirment is i have to do the validation
      "on the basis of acct grp i have to put validation
          a. the G/L acct must be in particular range.
          b. it must have specific length"
    My sr. developer is saying simply putting the IF ELSE condition in the validation Editor technique 'ld be hard to maintain at later stage as we large number of Acct Grps.
      He is saying look for some Custom function for it
    "SO TELL ME CLEARLY THAT
                                                   --CAN I USE JAVA API FOR THIS
                                                   --AS A EXP. MDM CONSULTANT WILL U
                                                      RECOMMEND IT?
                                                   --IF YES
                                                     THEN
                                                          WHAT 'LD BE EXACT STEPS.
                                                 ---IF NO
                                                    THEN
                                                         WHAT ARE THE OTHERS WAYS
                                                         i.e
                                                         IF U R FACING THIS PROBLEM THEN WAT
                                                         SOLN U R GOING TO USE?
    PLS
    REPLY ASAP as per the exact question(i.e all parts of Q)
    i will highly thank for u.
    Regards
    kuldeep

  • Can I call a Java program from a SQL Server Trigger?

    Hello,
    I want to encrypt some data in a database column in SQL Server. Today I am using java code to encrypt the value and store it in the database using JDBC.
    Now I want to use a VB client to store the encrypted value in the SQL Server DB. Since the encryption is handled by a java class, can I write a trigger in SQL Server that while inserting the raw data, calls the java class for encrypting the value and then inserts the encrypted value into the column?
    In general, is it possible to call a java class from a SQL Server trigger?
    Thanks
    Bipin

    Here are 3 examples of code for insert, update and delete:
    CREATE TRIGGER [PLI_INSERT_TRIGGER] ON [dbo].[PLI]
    FOR INSERT
    AS
    Declare @cmd sysname, @code sysname, @list sysname
         Select @code = PLI_K_COD, @list = PLI_K_LISTINO from inserted
         Set @cmd = 'java mirrorDb.Copy PLI INSERT ' + @code + ' ' + @list
         EXEC master..xp_cmdshell @cmd
    CREATE TRIGGER [PLI_UPDATE_TRIGGER] ON [dbo].[PLI]
    FOR UPDATE
    AS
    Declare @cmd sysname, @code sysname, @list sysname
         Select @code = PLI_K_COD, @list = PLI_K_LISTINO from inserted
         Set @cmd = 'java mirrorDb.Copy PLI UPDATE ' + @code + ' ' + @list
         EXEC master..xp_cmdshell @cmd
    CREATE TRIGGER [PLI_DELETE_TRIGGER] ON [dbo].[PLI]
    FOR DELETE
    AS
    Declare @cmd sysname, @code sysname, @list sysname
         Select @code = PLI_K_COD, @list = PLI_K_LISTINO from deleted
         Set @cmd = 'java mirrorDb.Copy PLI DELETE ' + @code + ' ' + @list
         EXEC master..xp_cmdshell @cmd
    you must go "sql server entreprise manager" right click on the table you want to add triggers and select: all activities, manage triggers.
    You have 3 examples: for an insert, for an update and for a delete
    ON [dbo].[PLI] specify the table on which you want to setup trigger.
    FOR DELETE, INSERT, UPDATE specify the event.
    The Declare statement create the variables in which I want to put some values to pass to the java program, for example which table, which event, which key fields.
    the "Select @code = PLI_K_COD, @list = PLI_K_LISTINO from inserted" set the variables with the value of the columns of the table I am interested to read from my java program, for example the variable @code receive the value of the column pli_k_kod (is the key) of the table PLI.
    The "Set @cmd = 'java mirrorDb.Copy PLI DELETE ' + @code + ' ' + @list " prepared the variable @cmd with the java command followed by the package.classname and parameters.
    The EXEC launch the command to the operating system.
    Daniele

Maybe you are looking for

  • FCC Receiver side

    Hi Experts, Im working with the file to file scenario with FCC receiver side parameters ( sender xml with receiver text). I want my fields with comma separated values...like... abc,xyz,mno.. so on... Im giving the parameters as : HEADER1.fieldSeparat

  • StorEdge 3310 : resize a partition

    Hi all, I've got a 3310 partition that I'd like to resize, filesystem is becoming full. The configuration is like this : Two node cluster, with metasets, two 3310 disk arrays configured with partitions, not logical volumes. Both 3310 have the same co

  • Organization chart plugin doesn't work in apex 4.1

    Hello. I try to user plugin http://www.apex-plugin.com/oracle-apex-plugins/region-plugin/google-visualizations-orgchart_187.html But when I has installed it, it post javascript error: SyntaxError: syntax error +(<!DOCTYPE html PUBLIC "-//W3C//DTD XHT

  • Change text field in profit center document

    Hi, We have a requirement like whenever we changed the text field for an accounting document, it should change the text field of relevant profit center document also. Is there a way to get this change automatically in profit center document. There wa

  • [SOLVED]assigning "special" shell [variable] to awk, got problem

    $ VAR='AB' ; echo "$VAR" | awk -v foo="$VAR" '{gsub(foo,"Z");print}' # [1] Z $ VAR='[AB]' ; echo "$VAR" | awk -v foo="$VAR" '{gsub(foo,"Z");print}' # [2] [ZZ] $ VAR='[AB' ; echo "$VAR" | awk -v foo="$VAR" '{gsub(foo,"Z");print}' # [3] awk: (FILENAME=