Mapping using LookUp RFC

Hi,
I need to read some additional values during my mapping (out of SAP R3 System) So I do the same like described in weblog:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how to perform sap data lookups within xi mappings
I create a new function and "only" changed line:
IFunctionTemplate ft = mRepository.getFunctionTemplate("Z_UOM_LOOKUP");
to:
IFunctionTemplate ft = mRepository.getFunctionTemplate("BAPI_VENDOR_GETDETAIL");
and depending on that:
input.setValue( a , "UOMCODE" );
to:
input.setValue( a , "VENDORNO" );
but anyhow I get everytime following errors - but I don't know WHY??
/usr/sap/XIT/DVEBMGS44/j2ee/cluster/server0/./temp/classpath_resolver/Map6c43119034e911dac59b000d60ec48ba/source/com/sap/xi/tf/_MM_BAPI_LOOKUP_RFC_.java:84: 'class' or 'interface' expected public static void main(String[] args) throws Exception{/!_$ClNRep_/_MM_BAPI_LOOKUP_RFC_ st = new /!_$ClNRep_/_MM_BAPI_LOOKUP_RFC_(); st.testExecute(); } ^
/usr/sap/XIT/DVEBMGS44/j2ee/cluster/server0/./temp/classpath_resolver/Map6c43119034e911dac59b000d60ec48ba/source/com/sap/xi/tf/_MM_BAPI_LOOKUP_RFC_.java:85: 'class' or 'interface' expected } ^
/usr/sap/XIT/DVEBMGS44/j2ee/cluster/server0/./temp/classpath_resolver/Map6c43119034e911dac59b000d60ec48ba/source/com/sap/xi/tf/_MM_BAPI_LOOKUP_RFC_.java:86: 'class' or 'interface' expected ^
3 errors
THX Matt

Hi MATT
Please help me even i am getting same error when i use UDF to call RFC
/usr/sap/AXD/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map7395f740953b11dd9fc900145ec74b8a/source/com/sap/xi/tf/_MM_INF1009_Mfgroutings_to_IDOC_.java:2050: 'class' or 'interface' expected
public void get_UM$(String[] L_MATNR_EXT,ResultList result,Container container){
^
/usr/sap/AXD/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map7395f740953b11dd9fc900145ec74b8a/source/com/sap/xi/tf/_MM_INF1009_Mfgroutings_to_IDOC_.java:2368: 'class' or 'interface' expected
^
/usr/sap/AXD/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map7395f740953b11dd9fc900145ec74b8a/source/com/sap/xi/tf/_MM_INF1009_Mfgroutings_to_IDOC_.java:2369: 'class' or 'interface' expected
^

Similar Messages

  • Message-Mapping: Use same RFC lookup for different target fields

    Hello,
    I need to apply an RFC Lookup which delivers a boolean flag back (true or false). This RFC lookup should be used for different target fields.
    Is there a way to execute the RFC lookup just once and then store the result in an internediate variable that I can use for all futher checks for different target fields?
    If this is not possible and I have to apply the RFC lookup for all necessary target fields is it then executed for each target field ? This is exactly what I want to avoid in order not to slow down performance.
    The input parameter (=source field value) would be the same.
    Thank you for your advice!

    Exactly.
    Here is a UDF example I have that you could adapt to your needs.
    Set
    public String setCounter(String a,String b,Container container){
    /* Store values in global datacontainer
    a: mapping value and return valueparameter
    b: name for stored value parameter
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    myGlobalContainer.setParameter(b.toUpperCase(), a);
    return a;
    Get
    public String getCounter(String a,Container container){
       //write your code here
    GlobalContainer gc = container.getGlobalContainer();
    if (gc.getParameter(a) != null) {
      return String.valueOf(gc.getParameter(a));
    } else {
    return "1";

  • Value Mapping Replication Vs RFC Lookup API Usage Pros and Cons

    Hi Ananth,
       Looking at the options you have, Value Mapping Replication might be a better option, because, by going the second route, you are just trying to simulate how a Value mapping replication works in reality.
    But, when the VMR framework is readily available, why do we need to simulate it by using Java code?
    Moreover, the java code approach will be triggered as many times and the number of messages that are triggered VS the number of times the VMR tables in the Java Runtime gets updated only when there is an entry that is added/modified in the SAP side (Which i feel is less frequent than the frequency of the messages being sent through XI).
    Regards,
    Ravi Kanth Talagana

    Hi,
    There are more issues you need to consider here:
    1) Is this static data or will it change often (the lookup data);
    2) Wether it is a good approach to keep it in middle system? if so who takes the ownership of managing it i.e. update, delete etc from time to time
    3) The tables don't seem small to me for value mapping
    I am not a big expert but i am off the opinion going RFC way as it will keep loose-coupling in place.
    However your issue for not using graphical RFC is not true though, you can pass all your line items as a single object which means only making ONE single call to ECC and then get the return the same way. Think along the lines of internal table as an object
    regards,

  • XI mapping calls an RFC in ERP to validate the ASN against the PO: lookup

    Hi Guys,
    I need validate before sending into  delivery03 IDoc
         The XI mapping calls an RFC in ERP to validate the ASN against the PO
                    I can check through Look up.But need which RFC will check these .
    Regd's
    Raj

    I am not sure there is a standard RFC for that..
    otherwise u can create u r own RFC FM in R3 and can use in lookup UDF.
    Regds,
    Suresh

  • How to Parse the XML generated by Mapping LookUp - RFC API

    Hi Friends,
    I m using the link by Michal Krawczyk for Mapping Lookups - RFC API
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    How to parse the XML created in the target node ?
    Regards
    Pravesh

    Hi,
    Check the second half of my code in this blog,
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    It deals with webservice call's but almost the same for RFC.
    Regards
    Bhavesh

  • XI Mapping lookups RFC API

    Hi mates,
    Can you please share with me the following document on XI Mapping lookups RFC API by Michal?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/xi%20mapping%20lookups%20rfc%20api.pdf
    This link is broken I guess.
    thx in adv
    praveen
    [email protected]

    Hello,
    Why dont you get the article from here?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/mapping%20lookups:%20RFC%20API.pdf
    Regards,
    Jai Shankar

  • Message mapping: table lookup

    The requirement:
    Source message contains some keys and values, and target message has different keys. Values are simply mapped. no problem. but the mapping between source message keys and target message keys is a bit complicated so it is controlled in a seperate table. End users do maintainance jobs on the mapping table on a daily base.
    I checked some threads in this forum and I now understand that this kind of table lookup can be done using the combination of JCo, ABAP programs and ABAP tables, but what is the common way in dealing with such kind of requirement?

    You can use value mapping if you are not looking at picking up values from application system.It is just like SM30 transcation.You can get the info under SAP XI->Design and Configuration->Configuration->Value Mapping.
    If you are in SP13 you can use lookup API SAP XI->Design and Configuration->Design->Mapping look ups.

  • Mapping JDBC lookup: Passing values to multiple fields at target

    Hi all
    i my scenario  i am using mapping JDBC lookup ,and it is working sucessfully.
    but i need to select 4 fields from lookups select query and passing it to 3 different target field at target MT.
    if i use Global container object methods,than only 1 field i can store inglobal container variable..
    and return it 1 the target fields...
    BUT how do i pass 4 fields ,result of the select query to 4 different fields at target MT..
    query :"
    Select BPNO,emp,BENR,bacepack from Ztable where BPNO='"+BPNO[0]+"'";
    Regards
    AjayP

    Hi,
    I have to fetch 3 values and populate it to the 3 fields in the target. The UDF am using is as attached. This UDF is for fetching one value. Kindly tell me about the changes I will have to make to fetch 3 values instead of 1 value.
    String Query = " ";
    Channel channel = null;
    DataBaseAccessor accessor = null;               
    DataBaseResult resultSet = null;                
    // Query to retrieve the PROP value for the particular source value passed.
    Query ="Select PROP from TANKS where ID='" + ID[0] + "' ";
    try{
    //Determine a channel, as created in the Configuration
    channel = LookupService.getChannel("<Business Service>","<Communication Channel>");
    //Get a system accessor for the channel. As the call is being made to an DB, an DatabaseAccessor is obtained.
    accessor = LookupService.getDataBaseAccessor(channel);
    //Execute Query and get the values in resultset
    resultSet = accessor.execute(Query);
    for(Iterator rows = resultSet.getRows();rows.hasNext();){
    Map rowMap = (Map)rows.next();                      
    result.addValue((String)rowMap.get("PROP"));       
    catch(Exception ex){
    result.addValue(ex.getMessage());
    finally{
    try{
    if (accessor!=null) accessor.close();
    catch(Exception e){
    result.addValue(e.getMessage());

  • How to use lookup in xquery(OSB)

    Hi
    In xquery , I have hardcoded the value and compare the hard coded value against input payload and fetch the corresponding value for hard coded value .
    In this way, I have hardcoded around 35 values in Xquery .
    But the client wants to use lookup or xref, some what like name value pair and not to use hard coding in xquery .
    Please let me know, how to implement in Xquery .

    Additionally you may refer this one also..
    http://guidoschmutz.wordpress.com/2009/12/25/implement-domain-value-maps-dvm-with-oracle-service-bus-osb-10r3/
    With custom Xpaths.
    http://beatechnologies.wordpress.com/tag/lookup-shared-dvm-in-osb/

  • Can we use custom RFC in creating models in Visual composer??

    Dear Experts,
    Can we use custom RFC in creating models in Visual composer??
    If yes, kindly provide some documents or links which would guide me how to achieve it.
    Warm Regards
    Upendra Agrawal

    Hi,
    Yes,you can do it.
    Configure the rfc and use like others Standard BAPI procedure.
    [https://www.sdn.sap.com/irj/scn/wiki?path=/display/vc/connectivity]
    Regards,
    Govindu

  • How to reconcile procedure or function in a mapping using OMB Plus?

    HI,
    Could any one please explain, how to reconcile a procedure or function used in a mapping?
    Thank you,
    Regards,
    Gowtham Sen.

    Hi,
    You can only reconcile Inbound (from Procedure to the mapping) :
    OMBRECONCILE PROCEDURE \
    '/[Project_name]/[Module_name]/[Procedure_name]
    TO MAPPING '[Mapping_name]' \
    OPERATOR '[for example name of a Post-Mapping Process in the mapping]' \
    USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_ID')
    Hope that will help.
    Best Regards
    Samy

  • How to use two RFC models in one Data Source for a Interactive Form UI Elem

    Hi
    I want to use two RFC models (two Function Modules from a SAP Backend system) in one context node of a View Controller in order to pass it as the data source to a Interactive Form UI element. Can I use the data binding mechanism directly or have I to copy the data into a Value Node within the view controller.
    Thanks for helping
    René Morel
    SAP (Schweiz) AG

    Rene,
    You can create a local context node in component controller and copy the data from both the RFC's to this node, then bind it to the view controller. Then you can make this view context node as the datasource of the interactive form.
    Regards,
    Anand

  • Static and small dimension table should I use lookup

    Hi Gurus,
    I am creating interface to load my fact table.
    Generally for different codes to replace with surrogate keys I use dimension table for look-up in interface.
    but I have question if dimension table is very small and has only static values like
    Sur_key, Code, Description.
    1, C, Create
    2 , R, Redeem
    in such case if in interface for fact table, I just write expression "if source_table.column=C then 1 else 2".
    Please advice if this is better way or not.
    Thanks in advance.

    I agree - it is much better practice to use lookups to populate surrogate keys. Using hard-coded values in code requires the developer to always remember that dependency on dimensional data and can cause unexpected results down the line if the keys are updated or are inconsistent across environments.

  • Reg - XSLT Mapping using stylesheet exception during test

    Hi experts,
    I am new to SAP PI. Currently i am working on PI's XSLT Mapping using Stylusstudio.
    I got error *Transformer Configuration Exception occurred when loading XSLT <name>.xsl; details: Could not compile stylesheet*.
    I tried test by selecting SAP XML TOOLKIT too, then i am facing
    *com.sap.engine.lib.xml.parser.NestedSAXParseException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: Prefix 'a' is not mapped to a namespace (:main:, row:4, col:15)(:main:, row=4, col=15) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: Prefix 'a' is not mapped to a namespace (:main:, row:4, col:15)*.
    Kindly help me to overcome this issue.

    Hi,
    Simply your XSLT file is not a well-formed XML. Check your syntax. You could also use the XML Tools plugin to Notepad++ to help you determine where the syntax error is precisely.
    Moreover, this error "Prefix 'a' is not mapped to a namespace" might mean that you are using a tag: <a:something>, but "a" is not properly declared as a namespace, for instance like: xmlns:a="something.sap.com".
    Hope this helps,
    Greg

  • N:1 mapping using XSLT

    Hi,
    I have a scenario in which i have to do a N:1 mapping using XSLT.
    I am doing this using the BpmPatternCollectMultiIf giving the XSLT mapping in the transformation step...
    But, the transformation step is returning the following error:
    Error: Exception CX_MERGE_SPLIT occurred (program: CL_MERGE_SPLIT_SERVICE========CP, include: CL_
    My XSLT mapping is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
         <item xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
              <KEYCODE>
                   <xsl:value-of select="ns0:Messages/ns0:Message1/fsxml/item/keycode"/>
                   </KEYCODE>
                   <DESCRIPTION>
                        <xsl:value-of select="ns0:Messages/ns0:Message1/fsxml/item/description"/>
                   </DESCRIPTION>
                   <CLASS>
                        <xsl:value-of select="ns0:Messages/ns0:Message1/fsxml/item/class"/>
                   </CLASS>
                   <ONE>
                       <xsl:value-of select="ns0:Messages/ns0:Message2/test/row/one"/>
                   </ONE>
                   <TWO>
                       <xsl:value-of select="ns0:Messages/ns0:Message2/test/row/two"/>                                                      </TWO>
              </item>
         </xsl:template>
    </xsl:stylesheet>
    Here,<b> fsxml</b> is the first message and<b> test</b> is the second message.
    Kindly let me know if there is any problem in the XSLT mapping.
    Thanks in advance,
    Thanks,
    Karen Pereira

    Hi,
    There was problem in the XSLT mapping. i figured it out and fixed it and the scenario worked.
    The new mapping was as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="/">
              <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
                   <ns0:Message1>
                        <item xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
                             <!-- Mapping for tags which are to be directly replicated in the target message-->
                             <KEYCODE>
                                  <xsl:value-of select="ns0:Messages/ns0:Message1/fsxml/item/keycode"/>
                             </KEYCODE>
                             <DESCRIPTION>
                                  <xsl:value-of select="ns0:Messages/ns0:Message1/fsxml/item/description"/>
                             </DESCRIPTION>
                             <CLASS>
                                  <xsl:value-of select="ns0:Messages/ns0:Message1/fsxml/item/class"/>
                             </CLASS>
                             <ONE>
                                  <xsl:value-of select="ns0:Messages/ns0:Message2/test/row/one"/>
                             </ONE>
                             <TWO>
                                  <xsl:value-of select="ns0:Messages/ns0:Message2/test/row/two"/>
                             </TWO>
                   </item>
                   </ns0:Message1>
              </ns0:Messages>
         </xsl:template>
    </xsl:stylesheet>
    Thanks,
    Karen

Maybe you are looking for