Urgent: RFC Lookup for BAPI in XI

Hi,
I am trying to call a BAPI that exists in XI system,in the Message Mapping in same XI system.
If I run the BAPI,it is working fine.
But if I call this in XI Message Mapping using RFC lookup,it returns garbage.
I am not getting any RFC error.
Can anyone please tell me what could be the reason for this.
Thanks.
Best Regards,
Shweta

Hi Shwetha,
Please refer the below weblog:
• RFC lookup using JCO (without communication channel)
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
• RFC lookup with communication channel.
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
Sample code:
public void createAlert(String InterfaceID, String AlertCategory, String errorString,String RFCReceiverCommunicationChannel,String BusinessService)
try{
final String SAPRFCNS = "urn:sap-com:document:sap:rfc:functions",
FUNCTION_MODULE= "Z_FI_RAISE_ALERT";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = null;
factory.setNamespaceAware(false);
factory.setValidating(false);
try {
builder = factory.newDocumentBuilder();
} catch (Exception e) {
Document docReq =null;
try {
docReq = builder.newDocument();
Node root = docReq.appendChild(docReq.createElementNS(SAPRFCNS, FUNCTION_MODULE));
// Creates XML structure which is passed to ABAP function module
root.appendChild(docReq.createElement("I_INTERFACE_ID")).appendChild(docReq.createTextNode(InterfaceID));
root.appendChild(docReq.createElement("I_ERROR")).appendChild(docReq.createTextNode(errorString));
root.appendChild(docReq.createElement("I_ALERTCAT")).appendChild(docReq.createTextNode(AlertCategory));
} catch (Exception e) {
// XML Payload
Payload result1 = null;
try {
Channel channel = LookupService.getChannel(BusinessService, RFCReceiverCommunicationChannel);
RfcAccessor accessor = LookupService.getRfcAccessor(channel);
InputStream is = new ByteArrayInputStream(docReq.toString().getBytes());
XmlPayload payload = LookupService.getXmlPayload(is);
result1 = accessor.call(payload);
} catch (LookupException e) {
// trace.addWarning("Error during lookup - " + e);
// System.out.println(e.toString());
catch(Exception e)
// System.out.println(e.toString());
Thnx
Chirag

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";

  • URGENT : RFC Lookup came in from which service pack of PI7.0

    Hi Experts ,
                            This is a very urgent requirement .I wish to know RFC Lookup feature in Message Mapping came into existence from which service Pack in PI 7.0.Was it in SP18/19?? please reply .
      Please revert as early as possible .
    Regards,
    Arnab.

    i think the lookup API are part of SP13 onwards. ( i.e. prior to 7.1), reference: http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2219
    from 7.1 onwards, few lookups like RFC Lookup are provided as standard functions in message mapping.

  • NO RFC Destination for BAPI

    Hi,
    I am working on ALE for Activity allocation. I am using 3 methods in my distribution model. I need to transfer data from ECC 6.0 source system to R/3 4.7.
    BUS6010 Method POST & CHECK
    BUS2072 Method FINDDETAILS
    I am using the Program RHINLV00_LSO to transfer data.
    When i execute this report it's throwing an error
    " NO RFC Destination for 2 BAPI's".
    An RFC Destination is created in SM59 to link the  two systems and i have distributed the distribution model to R/3 4.7.
    The Function modules are marked as Remote enabled function modules.
    Regards,
    Ramesh K.

    Hello,
    Did you test RFC destination whether the definition is working fine or not?
    You can test the destination,if it's working fine,then Bapis' should be able to execute.
    Thanks.
    Mark points if helpful.

  • NO RFC Destination for BAPI's

    Hi,
    I am working on ALE for Activity allocation. I am using 3 methods in my distribution model. I need to transfer data from ECC 6.0 source system to R/3 4.7.
    BUS6010 Method POST & CHECK
    BUS2072 Method FINDDETAILS
    I am using the Program RHINLV00_LSO to transfer data.
    When i execute this report it's throwing an error
    " NO RFC Destination for 2 BAPI's".
    An RFC Destination is created in SM59 to link the two systems and i have distributed the distribution model to R/3 4.7.
    The Function modules are marked as Remote enabled function modules.
    Regards,
    Ramesh K.

    Hi,
    After creating the distribution model with 3 methods in ECC 6.0 (source system). Generated Partner profile automatically from BD64. Then distributed the distribution model to the other system i.e., SAP R/3 4.7 successfully. Then created partner profile from that system automatically.
    Port, partner profiles,outbound parameters, inbound parameters were created successfully.
    Thanks
    Ramesh

  • One RFC Lookup for numerous messages

    Hello
    I send large number of idocs in one message from ECC to XI and then processing EDI file on the filesystem
    my question is if I want to make one rfc lookup to convert the quanitiy unit  for all idocs at the same time (one call) is it possible  with PI 7.1 ?  and how
    thx
    Shai Rosenzweig
    Edited by: Shai Rosenzweig on Sep 19, 2008 3:18 PM

    use Idoc bundling concept
    blog:IDOC bundling: Elucidation on Configuration step
    The specified item was not found.
    For RFC look up:
    Triggering XI Alerts from a User Defined Function

  • Parsing in RFC lookup

    Hi All,
    I have wriiten a RFC lookup for mapping the company code. But I am not getting the result while parsing the XML. I have tested the code and without parsing I am getting the correct value in XML. Can anybody send the code for parsing the XML data using DOM.
    Below is the code which I am using .
    try {
            docResponse = builder.parse(in);
            if (docResponse == null) {
                    importanttrace.addWarning("docResponse is null");
    res =  docResponse.getElementsByTagName("COMPANYID").item(0).getFirstChild().getNodeValue();
    if (res == null) {
                    importanttrace.addWarning("res is null");
    catch (Exception e) {
          importanttrace.addWarning("Error when parsing RFC Response - " + e.getMessage());
    try {
            // Free resources, close the accessor..
            if (accessor != null) {
                    try {
                            accessor.close();
                    } catch (LookupException e) {
                            importanttrace.addWarning( "Error while closing accessor " + e.getMessage());
    } catch (Exception e) {
            importanttrace.addWarning("Result value not found in DOM - " + e);
    // return the result obtained above
    return res;
    Thanks,
    Aparna

    Maybe it's really just the typo in your element name and everything works fine when you use:
    res = docResponse.getElementsByTagName("COMPANY_CODE").item(0).getFirstChild().getNodeValue();
    And I think method <em>getTextContent()</em> should also do the trick of the two calls you're using:
    res = docResponse.getElementsByTagName("COMPANY_CODE").item(0).getTextContent();

  • PI 7.1 EHP1: RFC lookup does not pass the parameter values

    Hi,
    I am not sure if anyone came cross this issue:
    This is IDOC -> PI -> File scenario
    IDOC sender side, we used IDOC packaging, means in one message, we have mutiple IDOCs.
    There is RFC lookup function in message mapping, it takes 8 parameters. There are four contants value and four queue passed.
    We would like to call the RFC lookup for each IDOC sent.
    Saying we sent 10 IDOCs, the RFC was called 10 times, this is expected behavior.
    However, in 8 parameters, we miss four parameters values even we passed values
    Regards.
    Liang

    J Augastine:
    Thanks for the input.
    In blog, it talked about one RFC call for a mapping.
    In my situation, we need to multiple times of RFC, since this is EDI scenario, some elements need to be incremented.
    Previously, this RFC works without any problem. However we increased 4 parameters, for those parameter added laterly, it does not carry the value to RFC call, I tried to removed the function from ESR and re-import the RFC, but it still does not help.
    I also tried to pass constant value or queue value, it all does not help.
    Regards.
    Liang

  • REG: RFC lookup

    Hi all,
                 In my scenario i need to use RFC lookup for the receiver system . Can u guys suggest me a method how to implement the RFC lookup.
    Thanks,
    Siva.

    Hi,
    Check this blogs for the steps:
    1)Use this crazy piece for any RFC Mapping Lookups!
    2)The specified item was not found.
    Regards,
    Ramya Iyer

  • RFC Lookup with RFC - not BAPI

    Hi all,
    Is it possible to make an RFC lookup to a Function Module remote enabled that not is properly a BAPI? I'm trying using Michael RFC lookup sample, but in the sample he uses BAPI_PO_GETDETAIL (it's working fine to me). When I call a Function Module (import it to XI, make all the steps as in the sample), it returns an error "parameter with name RETURN not found".
    I have tried to put this parameter exactly as it is on BAPI_PO_GETDETAIL, but still didn't work. Some tip?
    thanks!!!
    roberti

    roberti,
    Is it possible to make an RFC lookup to a Function Module remote enabled that not is properly a BAPI?
    >> yes you can do it .
    in rfc function module do you have import and export parameters right. check whether Retrun is passed or not. if you dont structure to accept RETURN as input then dont passit RFC function module
    Regards
    sreeram.g.reddy

  • RFC Lookup error :No RFC authorization for function module

    Hi All,
    I have created RFC in the PI system and enabled it as remote. I am working on PI7.1
    I have imported RFC into Repository.But when i am trying to execute RFC lookup function in the graphical mapping I am getting No RFC authorization for function module error.
    Unhandled RFC exception: <rfc:Z_MAIL_LOOKUP.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><Name>RFC_ERROR_SYSTEM_FAILURE</Name><Text>No RFC authorization for function module Z_MAIL_LOOKUP.</Text><Message><ID>RFC_ERROR_SYSTEM_FAILURE</ID><Number>341</Number></Message><Attributes><V1>RFC_NO_AUTHORITY</V1></Attributes></rfc:Z_MAIL_LOOKUP.Exception> com.sap.aii.mapping.api.StreamTransformationException: Unhandled RFC exception: <rfc:Z_MAIL_LOOKUP.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><Name>RFC_ERROR_SYSTEM_FAILURE</Name><Text>No RFC authorization for function module Z_MAIL_LOOKUP.</Text><Message><ID>RFC_ERROR_SYSTEM_FAILURE</ID><Number>341</Number></Message><Attributes><V1>RFC_NO_AUTHORITY</V1></Attributes></rfc:Z_MAIL_LOOKUP.Exception> at com.sap.aii.mappingtool.flib7.RfcLookup.cacheMore(RfcLookup.java:95) at com.sap.aii.mappingtool.tf7.rt.AMultiResIterator$MultiOutIterator.gotoNextContext(AMultiResIterator.java:95) at com.sap.aii.mappingtool.tf7.AMappingProgram.processNode(AMappingProgram.java:315) at com.sap.aii.mappingtool.tf7.AMappingProgram.processNode(AMappingProgram.java:406) at com.sap.aii.mappingtool.tf7.AMappingProgram.start(AMappingProgram.java:496) at com.sap.aii.mappingtool.tf7.Transformer.start(Transformer.java:133) at com.sap.aii.mappingtool.tf7.AMappingProgram.transform(AMappingProgram.java:626) at com.sap.aii.ibrep.server.mapping.exec.ExecuteXiMappingCommand.transformInternal(ExecuteXiMappingCommand.java:197) at com.sap.aii.ibrep.server.mapping.exec.ExecuteXiMappingCommand.execute(ExecuteXiMappingCommand.java:94) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:43) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1005_10002.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304) Runtime exception when processing target-field mapping /ns0:MT_FileDummy/File; root message: Unhandled RFC exception: <rfc:Z_MAIL_LOOKUP.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><Name>RFC_ERROR_SYSTEM_FAILURE</Name><Text>No RFC authorization for function module Z_MAIL_LOOKUP.</Text><Message><ID>RFC_ERROR_SYSTEM_FAILURE</ID><Number>341</Number></Message><Attributes><V1>RFC_NO_AUTHORITY</V1></Attributes></rfc:Z_MAIL_LOOKUP.Exception>
    13:42:37 End of test
    Edited by: Rams on Apr 17, 2009 1:43 PM

    Hi! Rams,
    I think the issue is related to Authentification Issue..Even though u did correctly please check once the below
    1) Check any Typo Erros are there while configuring or giving names in Lookups.
    2) please check Authorizations like ID and PWD and Sufficient Roles
    3) Also please check did u given paramters correctly while doing RFC look up I mean paramers , Binding parameters and RFC channel name and adapter type or Simple type it must be an  adapter
    4) In ID part while configuring Interface determinaition you need to give your RFC look Up name there also..Hence check whether u given or not if yes correctly or not
    5) Also remember one thing if your scenario is correct mostly you can know the result in mapping itself it seems while testing Message mapping and Interface mappings give your RFC look up paramters in the parameters tab present in TEST tab and later in Document tab give Input...and execute it works if it doesn;t works and if there is an issue with RFC you can get there only..ok
    Also go through the below document::
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20befc9a-aa72-2b10-ae9b-b0988791d457]
    I hope this will give u brief idea...
    Also check with basis while taking SAP_ALL authorization so that first u ill came to know whether issue is related to authentification or RFC module itself remote enabled and also do SXI_CACHE also ocne to refresh ESR and ID objects..
    Regards::
    Amar Srinivas Eli

  • Graphical message mapping examples for JDBC and RFC lookup

    hi, can any body provide me graphical message mapping examples for the "JDBC Lookup" function and "RFC Lookup" function?
    I'm now studying the graphical message mapping and want to try those 2 functions. thank you.
    I expect the examples to be simple enoung, not need to set up much.

    >
    Madhu_1980 wrote:
    > can u check this link:
    >
    > PI 7.0 & 7.1 Mapping - Blogs,Articles,Wiki,Code Samples and Videos Collections https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=79955426  
    >
    > it contains a link : SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
    May be I'm too foolish to follow those links, I got issues of each links.
    What I really want is an example from step0
    Swarup:
    Refer the Lookup document - Easy Lookup in Process Integration 7.1
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/20befc9a-aa72-2b10-ae9b-b0988791d457
    The first step is "Create an RFC Enabled Function Module for look up", but where can I create the function module? Should I use ESB, IB? or use transaction 'SE11' ?
    Kulkarni:
    Very good links for RFC lookup with 7.0/3.0
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/70d90a91-3cf4-2a10-d189-bfd37d9c3231&overridelayout=true
    At page6 "PI Development/Configuration", it saies "You are on the design maintenance screen in the Integration Builder.Expand the subnodes for the software component version for which you want to import interfaces".
    What is "design maintenance screen" ? My IB version is: Service Pack:08 Release:NW07_08_REL.
    When I open IB, it display a screen titled with "Configuration: Intergation Builder", I did not find "software component version" node on the left tree.
    Madhu_1980 :
    it contains a link : SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
    The Prerequisites state:
    The JDBC channel to be used for the lookup must be configured and activated in the Integration Directory.
    The definition of the table used for the lookup must already be imported into the ES Repository as an external definition
    But I don't know how to create a JDBC channel and define the table.

  • Exist RFC Function or Bapi for insert Records form a external program?

    i create a Ztable same as tell me here:
    http://abaplovers.blogspot.com/2008/02/creating-table-in-sap.html
    5 String Fileds 2 Date Fields 2 Numeric Fields
    my question is exist a RFC Function or Bapi for insert Records form a external program (Delphi/Visual Basic)?
    Any advices?
    Thanks.

    hi madhurao123 thanks for answer.
    But Why block the Thread?
    This question is no so basic, yet never learn, the forum must be open to these questions maybe open a forum somewhere basic but must be able to do these basic questions.
    IT Toolbox commented the same thing, but if not here or ITtoolbox or where else can ask basic questions?
    Advise me, thank you.

  • Finding BAPI/RFC/FM For ME41(Create RFQ)

    Hi,
       Plz help me for finding Bapi/Rfc/Fm for t-code ME41(Create RFQ).
    Thanks,
    Sunil Sahoo

    hi
    we have BAPI'S for many requirements like
    BAPI_VENDOR_CREATE
    BAPI_REQUISITION_CREATE.
    BAPI_QUOTATION_CREATEFROMDATA
    you try this BAPI
    ME_CREATE_REQUISITION_EXT
    hope this helps
    regards
    Aakash

  • Finding BAPI/RFC/FM For inbound Delivery Display(VL33N)

    HI,
      PLZ HELP ME FOR FINDING BAPI/RFC/FM For inbound Delivery Display(VL33N).
    REGARDS,
    SUNIL SAHOO

    Hi,
    Check this link-
    http://www.sap-img.com/abap/how-to-find-bapi-for-particular-transaction-in-sap.htm
    Regards.
    Eshwar.

Maybe you are looking for

  • Error message to warning

    I want to make this error message to warning. Can any body tell me where I can get this The base unit of measure cannot be changed; choose "Display errors" Message no. M3 189

  • Downloaded iMovie 10. I find I can no longer burn DVDs in my iDVD app.

    Downloaded iMovie 10 and find now I cannot butn DVDs w/iDVD. Why not or am I missig something???

  • Calling sap transaction in web browser

    Hi, I want to call a sap transaction in web browser. In my case the Solution Manger Transaction SMSY to provide all the System Landscape Information. How can I realise it with less effort? What technology is state of the art for this problem? Thx 4 a

  • Apply "Script Labels" to Object Styles?

    Hi again, I think I've kind of found a solution to my previous thread. But it involves using Script Labels in order to get it to work. Problem is I've tonnes of text boxes with Object Styles applied that don't have any Script Labels applied to them.

  • Object list

    hi all, I have oracle 10g on windows. I want to fidn out object owner,objec name ,object type and status of the object. it should not display data of oracle systems user like sys or system etc etc. for that i have tried below query but still there ar