RFC lookup error

Hi all,
I am doing an RFC lookup to increment counter. I am facing a problem.
I followed the code written by Michael. https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
My udf is as shown below: -
String content = "";
MappingTrace importanttrace;
importanttrace = container.getTrace();
java.util.Map param = container.getTransformationParameters();
String MSGID = (String) param.get (StreamTransformationConstants.MESSAGE_ID);
// filling the string with our RFC-XML (with values)
String m="<?xml version="1.0" encoding="UTF-8"?><ns0:_-GLB_-ZGT_RFBIBL00_COUNTER xmlns:ns0="urn:sap-com:document:sap:rfc:functions"><IM_V_FILENAME>CA10.NCH.FCIPAY04</IM_V_FILENAME><IM_V_MSGID>"MSGID"</IM_V_MSGID><IM_V_WRNO>DEVWR0001725</IM_V_WRNO></ns0:_-GLB_-ZGT_RFBIBL00_COUNTER>";
importanttrace.addWarning("Input value is  "+m);
RfcAccessor accessor = null;
ByteArrayOutputStream out = null;
try
// 1. Determine a channel (Business system, Communication channel)
Channel channel = LookupService.getChannel(receiverBS,"CC_RFC_RCV_AMS_R3F_DEVWR001725");
// 2. Get a RFC accessor for a channel.
accessor = LookupService.getRfcAccessor(channel);
// 3. Create a xml input stream representing the function module request message.
InputStream inputStream = new ByteArrayInputStream(m.getBytes());
// 4. Create xml payload
XmlPayload payload = LookupService.getXmlPayload(inputStream);
// 5. Execute lookup.
Payload result = accessor.call(payload);
InputStream in = result.getContent();
out = new ByteArrayOutputStream(1024);
byte[] buffer = new byte[1024];
for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {
out.write(buffer, 0, read);
content = out.toString();
catch(LookupException e)
importanttrace.addWarning("Error while lookup " + e.getMessage() );
catch(IOException e)
importanttrace.addWarning("Error " + e.getMessage() );
finally
if (out!=null) {
try {
out.close();
} catch (IOException e) {
importanttrace.addWarning("Error while closing stream " + e.getMessage() );
// 7. close the accessor in order to free resources.
if (accessor!=null) {
try {
accessor.close();
} catch (LookupException e) {
importanttrace.addWarning("Error while closing accessor " + e.getMessage() );
//returning the result u2013 RFC-XML.response
if ((content.substring(143,150)).equals("NOENTRY"))
ExceptionThrower.generate("INVALID INPUT DEVWR NUMBER OR ID" );
return "Nothing";
else
return (content.substring(143,155));
The problem i am facing is that, i am not able to pass the IM_V_MSGID parameter to the function module.
The other 2 parameters i can pass. that is IM_V_FILENAME and IM_V_WRNO.
i am able to extract the message ID using
java.util.Map param = container.getTransformationParameters();
String MSGID = (String) param.get (StreamTransformationConstants.MESSAGE_ID);
and displayed it in SXI_MONITOR trace also using importanttrace.addWarning("Input value is  "+m);
i got the correct MSGID in the trace.But the problem is that this value is not getting passed to the FM. Cos the table is supposed to increment the counter whenever the MSGID value changes.
I tried hardcoding the MSGID value to 'abc' or '123' like values but the same thing happended. The counter will not increment. The FM is working perfectly when i run it and change the MSGID values manually.
Thanks
Pratichi

Hi,
We have done this by creating an FM in XI ABAP stack:
FUNCTION Z_ZBXI_GET_PRE_MSG_ID.
""Local Interface:
*"  IMPORTING
*"     VALUE(I_CURRMSGID) TYPE  CHAR40
*"  EXPORTING
*"     VALUE(E_PREMSGID) TYPE  CHAR40
DATA: lv_currmsgid type SXMSPMAST-MSGGUID,
      lv_parentmsgid LIKE SXMSPMAST-PARENTMSG,
      lv_premsgid LIKE SXMSPMAST-MSGGUID.
lv_currmsgid = i_currmsgid.
select single PARENTMSG from SXMSPMAST into lv_parentmsgid where MSGGUID = lv_currmsgid.
e_premsgid = lv_parentmsgid.
ENDFUNCTION.
You need to call this FM through RFC lookup UDF in your mapping.
Let me know if it works for you.
Regards,
Shweta

Similar Messages

  • RFC Lookup error after moving to Quality from Development

    Hi All,
    For a scenario,I am using the RFC Lookup in message mapping.
    I am not using it in a UDF but for directly for an target element....
    The scenario was wrkng properly in development... but in quality it's not wrkng giving the following error....
    RuntimeException during appliction Java mapping com/sap/xi/tf/_ABC_DEF_GHI_JKL_ Thrown: com.sap.aii.utilxi.misc.api.BaseRuntimeException: com.sap.aii.mapping.api.UndefinedParameterException: The input-parameter ISU_RFC_Receiver does not exist. at com.sap.aii.mappingtool.tf7.Transformer.start(Transformer.java:148) at com.sap.aii.mappingtool.tf7.AMappingProgram.transform(AMappingProgram.java:620) at
    The design part and Config part are done properly..
    1.Message mapping-->Parameters (given the CC Name)
    2.Operation mapping-->Binding (The binding parameters is specified)
    3.In the interface determination.... choosen the Parameter for Operation mapping...
    But still i am getting the above error..
    Did any1 face the same prblm ever??? If yes may i know how u resolved???
    Any inputs or suggestions is appreciated...
    Babu

    HI Michal,
    I checked it thtz fine the same objects are transported to Quality without any modification...
    But Still i am getting the same proble..
    Any other inputs????
    Babu
    Edited by: hlbabu123 on Apr 8, 2010 7:54 PM

  • RFC Lookup Error --- error executing simple look up

    Hi all,
    Below is the error when displaying the queue of the UDF.
    RuntimeException in Message-Mapping transformation: Exception:[java.lang.RuntimeException: Error during MEI RFC Lookup] in class com.sap.xi.tf._MM_COND_A03_TO_MT_PRICELIST_ method callRFC$[com.sap.aii.mappingtool.tf3.CBufIter@32523252, com.sap.aii.mappingtool.tf3.CBufIter@32c732c7, com.sap.aii.mappingtool.tf3.CBufIter@333c333c, com.sap.aii.mappingtool.tf3.CBufIter@33c133c1, com.sap.aii.mappingtool.tf3.CBufIter@4bb84bb8, com.sap.aii.mappingtool.tf3.CBufIter@50ef50ef, com.sap.aii.mappingtool.tf3.CBufIter@51645164, com.sap.aii.mappingtool.tf3.CBufIter@51d951d9]
    But when i test the mapping by passing input parameters the UDF responses with the output parameters and with the following error
    Request MEILookup XML: <?xml version="1.0" encoding="UTF-8"?><ns0:ZRFC_MEI_PUBLISH_PRICELIST xmlns:ns0="urn:sap-com:document:sap:rfc:functions"><T_PRICELIST><item><KBETR_IN>1580.00</KBETR_IN><KUNAG_IN>0010000048</KUNAG_IN><KUNWE_IN>0020002894</KUNWE_IN><KSCHL_IN>ZSBP</KSCHL_IN><MATNR_IN>12648R-0090</MATNR_IN></item></T_PRICELIST></ns0:ZRFC_MEI_PUBLISH_PRICELIST>
    Response MEI Lookup XML: <?xml version="1.0" encoding="UTF-8"?><rfc:ZRFC_MEI_PUBLISH_PRICELIST.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><T_ERR_MESSAGES_OUT></T_ERR_MESSAGES_OUT><T_PRICELIST><item><PARVW_OUT>BT</PARVW_OUT><KUNNR_OUT>0010000048</KUNNR_OUT><DATBI_OUT>2008-08-17</DATBI_OUT><DATAB_OUT>9999-12-31</DATAB_OUT><KBETR_OUT>1580.00</KBETR_OUT></item></T_PRICELIST></rfc:ZRFC_MEI_PUBLISH_PRICELIST.Response>
    getKey=item==getValue=<item><KOTABNR_IN>910</KOTABNR_IN><DATBI_IN>20080817</DATBI_IN><DATAB_IN>99991231</DATAB_IN><KBETR_IN>1580.00</KBETR_IN><KUNAG_IN>0010000048</KUNAG_IN><KUNWE_IN>0020002894</KUNWE_IN><KSCHL_IN>ZSBP</KSCHL_IN><PARVW_OUT>BT</PARVW_OUT><KUNNR_OUT>0010000048</KUNNR_OUT><MATNR_IN>12648R-0090</MATNR_IN><DATBI_OUT>2008-08-17</DATBI_OUT><DATAB_OUT>9999-12-31</DATAB_OUT><KBETR_OUT>1580.00</KBETR_OUT></item>
    Runtime exception during processing target field mapping /ns0:MT_PRICELIST. The message is: Exception:[java.lang.RuntimeException: Error during MEI RFC Lookup] in class com.sap.xi.tf._MM_COND_A03_TO_MT_PRICELIST_ method callRFC$[, , , , com.sap.aii.mappingtool.tf3.rt.FunctionWrapper@37883788, com.sap.aii.mappingtool.tf3.rt.FunctionWrapper@5ea95ea9, , ] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:MT_PRICELIST. The message is: Exception:[java.lang.RuntimeException: Error during MEI RFC Lookup] in class com.sap.xi.tf._MM_COND_A03_TO_MT_PRICELIST_ method callRFC$[, , , , com.sap.aii.mappingtool.tf3.rt.FunctionWrapper@37883788, com.sap.aii.mappingtool.tf3.rt.FunctionWrapper@5ea95ea9, , ] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:350)

    Hi Mahesh,
    I have tested the RFC and i have taken the input from the function module...the RFC is working good, the comm channel is good...
    below is the error when i tested my mapping... (the output from the function module is also correct)... i need to use hashmap to store the output...
    Request MEILookup XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ZRFC_MEI_PUBLISH_PRICELIST xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
    <T_PRICELIST>
    <item>
    <KOTABNR_IN>910</KOTABNR_IN>
    <DATBI_IN>20080817</DATBI_IN>
    <DATAB_IN>99991231</DATAB_IN>
    <KBETR_IN>1580.00</KBETR_IN>
    <KUNAG_IN>0010000048</KUNAG_IN>
    <KUNWE_IN>0020002894</KUNWE_IN>
    <KSCHL_IN>ZSBP</KSCHL_IN>
    <MATNR_IN>12648R-0090</MATNR_IN>
    </item>
    </T_PRICELIST>
    </ns0:ZRFC_MEI_PUBLISH_PRICELIST>
    Response MEI Lookup XML: <?xml version="1.0" encoding="UTF-8"?>
    <rfc:ZRFC_MEI_PUBLISH_PRICELIST.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    <T_ERR_MESSAGES_OUT></T_ERR_MESSAGES_OUT>
    <T_PRICELIST>
    <item>
    <KOTABNR_IN>910</KOTABNR_IN>
    <DATBI_IN>20080817</DATBI_IN>
    <DATAB_IN>99991231</DATAB_IN>
    <KBETR_IN>1580.00</KBETR_IN>
    <KUNAG_IN>0010000048</KUNAG_IN>
    <KUNWE_IN>0020002894</KUNWE_IN>
    <KSCHL_IN>ZSBP</KSCHL_IN>
    <PARVW_OUT>BT</PARVW_OUT>
    <KUNNR_OUT>0010000048</KUNNR_OUT>
    <MATNR_IN>12648R-0090</MATNR_IN>
    <DATBI_OUT>2008-08-17</DATBI_OUT>
    <DATAB_OUT>9999-12-31</DATAB_OUT>
    <KBETR_OUT>1580.00</KBETR_OUT>
    </item>
    </T_PRICELIST>
    </rfc:ZRFC_MEI_PUBLISH_PRICELIST.Response>
    getKey=item==getValue=<item><KOTABNR_IN>910</KOTABNR_IN><DATBI_IN>20080817</DATBI_IN><DATAB_IN>99991231</DATAB_IN><KBETR_IN>1580.00</KBETR_IN><KUNAG_IN>0010000048</KUNAG_IN><KUNWE_IN>0020002894</KUNWE_IN><KSCHL_IN>ZSBP</KSCHL_IN><PARVW_OUT>BT</PARVW_OUT><KUNNR_OUT>0010000048</KUNNR_OUT><MATNR_IN>12648R-0090</MATNR_IN><DATBI_OUT>2008-08-17</DATBI_OUT><DATAB_OUT>9999-12-31</DATAB_OUT><KBETR_OUT>1580.00</KBETR_OUT></item>
    Runtime exception during processing target field mapping /ns0:MT_PRICELIST/row. The message is: Exception:[java.lang.RuntimeException: Error during MEI RFC Lookup] in class com.sap.xi.tf._MM_COND_A03_TO_MT_PRICELIST_ method callRFC$[, , , , com.sap.aii.mappingtool.tf3.rt.FunctionWrapper@6d486d48, com.sap.aii.mappingtool.tf3.rt.FunctionWrapper@7bcf7bcf, , ]

  • RFC lookup - Error executing simple lookup

    Hi guys,
    Something weird is happening.
    I'm using a RFC lookup to get some parameters and I'm using the same generic UDF that I usually take on different projects.
    But this time I'm getting the following error:
    com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:Messages/ns0:Message1/MessageStatus/StatusInformation/Status. The message is: Exception:[java.lang.StringIndexOutOfBoundsException] in class com.sap.xi.tf._mmEOrdersRetailRequest_ method SAPRFCLookup$[RFC_Receiver_LookUp_SAP, MARA, MATNR EQ &apos;000000000000000123
    &apos; , VPSTA, TST002, com.sap.aii.mappingtool.tf3.rt.Context@1f231f23]
    Do you have any idea?
    I've commented my RFCLookup code and the error jumps up on the getRfcAccessor line.
              try {
    // 1. Determine a channel (Business system, Communication channel)
                com.sap.aii.mapping.lookup.Channel channel = com.sap.aii.mapping.lookup.LookupService.getChannel(BusinessService,CommChannel);
    // 2. Get a RFC accessor for a channel.
                accessor = com.sap.aii.mapping.lookup.LookupService.getRfcAccessor(channel);
    The channel is well created on the IDirectory, associated with the correct BusinessSystem. I can check on the CommunicationChannel Monitoring that the channel opens the JCO connection correctly..
    However if I change this RFCLookup by a JCOLookup everything works smoothly...
    I've done this thousand times but now I'm not able to get the problem...
    Can you guys help?

    Hi Sridevi,
    Sorry for the late reply but the problem continues...
    We're using Netweaver 7.0 SP 14, patch number 0026
    Thanks for your interest.
    The complete error description is:
    Runtime exception during processing target field mapping
    The message is: Exception:[java.lang.StringIndexOutOfBoundsException] in class com.sap.xi.tf._mmTest
    method SAPRFCLookup$[RFC_Receiver_LookUp_SAP, MARA, MATNR EQ &apos;000000000000000123&apos;, VPSTA, TST002, com.sap.aii.mappingtool.tf3.rt.Context@5ef05ef0] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:Messages/ns0:Message1/MessageStatus/StatusInformation/Status. The message is: Exception:[java.lang.StringIndexOutOfBoundsException] in class com.sap.xi.tf._mmTest method SAPRFCLookup$[RFC_Receiver_LookUp_SAP, MARA, MATNR EQ &apos;000000000000000123&apos;, VPSTA, TST002, com.sap.aii.mappingtool.tf3.rt.Context@5ef05ef0] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:364) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:415) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:207) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.StringIndexOutOfBoundsException] in class com.sap.xi.tf._mmTest method SAPRFCLookup$[RFC_Receiver_LookUp_SAP, MARA, MATNR EQ &apos;000000000000000123&apos;, VPSTA, TST002, com.sap.aii.mappingtool.tf3.rt.Context@5ef05ef0] at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.calculateCurrentValue(FunctionWrapper.java:84) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.cacheValue(FunctionWrapper.java:60) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.gotoNextContext(FunctionWrapper.java:40) at com.sap.aii.mappingtool.tf3.rt.AResIterator.gotoNextContext(AResIterator.java:37) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.gotoNextContext(FunctionWrapper.java:37) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:266) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:415) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:207) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) Root Cause: java.lang.reflect.InvocationTargetException Caused by: java.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1019) at com.sap.aii.utilxi.hmi.api.HmiHttpClientImpl.extractCookieValue(HmiHttpClientImpl.java:318) at com.sap.aii.utilxi.hmi.api.HmiHttpClientImpl.extractCookie(HmiHttpClientImpl.java:307) at com.sap.aii.utilxi.hmi.api.HmiHttpClientImpl.getCookies(HmiHttpClientImpl.java:292) at com.sap.aii.utilxi.hmi.api.HmiHttpClientImpl.sendRequestAndReceiveResponseViaHttp(HmiHttpClientImpl.java:207) at com.sap.aii.utilxi.hmi.api.HmiHttpClientImpl.sendRequestAndReceiveResponse(HmiHttpClientImpl.java:108) at com.sap.aii.utilxi.hmi.api.HmiClientAdapter.invokeMethod(HmiClientAdapter.java:88) at com.sap.aii.ibrep.server.lookup.SystemAccessorHmiClient.<init>(SystemAccessorHmiClient.java:64) at com.sap.aii.ibrep.server.lookup.SystemAccessorHmiClient.getInstance(SystemAccessorHmiClient.java:112) at com.sap.aii.ibrep.server.lookup.LookupServiceProvider$RemoteClientDelegator.<init>(LookupServiceProvider.java:99) at com.sap.aii.ibrep.server.lookup.LookupServiceProvider$RemoteClientDelegator.<init>(LookupServiceProvider.java:89) at com.sap.aii.ibrep.server.lookup.LookupServiceProvider$RemoteClient.getSystemAccessor(LookupServiceProvider.java:76) at com.sap.aii.mapping.lookup.LookupService.getRfcAccessor(LookupService.java:249) at com.sap.xi.tf._mmTest.SAPRFCLookup$(_mmTest.java:122) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.calculateCurrentValue(FunctionWrapper.java:76) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.cacheValue(FunctionWrapper.java:60) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.gotoNextContext(FunctionWrapper.java:40) at com.sap.aii.mappingtool.tf3.rt.AResIterator.gotoNextContext(AResIterator.java:37) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.gotoNextContext(FunctionWrapper.java:37) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:266) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:415) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:207) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:Messages/ns0:Message1/MessageStatus/StatusInformation/Status. The message is: Exception:[java.lang.StringIndexOutOfBoundsException] in class com.sap.xi.tf._mmTest method SAPRFCLookup$[RFC_Receiver_LookUp_SAP, MARA, MATNR EQ &apos;000000000000000123&apos;, VPSTA, TST002, com.sap.aii.mappingtool.tf3.rt.Context@5ef05ef0]

  • 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

  • RFC lookup error when table in change mode

    Hi,
    I´m using an RFC lookup from XI to translate external to internal partner nr. Input to the FM in R/3 is the external partner nr och the FM should return the internal partner nr to XI. The problem is that when a user edits the table that my FM reads from a get an error.
    - Isn´t it possible to read a r/3 table while it is in change mode? Is my only way around this to create a z version of this table?
    Claes

    Hi Claes
    have  a look on these  links ,
    For your RFC lookup,
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    RFC lookups pdf 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
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    Michal's Blog on RFC Mapping Lookup:/people/michal.krawczyk2/blog/2005/09/15/xi-rfc-mapping-lookups-from-bc-to-xi
    RFC Lookup.
    RFC lookup return no values
    http://help.sap.com/saphelp_nw2004s/helpdata/en/17/d609b48ea5f748b47c0f32be265935/frameset.htm
    Also check this useful link which also talk about Value Lookup:
    Value lookup
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    /people/prasad.illapani/blog/2006/10/25/how-to-check-jdbc-sql-query-syntax-and-verify-the-query-results-inside-a-user-defined-function-of-the-lookup-api
    Lookups - /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
    Lookups - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    Thanks !!

  • RFC Lookup mapping error in PI 7.1

    Hi Experts,
    I´m getting mapping error when executing interface SOAP -> WS (SAP ECC) . The message mapping call RFC Lookup to SAP ECC.
    When test the message mapping in Integration Builder the interface calls communication channel by RFC Lookup and works fine.
    That interface was imported from QAS environment and was working fine, but in PRD it doesn´t works.
    I checked the Interface Determination and the parameter is filled correctly with communication channel. The same communication channel was used on message mapping test.
    The Interface Determination in SXI_CACHE has no value assigned to parameter in PRD environment, otherwise, the same interface determination in SXI_CACHE in QAS environment there is value (CC ID).
    The problem persists after Cache Refresh in SXI_CACHE and CPA Cache.
    Can anyone help me ?
    Thanks in advance,
    Regis Ferrato
    Bellow the trace of error ocurred:

    Hi Regis,
    Please check my reply in your other thread:
    Re: RFC Lookup error cache in PI 7.1
    Regards,
    ---Satish

  • RFC Lookup API error in PI 7.1?

    Hi Guys,
    The RFC lookup which has been developed in PI 7.0 using the lookup API is unable to find the CC defined in the directory for a business system. after upgrading to PI 7.1. We are getting the error as below. This look up works perfectly fine in Dev(PI 7.1) and QA(PI 7.1) but in Prod(PI 7.1). We are on PI 7.1 EHP1 SP03.
    Errorcom.sap.aii.mapping.lookup.LookupException: Plain exception:Error when calling an adapter by using the communication channel In_RFC_SAPLookUp (Party: , Service: Test, Object ID: 74e5e47336133351bebcb8c6a6bc68c8) The channel with object ID 74e5e47336133351bebcb8c6a6bc68c8 could not be found in the Integration Server Java Cache. Check if the channel exists in the Integration Builder Directory and execute a refresh of the Java Cach.
    We did the cache refresh and also restarted the prod server but the error still persists. We have tried connecting to the prod receiver sap system from QA and the lookup works perfectly fine. We dont understand why it dosent work in prod.
    any help or suggestions would be really appreciated.
    Thanks,
    Srini

    Hi Rajesh,
    The CC has the correct business system. We have also tried even by creating a new cc and it always says it cannot find the defined cc from the RFC lookup. We are passing this value as a constant value to the RFC lookup.
    I could not understand why it is not finding only this CC? Is this something that RFC lookup is unable to find the CC?
    any help would be appreciated
    Thanks,
    Srini

  • Java Error in RFC Lookup in XSLT Mapping usinf Java helper class

    Hi All,
    I am doing RFC Lookup in XSLT Mapping using Java Helper class.
    The Lookup works fine when called one RFC at a time However my requirement is I want to do 2 Lookups.
    Both Lookups works when done individually however when I call both lookups in one mapping I get following error "javax.xml.transform.TransformerException: DOMSource whose Node is null."
    Following is the code I have written in XSLT for the lookup:
         <xsl:template name="Lookup_1">
              <xsl:param name="STDPN"/>
                   <rfc:RFC_READ_TABLE>
                        <QUERY_TABLE>KNA1</QUERY_TABLE>
                        <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$STDPN"/>
                             </TEXT></item>
                        </OPTIONS>
                        <FIELDS>
                             <item>
                                  <FIELDNAME>KUNNR</FIELDNAME>
                             </item>
                        </FIELDS>
                   </rfc:RFC_READ_TABLE>
              </xsl:variable>
              <xsl:variable name="response" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request, 'BS_D, 'cc_RfcLookup', $inputparam)"/>
              <xsl:element name="STDPN">
                   <xsl:value-of select="$response//DATA/item/WA"/>
              </xsl:element>
         </xsl:template>
         <xsl:template name="Lookup_2">
              <xsl:param name="BELNR"/>
                   <xsl:variable name="Query">AGMNT = '<xsl:value-of select="$BELNR"/>'</xsl:variable>
                   <xsl:variable name="request1">
                        <rfc:RFC_READ_TABLE>
                             <QUERY_TABLE>ZTABLE</QUERY_TABLE>
                             <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$Query"/>
                                  </TEXT></item>
                             </OPTIONS>
                             <FIELDS>
                                  <item>
                                       <FIELDNAME>KUNAG</FIELDNAME>
                                  </item>
                             </FIELDS>
                        </rfc:RFC_READ_TABLE>
                   </xsl:variable>
                   <xsl:variable name="response1" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request1, 'BS_D','cc_RfcLookup', $inputparam)"/>
                   <xsl:element name="BELNR">
                        <xsl:value-of select="$response1//DATA/item/WA"/>
                   </xsl:element>
         </xsl:template>
    My Question: Am I doing anything wrong? Or Is it possible to call multiple lookups in one XSLT?
    Thanks and Regards,
    Atul

    Hi Atul,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • Cannot resovle the Symbol error in UDF - Java mapping - RFC Lookup ?

    Hi Friends ,
    We are working on Java mapping  -  UDF for RFC Lookup . It is giving the Cannot resolve Symbol for all imported archive java class files even if we give again all imported files in import section of UDF we are still getting the same cannot resolve error  .
    We are using SP 12 of XI 3.0 . What could be the reason ?
    Thanks.,
    V.Rangarajan

    Hi,
    Can you try to open imported archive in IR and check if the path(folder structure like com.abc.xyz.etc) for classes is same as in import statement in UDF.Since we had experienced the same problem.
    Thanks.
    Regards,
    Shweta

  • Error While RFC Lookups

    Hi
    I am performing RFC Lookups in my java code and when ever I am testing this java mapping code from Operation Mapping Test Tab, I am getting following error.
    Error while lookup Connection to system RUNTIME using application RUNTIME lost. Detailed information: Error accessing "http://pmichsappid16.app.pmi:8016/run/system/int?container=web" with user "PIREP_PID". Response code is 500, response message is "Internal Server Error"
    Error while closing accessor Technical error when calling an adapter remotely. The HMI method with the ID close was called with an incorrect session status. The system accessor object is missing.
    Could you please tell why I am getting this error.
    Note:1) When I am testing it end to end my code is working fine with out any errors.This happens only when I am testing it from operational mapping test tab.Previously I am able to execute my code from operational mapping test tab also.
    2) I am also closing accessor object in proper manner.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!PI 7.1 Strange behaviour!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Hi Prasanna,
                          I was facing the same error while testing JDBC lookup in the operational mapping. The problem was that while testing in the operation mapping or message mapping tab you need to provide the RFC channel created manually in the parameter. While end to end testing this is binded in the integration directory object,
    I provided the JDBC channel created for lookup manually in the operation mapping and i got the result.
    Hope this will help.
    Thanks
    Ajay Garg

  • Problem in RFC Lookup

    Hi,
    I am performing RFC lookup using Communication Channel.
    I have used a function called "Z_MATERIAL_DETAILS".
    Input to this function is "MATERIALID" and Output of the function is "MATNR".
    I am using the following code in my UDF for performing lookup::
    //write your code here
    final String CHANNEL_NAME = "CC_RFC_LookUp",
                   VALNOTFOUND = "VALUE_NOT_FOUND",
                   SAPRFCNS = "urn:sap-com:document:sap:rfc:functions",
                   TAG_FM = "Z_MATERIAL_DETAILS",
    //               TAG_QTB = "QUERY_TABLE",
                   TAG_QFL = "UOMCODE"; //UOMCODE
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = null;
              factory.setNamespaceAware(false);
              factory.setValidating(false);
              try {
                   builder = factory.newDocumentBuilder();
              } catch (Exception e) {
              //     trace.addWarning("Error creating DocumentBuilder - " + e.getMessage());
                   result.addValue(e.toString());
              Document docReq = null;
              try {
                   // Building up RFC Request Document
                   docReq = builder.newDocument();
                   Node root = docReq.appendChild(docReq.createElementNS(SAPRFCNS, TAG_FM));
                   root.appendChild(docReq.createElement(TAG_QFL)).appendChild(docReq.createTextNode(resultFieldName[0]));
              } catch (Exception e) {
              //     trace.addWarning("Error while building RFC Request  - " + e);
                   result.addValue(e.toString());
         //     trace.addInfo("RFC Request XML: " + docReq.toString());
              // Lookup
              Payload result1 = null;
              try {
                   Channel channel = LookupService.getChannel("EC1CLNT800", "CC_RFC_LookUp");
                   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);
                   result.addValue(e.toString());
              // Parsing RFC Response Document
              Document docRsp = null;
              try {
                   docRsp = builder.parse(result1.getContent());
              } catch (Exception e) {
              //     trace.addWarning("Error when parsing RFC Response - " + e.getMessage());
                   result.addValue(e.toString());
              //trace.addInfo("RFC Response XML: " + docRsp.toString());
              String res = "";
              try {
                   res = docRsp.getElementsByTagName("UOMTEXT").item(0).getFirstChild().getNodeValue();
              } catch (Exception e) {
              //     trace.addWarning("Result value not found in DOM - " + e.getMessage());
                   result.addValue(e.toString()+VALNOTFOUND);
              result.addValue(res);
    Code in Z_MATERIAL_DETAILS ::
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(UOMCODE) LIKE  MARA-MFRPN OPTIONAL
    *"  EXPORTING
    *"     VALUE(UOMTEXT) LIKE  MARA-MATNR
    *"  EXCEPTIONS
    *"      val_not_found
    <b>select single matnr from mara into uomtext where mfrpn = uomcode.</b>
    if sy-subrc <> 0.
    raise val_not_found.
    endif.
    ENDFUNCTION.
    <b>When i send three material ids the function module will access the R/3 system thrice which will give rise to PERFORMANCE ISSUE.
    So,is there any way to send all the materialids at one time to Function module and similarly receive all the MATNR from Function at once,so that we need to access R/3 system only once.</b>

    HI,
    Check this link for passing table parameter in JCO call.
    http://www.sapdevelopment.co.uk/java/jco/jco_callfunc.htm
    Following is the code for retrieving table parameter in JCO call to function BAPI_PO_CREATE.
    JCO.Table return_tab = function.getTablesParameterList().getTable("RETURN");
    if (return_tab.getNumRows()) > 0 {
    // Output the error messages
      return_tab.firstRow();
      do {
        System.out.println(return_tab.getString("MESSAGE");
      while (return_tab.nextRow());
    } else {
      String PO_NUM = function.getExportParametersList().getString("PURCHASEORDER");
      System.out.println("Purchase order " + PO_NUM + " created");
    Thanks and Regards,
    Sandeep Maurya.

  • Exception Handling in RFC lookup

    Hi Experts,
    I have a query in RFC Lookup function working with PI 7.1,  file to Idoc scenario.
    I am using Enhance Receiver Determination to find the dynamic recivers.Here we have used a Functional Module which gives an output according to the the input parameter (which comes from input file). thus i have used RFC lookup to the remote system to fetch this info from FM.
    Problem -
    When the remote system is down or if the RFC lookup attemped & exceptions raised for some reason (RFC user authority has been changed & it was not able to perform the intended Job at remote system) , the message stuck in queue and block the several other messages from another interfaces which belongs to teh same queue.
    Queries-
    This is not allowed in production as it affects other services.
    1>how can we handle the RFC lookup exception (in case of remote system is down or if the RFC lookup exception)
    2>how can we perform Local lookup at PI box rather then remote lookup (the FM fetches the data from remote system)
    3>Is Value mapping is relevant in this case raher the RFC lookup ? I am not sure as the values are dynamic & selected as per the FM's output.
    Please provide your valuable insight .
    Thanks in advance !
    -Jyoti

    Hi Jyoti,
    Answer for your 3 question.
    1. RFC lookup will get execute on R/3 so if R/3 is down there no way that your RFC lookup will work as expected.
    2. So if R/3 is down or RFC not able to get receiver system due to some problem.. then in that case.
              On your Receiver determination at bottom
              Configure  u201Cif no receiver found proceed as followingu201D
               In this you can have 3 option.
                        a. Error message u2013 if you select this the transaction will end with error message in SXMB_MONI
                        b. Ignore: if you select this execution will get ignored and there will not be any entry in SXMB_MONI
                        c. Select the following receiver. You can select this and can configured default receiver system in case if RFC not able to determine receiver then interface will get route to receiver system configured here.
    3. As you mentioned values are dynamic  then Value mapping doesnu2019t make any sense here. RFCl ookup is the right option and above are few other option in case you RFC lookup flailed.
    Thanks,
    Bhupesh

  • Java RFC lookup from XSLT mapping

    I tried to implement a generic Java RFC Lookup class to be called as a Java extension from my XSLT mapping. I found the How-To-Guide "Easy RFC lookup from XSLT mappings using a Java helper class" ([Easy RFC lookup pdf site|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14?quicklink=index&overridelayout=true]) and tailored the source code to my XSLT program.  I am getting the error "Variable '$inputparam' has not been bound to a value".  Can anyone tell me what I am missing?  I am not familiar with java at all, and only moderately familiar with XSLT.

    > I am getting the error "Variable '$inputparam' has not been bound to a value". Can anyone tell me what I am missing?
    At runtime the variable does not get value.  You need to assign value to the variable inputparam. Just curious why dont use the RFC lookup graphical  which is very easy and no need to handle java programming. You need to configure just reciever RFC communication channel.

  • 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();

Maybe you are looking for

  • How do I get photos from iCloud TO iPad?

    I connected my iPad in my computer and I dind't mean to restore it, but ir did. So now all my photos from the iPad are gone, but I know they are on iCloud. But the problem is I didn't make a backup from iCloud, and now I can't get them back to my iPa

  • PR-Account Assignment Q G/L field is disabled.

    Hi All, At the moment when purchase requisitions are generated by the WBS element,Account assignment Q, in the Account assignment tab of the requisition, i see G/L account field being determined from the valuation class in Material master (stock acco

  • Overhead at Cost Center Level --- Urgent

    Hi, Is there any way that we can apply Overhead based on Cost Center  in Costing Sheet and is there any thing we credit the overhead applied to that actual Cost Center rather than Other Cost center. I tried to create Dependencies and Condition table

  • WebService with JWSDP 2.0 doesn't work on Bea 9.1

    Hi, I have developed a WebService based on JAX-WS 2.0 with JWSDP 2.0. When I deploy my application (together with all required jar-files) as a war-file on a Tomcat 5.5, then everything runs fine. If I deploy the same application to Bea 9.1, then I ge

  • CS4Service Manager keeps asking to download Java Runtime?

    I kept getting a window on start up (CS4service manager) asking me to download Java Runtime. I finally went to the official Apple site and selected  the Java for Mac download site and downloaded it and I now don't get that anoying window every time I