Local lookup in message mapping
Hi all,
I've a table on the SAP PI system filled with data. From my message mapping, I want to do a lookup.
What's the best way to perform this lookup.
Again, this is a local table. So not a table residing on the SAP ECC system.
Thanks a lot.
Dimitri
Hi,
>>>I've a table on the SAP PI system filled with data. From my message mapping, I want to do a lookup.
What's the best way to perform this lookup.
the best/easiest way would be to use ABAP mapping (right after your message mapping - as in interface
determination you can have many mappings)
just to do the lookup in XI table (in abap mapping you juse use a select to get this data)
so map the data in message mapping
then do the lookup in abap mapping just for this one field
Regards,
Michal Krawczyk
Similar Messages
-
JDBC Lookup in message mapping
Hi Folks,
in a message-mapping i use a jdbc lookup.
i get this error, can anybody help me ?
Put value [Plain exception:Problem when calling an adapter by using communication channel JDBC_MKA_Receiver_Lookup (Party: , Service: R3EREDATA, Object ID: 3ab59ba811163c5697dbcd40fb0c4957) Check whether the communication channel exists in the Integration Directory; also check the cache notifications for the instance Integration Server (central Adapter-Engine) Channel object with Id Channel:3ab59ba811163c5697dbcd40fb0c4957 not available in CPA Cache.
thanks for your helpHi Folks,
now i get a new error.
it will be nice when you could answered me, thanks
Put value [Exception during processing the payload.Problem when calling an adapter by using communication channel JDBC_MKA_Receiver_Lookup (Party: , Service: BS_EPS, Object ID: 866ef440ca5b3cefb1381267f5693591) XI AF API call failed. Module exception: (No information available). Cause Exception: 'JDBC Adapter configuration not initialized: null'. com.sap.aii.mapping.lookup.LookupException: Problem when calling an adapter by using communication channel JDBC_MKA_Receiver_Lookup (Party: , Service: BS_EPS, Object ID: 866ef440ca5b3cefb1381267f5693591) XI AF API call failed. Module exception: (No information available). Cause Exception: 'JDBC Adapter configuration not initialized: null'. at java.lang.Throwable.<init>(Throwable.java:194) at java.lang.Exception.<init>(Exception.java:41) at com.sap.aii.mapping.api.StreamTransformationException.<init>(StreamTransformationException.java:29) at com.sap.aii.mapping.lookup.LookupException.<init>(LookupException.java:72) at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.execute(AdapterProxyLocal.java:131) at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.execute(SystemAccessorInternal.java:68) at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:149) at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:77) at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169) at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211) at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:332) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:0) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:336) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:868) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:250) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:0) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:92) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:30) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:35) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: com.sap.aii.af.service.api.AFException: XI AF API call failed. Module exception: (No information available). Cause Exception: 'JDBC Adapter configuration not initialized: null'. at java.lang.Throwable.<init>(Throwable.java:194) at java.lang.Exception.<init>(Exception.java:41) at com.sap.aii.af.service.api.AFException.<init>(AFException.java:88) at com.sap.aii.af.service.api.AdapterAccess.sendMsg(AdapterAccess.java:214) at com.sap.aii.af.service.api.AdapterAccess.execute(AdapterAccess.java:283) at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.execute(AdapterProxyLocal.java:123) at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.execute(SystemAccessorInternal.java:68) at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:149) at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:77) at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169) at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211) at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:332) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:0) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:336) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:868) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:250) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:0) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:92) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:30) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:35) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) ] -
Raising exceptions in database lookups in message mapping
Hi
We have been able to successfully do a database lookup from within a message mapping - thanks to weblogs already existing out there. However, we have requirement that states that - if the lookup fails ( failure to connect to DB / data retrieved is null ) , then the mapping should fail - and an exception raised.
How can we go about doing this from within the java code - of the mapping lookup ?
Any correct pointers /solutions to achieve this will be rewarded rightaway. Thanks in advance for your time.Hi,
you can use Alessandro's way:
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
this way you can throw smart exceptions:)
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
RFC lookUp during Message mapping
All
I want to get soem values from SAP table during message mapping.After getting the values am going to do 2:1 mapping by using BPM.
Could you please let me know the basic and fundamental things about RFC look up during mapping and RFC settings in XI as well in R3?
Please explainHi Rajesh,
Pl post this in XI Forums to get quick replies.
Regards
Ayyapparaj -
Soap lookup in PI7.31 message mapping
Hi All,
I have a soap lookup created in UDF in PI message mapping
I am taking material id from the source structure and use it as input parameter for the lookup webservice
Here is the UDF code which takes material number and returns the internal id
AbstractTrace trace = container.getTrace();
String matintid = "";
try {
//instance the channel to invoke the service.
Channel channel = LookupService.getChannel("BS_Bus","CC_SearchLookup");
SystemAccessor accessor = LookupService.getSystemAccessor(channel);
// The Request message in XML. THIS IS THE LOOKUP SERVICE
String SOAPxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><searchTM_MATERIAL>xmlns:ns0=\"MDM_MAT_Search_MDM"><query><criteria><fTX_MATERIAL><constraint><value>"
+a
+ "</value><expressionOperator>equals</expressionOperator></constraint></fTX_MATERIAL></criteria></query><reposInfo><repositoryName>REP_MATERIALS</repositoryName><serverName>mdm6765</serverName></reposInfo></searchTM_MATERIAL>";
InputStream inputStream =new ByteArrayInputStream(SOAPxml.getBytes());
XmlPayload payload = LookupService.getXmlPayload(inputStream);
Payload SOAPOutPayload = null;
//The response will be a Payload. Parse this to get the response field out.
SOAPOutPayload = accessor.call(payload);
/* Parse the SOAPPayload to get the SOAP Response back. */
InputStream inp = SOAPOutPayload.getContent();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
/* Create DOM structure from input XML */
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(inp);
NodeList matlist = document.getElementsByTagName("tM_MATERIAL");
Element material = (Element) matlist.item(0);
NodeList recidlist = material.getElementsByTagName("recordIdentification");
Element recidnode = (Element)recidlist.item(0);
matintid = recidnode.getNodeValue();
trace.addInfo("matnid is" + matintid);
} catch (Exception e) {
trace.addWarning("Error" + e); }
trace.addInfo("Service XXX success executed");
return matintid;
This is giving a java null point error
Errorjava.lang.NullPointerException: while trying to invoke the method org.w3c.dom.Element.getElementsByTagName(java.lang.String) of a null object loaded from a local variable at slot 16
Any idea whats going on? I am able to get response for the webservice using SOAP UI
And here is the soap input and output in SOAP UI execution
Input
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:MDM_MAT_Search_MDM" xmlns:urn1="urn:com.sap.mdm.ws.beans.mdt_mat_search_mdm_in" xmlns:urn2="urn:com.sap.mdm.ws.beans" xmlns:urn3="urn:com.sap.mdm.core.beans">
<soapenv:Header/>
<soapenv:Body>
<urn:searchTM_MATERIAL>
<urn:query>
<!--Optional:-->
<urn1:criteria>
<!--Optional:-->
<urn1:fTX_MATERIAL>
<urn2:constraint>
<!--Optional:-->
<urn2:value>12345</urn2:value>
<!--Optional:-->
<urn2:expressionOperator>equals</urn2:expressionOperator>
</urn2:constraint>
</urn1:fTX_MATERIAL>
</urn1:criteria>
</urn:query>
<urn:reposInfo>
<urn3:repositoryName>REP_MATERIALS</urn3:repositoryName>
<urn3:serverName>mdm1234</urn3:serverName>
</urn:reposInfo>
</urn:searchTM_MATERIAL>
</soapenv:Body>
</soapenv:Envelope>
Output:
<SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body xmlns:rpl="urn:MDM_MAT_Search_MDM">
<rpl:searchTM_MATERIALResponse xmlns:rn0="java:sap/standard" xmlns:rn1="urn:com.sap.mdm.ws.beans" xmlns:rn2="http://schemas.xmlsoap.org/soap/encoding/" xmlns:rn3="urn:com.sap.mdm.core.base" xmlns:rn4="urn:com.sap.mdm.ws.beans.mdt_mat_search_mdm_in" xmlns:rn5="urn:com.sap.mdm.core.beans">
<rpl:Response>
<rn1:executionStatus>
<rn1:status>OK</rn1:status>
<rn1:description>Search/Retrieve done successfully</rn1:description>
<rn1:dataObject>Records 1..1 of 1 found</rn1:dataObject>
</rn1:executionStatus>
<rn4:tM_MATERIAL>
<rn4:fTX_MATERIAL>12345</rn4:fTX_MATERIAL>
<rn4:recordIdentification>
<rn4:internalID>1267</rn4:internalID>
</rn4:recordIdentification>
</rn4:tM_MATERIAL>
</rpl:Response>
</rpl:searchTM_MATERIALResponse>
Thx
mikeHi Mike,
What I suspect is, you get a null pointer exception because the XML tag name which you are trying to retrieve, has a namespace. Could you please instead try to use:
getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
Returns a NodeList of all the Elements with a given local name and namespace URI in document order.
Let us know if it works.
Regards,
Shweta -
Data lookup in R/3 database from message mapping
Hi,
I am trying to lookup R/3 database from Message mapping.
Instead of creating Java class outside XI and then importing into Integration Repository, I have defined an advanced function in message mapping and trying to connect to R/3 using JCo API. But System is giving syntax errors as listed below:
Check Result for Object CustomerDetailsMap Source code has syntax error:
F:/usr/sap/C03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapc1513850c14511d985d5001143eb68b9/source/com/sap/xi/tf/_CustomerDetailsMap_.java:58: illegal character: 160 Â Â Â Â Â Â Â Â // Change the logon information to your own system/user
F:/usr/sap/C03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapc1513850c14511d985d5001143eb68b9/source/com/sap/xi/tf/_CustomerDetailsMap_.java:60: illegal character: 160             "DEV18" ,    // userid
Can somebody help in rectifying the problem?
Thanks and Regards,
Nitin.Hi,
can u post the java code which u have used in mapping.
There is a doc in XI-Articles. "How to Perform SAP Data Lookups Within XI Mappings" By Jerome Delune 16 October, 2003. Try looking at this article and do ur mapping.
Hope this helps you.
Cheers,
Siva Maranani. -
Lookup value mapping table through message mapping.
Hello All,
I am working on a graphical mapping (message mapping). When trying to map the source message to the target message, I need to find out it a particular <b>key</b> exists in the <b>value mapping table</b>. Depending on the result, I need to map different source fields to the target field.
Is there any inbuilt function which will allow me to do a lookup on a value mapping table, or is it possible to lookup a value mapping table from a UDF?
Please help!
Warm Regards,
KeertiHi,
Please see the below links for Value mapping ..
Value mapping /people/sukumar.natarajan/blog/2006/10/23/accessing-value-mapping-defined-in-directory-using-java-functions
Value mapping in XSLT /people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
Value Mapping replication - /people/sreekanth.babu2/blog/2005/02/23/value-mapping-replication
Also see
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=value%20mapping%20in%20xi&cat=sdn_weblog
/people/community.user/blog/2007/01/08/valuemapping-using-the-graphical-mapping-tool
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=value%20mapping%20in%20xi&cat=sdn_weblog
Regards
Pradeep N -
Hi.
I'm trying to do a RFC inside a message mapping with java code. I have to send a field (id) and return the vendor code (lifnr).
I'm searching michal Krawczyk's weblog to see how can i do that but the link is broken.
Does anybody has that document that can send me to [email protected]?
Regards.
Inigo.hi Inigo,
please look at the following blogs,
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
/people/michal.krawczyk2/blog/2005/09/15/xi-rfc-mapping-lookups-from-bc-to-xi
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/801376c6-0501-0010-af8c-cb69aa29941c
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/801376c6-0501-0010-af8c-cb69aa29941c
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
Regards
Sreeram.G.Reddy
Message was edited by:
Sreeram Reddy -
RFC Lookup's in message mapping fail with RuntimeException for no reason
Hi guys,
We have developed interfaces that execute a lot of RFC's from Message Mapping, by making use of RFC Lookup API.
In ID, in the corresponding RFC Receiver Communication Channel we have set the number of maximum connections to 100.
However, when a big number of Idocs with lots of items is sent to XI some messages fail in XI because mapping fails with a runtime exception that is not correct, since there is a return value found from the execution of the RFC function. And when I am testing the mapping in Test mode of XI IR, the mapping is executed successfully.
Do you think that by increasing the maximum number of connections in Communication Channel, it will take effect?
EvaggelosHi Evaggelos,
DECREASE, may be til 10.
Regards,
Udo -
Lookup into R/3 table during Message Mapping
Hi all,
I have a field in my source message that I need to convert. The corresponding values are stored in an R/3 table. I could use a 2:1 mapping in a BPM to merge an RFC call reading the table with my mapping, but I was told that this can be done without using BPM.
Can anyone describe me this ?
Thanks in advance.
Best regards,
JulienHi Julien,
Starting SP13 you can perform RFC lookups within your mapping using standard RFC API.
Check this michal's document for the same...
https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/801376c6-0501-0010-af8c-cb69aa29941c
Regards
Anand
Message was edited by: Anand Torgal -
SOAP lookups from withing message mapping
Hi
We are doing a call to a webservice from within a udf in a message mapping using the SOAP API described in one of the blogs in SDN. We are using a soap receiver communication channel to make this webservice call -
We see activity on the communication channel monitoring - indicating that there is a call going out and a response coming back from the webservice. But there are no details shown on the payload in communication channel monitoring. We do not see this webservice lookup as a message on the adapter engine either ?
Is there any place from within XI runtime environment we can get a hold of the message going out to webservice call and the return from webservice ? We are facing problems in the webservice not doing the required action desired and hence this question on visibility of the call to the webservice.
Thanks in advance for your time.My udf is basically makes a call to the webserservice lookup method ( line - CallCentralMonitoring.LogToCentralMonitoring( "IN130.10", "COMPLETED"); ) - the definition of CallCentralMonitoring class is given below after the udf
UDF
String adapter = "RECEIVE_FusionDBLookUpRequest";
Channel channel = null;
boolean retry = false;
int noOfRetries = 0;
String sqlQuery = new String("");
DataBaseAccessor accessor = null;
DataBaseResult resultSet = null;
String parameterValue = new String("");
MappingTrace trace = container.getTrace();
// Build the Query String
//sqlQuery = "select * from CTL_BusinessRules with (nolock) where parameter_key = '" + parameterKey + "'";
sqlQuery = "exec uspCTL_GetBusinessRule '" + parameterKey + "'";
do
try
//trace.addInfo( "SQL query is: " + sqlQuery);
// Determine a channel, as created in the Configuration
channel = LookupService.getChannel(businessService,adapter);
// Get a system accessor for the channel. As the call is being made to a DB, a DatabaseAccessor is obtained.
accessor = LookupService.getDataBaseAccessor(channel);
//trace.addInfo( "Successfully obtained the system accessor..." );
// Execute Query and get the values in resultset
resultSet = accessor.execute(sqlQuery);
Iterator rows = resultSet.getRows();
//trace.addInfo( "Executed query successfully..." );
while( rows.hasNext() )
Map rowMap = (Map)rows.next();
parameterValue = rowMap.get("CHARACTER_VALUE").toString();
//trace.addInfo( "Parameter Value is: " + parameterValue );
retry = false;
CallCentralMonitoring.LogToCentralMonitoring( "IN130.10", "COMPLETED");
return parameterValue;
catch( Exception ex )
//trace.addInfo( ex.toString() );
if ( noOfRetries < 3 )
retry = true;
noOfRetries++;
else
retry = false;
CallCentralMonitoring.LogToCentralMonitoring( "SD152.01", "Error");
ExceptionThrower.fire( "Database connectivity error: " + ex.toString() );
finally
try
if ( accessor != null ) accessor.close();
catch( Exception e )
ExceptionThrower.fire("Error closing accesor: " + e.getMessage() );
//return e.getMessage();
} while( retry );
return null;
Class CallCentralMonitoring
package com.xxxxx.xi.mapping.udf;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import com.sap.aii.mapping.lookup.Channel;
import com.sap.aii.mapping.lookup.LookupException;
import com.sap.aii.mapping.lookup.LookupService;
import com.sap.aii.mapping.lookup.Payload;
import com.sap.aii.mapping.lookup.SystemAccessor;
import com.sap.aii.mapping.lookup.XmlPayload;
public class CallCentralMonitoring {
public static void LogToCentralMonitoring (String MON_EISLDCTLID, String MON_MsgStatus) {
String soapXML = new String("");
/* Pass the Business System and Communication Channel as input to the getChannel().
/* BS_SOAPLOOKUP Business System*CC_Webservice_SOAP_CURRENCY_CONVERTOR Receiver SOAP Adapter */
Channel channel = null;
try {
channel = LookupService.getChannel( "EI_CentralMonitoringServives", "Receive_SOAP_TrackingServiceWS" );
} catch (LookupException e) {
// TODO Auto-generated catch block
e.printStackTrace();
SystemAccessor accessor = null;
try {
accessor = LookupService.getSystemAccessor(channel);
} catch (LookupException e) {
// TODO Auto-generated catch block
e.printStackTrace();
/* Construct the SOAP Request Message using the InputParameters */
soapXML = "<LogToCentralMonitoring xmlns=\"http://xxxxx.EI.CentralMonitoring\"> <loggingData> <MON_EISLDCTLID>"
+ MON_EISLDCTLID
+ "</MON_EISLDCTLID><MON_ProgramID>"
+ MON_EISLDCTLID
+ "</MON_ProgramID><MON_ProcessID>"
+ MON_EISLDCTLID
+ "</MON_ProcessID><MON_ClientAlert>"
+ "N"
+ "</MON_ClientAlert><MON_MsgStartTimeStamp>"
+ "03/30/2007 10:00:00"
+ "</MON_MsgStartTimeStamp><MON_MsgEndTimeStamp>"
+ "03/30/2007 10:00:01"
+ "</MON_MsgEndTimeStamp><MON_MsgStatus>"
+ MON_MsgStatus
+ "</MON_MsgStatus><MON_MsgStatusDescription>"
+ MON_MsgStatus
+ "</MON_MsgStatusDescription> </loggingData> </LogToCentralMonitoring>";
InputStream inputStream = new ByteArrayInputStream(soapXML.getBytes());
XmlPayload payload = LookupService.getXmlPayload(inputStream);
Payload soapOutPayload = null;
/The SOAP call is made here and the response obtained is in the soapOutPayload./
try {
soapOutPayload = accessor.call(payload);
} catch (LookupException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}//end LogToCentralMonitoring
}//end class -
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. -
Message Mapping fails because of RFC
Guys,
1) I have some messages failed in SXMB_MONI because message mapping for those interfaces was not executed successfully. In trace I can see the following:
"com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed Connect_PM TYPE=A ASHOST=121.12.2.15 SYSNR=02 GWHOST=121.12.2.15 GWSERV=sapgw02 PCS=1 LOCATION CPIC (TCP/IP) on local host with Unicode ERROR partner not reached (host ?, service ?) TIME Wed Jul 11 07:20:27 2007 RELEASE 640 COMPONENT NI (network interface) VERSION 37 RC -10 COUNTER 1024</Trace>"
I realize it is a network connection problem, but..
Any ideas?
2) Actually, in my mapping programs I have to perform many RFC's to both XI and target/source SAP systems, in order to get some information. The techique that I am using for RFC's is through Java's com.sap.mw.jco.* package. And I connect to systems by giving the IP address, system number, username and password of the systems and then I execute the remote enabled function modules.
However. when I have many RFC's some of them fail, maybe because the maximum number is reached. And then I have to manually restart them from SXMB_MONI and they are successfully processed.
Any ideas?But you said you call many RFCs inside XI, right?
The proper way of doing it is not using JCo directly, but using Mapping Lookup API instead. In this way, you won't need to maintain the connection details inside the code, but in the communication channels.
Check this out: https://help.sap.com/javadocs/NW04S/current/pi/index.html (lookup api).
There are some code examples within the classes (for example, RfcAcessor).
I think there is also a SDN documentation by Michal Krawczyk regarding RFC Lookups.
Just search for it.
Regards,
Henrique. -
How to use the variables used in the message mapping
Hi ,
In the message mapping we can declare variables in the JAVA section , these variables could be used across the mapping .
I have tried using it but I am unable to retrieve the values assigned to the variables in one UDF into the another UDF .
Please guide me how to use the variables declared in the JAVA section in the message mapping .
Thanks
Anita YadavAnita,
I have worked on the Global variables and i found no issues. Make sure that the variable is declared in the Declaration Section and then initlaized in the Initialization section.
If you declare a variable in the Declaration Section ,
int i;
then in any udf you can use if directly. No need to re declare the variable in the UDF. If you do this, then it becomes a local variable.
Regards,
Bhavesh -
I am receiving errors when trying to activate my MM. I believe the issues are in one of two UDF's. These UDF's do work in another MM without error. Below are the error's and UDF's.
ERRORS:
Activation of the change list canceled Check result for Message Mapping MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE | http://wawa.com/xi/erp/pos: Starting compilation Source code has syntax error: /usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map5420e070cabe11dcab4b00306ef38da9/source/com/sap/xi/tf/_MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_.java:3291: cannot resolve symbol symbol : variable container location: class com.sap.xi.tf._MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_ map = container.getTransformationParameters(); ^ /usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map5420e070cabe11dcab4b00306ef38da9/source/com/sap/xi/tf/_MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_.java:3293: cannot return a value from method whose result type is void return constant; ^ 2 errors
UDF's:
public String getSender(Container container){
String constant;
java.util.Map map;
// get constant map
map = container.getTransformationParameters();
constant = (String) map.get (StreamTransformationConstants.SENDER_SERVICE);
return constant;
IMPORTS: com.sap.xi.mapping.parse.dom.;javax.xml.parsers.;java.io.;com.sap.aii.mapping.lookup.;org.w3c.dom.*;
public String getSeqNum(String fileType,String objNum,String Sender,Container container){
String request = "<ns0:ZRFC_NUMBER_GET_NEXT xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><NR_RANGE_NR>" + fileType + "</NR_RANGE_NR><OBJECT>" + objNum + "</OBJECT><QUANTITY/></ns0:ZRFC_NUMBER_GET_NEXT>";
InputStream isRequest = new ByteArrayInputStream(request.getBytes());
SystemAccessor accessor = null;
String num = null;
try{
// 1. Determine a channel.
Channel channel = LookupService.getChannel(Sender, "R_RFC_ERP");
// 2. Get a system accessor for the channel.
accessor = LookupService.getSystemAccessor(channel);
// 3. Create a payload according to the data type which the adapter expects.
// Use service.getBinaryPayload() for binary payload,
// and service.getTextPayload() for text payloads.
Payload payload = LookupService.getXmlPayload(isRequest);
// 4. Execute lookup.
Payload response = accessor.call(payload);
//Parse response
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputStream resStream = response.getContent();
Document doc = builder.parse(resStream);
Element sequence = doc.getDocumentElement();
NodeList number = sequence.getElementsByTagName("NUMBER");
//Extract Number
num = DOMUtil.getSimpleElementText((Element) number.item(0));
} catch (Exception e) {
return e.getMessage();
} finally {
try {
if (accessor != null) accessor.close();
} catch (Exception e) {
return e.getMessage();
GlobalContainer gc = container.getGlobalContainer();
gc.setParameter("Num", num);
return num;
Any help is appreciated.
Regards,
DarrellFauver,
Just to narrow down the problem first remove the first udf and only use the 2nd user defined function. Also in the 2nd udf you have to change this line:
try{
// 1. Determine a channel.
Channel channel = LookupService.getChannel(Sender, "R_RFC_ERP");
In the above line instead of Sender you use the business service or business system where R_RFC_ERP RFC communication channel is created in Integration Directory. So you are hardcoding it first.
Once you have done this changes do save and test it once again. If this works then you can change back to original and your first udf needs to be checked.
Regards,
---Satish
Maybe you are looking for
-
HP office jet 6600 wi fi printing
hi have a 6600 office jet and it wont recognise ip address to finish set up. if i want to print i have to take my router name off settings and put the officjet in. The printer says its connected and all correct name and its in my priners file but c
-
Hi, I am trying to configure mail sender adapter with imaps. Adapter status in a adapter monitor has a "red" status with following error message : "error occured: exception caught during processing mail message; java.io.EOFException: Connection close
-
MacBook Pro (2011) Won't Charge Without Restart
Hi guys, I searched the forums for this problem but couldn't find a match. When I plug the power cable into my 2011 17" MacBook Pro it won't take a charge and the light on the cable doesn't come on. However if I restart the computer, the light will c
-
Autofill date in PDF form created in InDesign CC
I am creating a form using InDesign CC which I will convert into an interactive PDF. I would like it to automatically fill in the date into the date field and add 7 days and fill in that date into a second field. Does anyone know how this can be done
-
My Apple Tv 1 is connected wirelessly to our network (I can download movies, etc) but I does not show in Itunes. I have seen the previous thread re re-pairing it but I can't do that because it does not come up in Itunes as a device. There is also n