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.
Similar Messages
-
How to set EXPORT parameter from message mapping
Again, ask the question of export parameter.
I wrote a java version transformation and it worked good with export parameter.
However I can not work it out in graphical message mapping. I refered http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c3e1fa6c31599ee10000000a1553f6/frameset.htm.
In PI7.1, I add an export parameter "EXPORT_PARA" in the "Signature" tab. Are there any special step to assign this parameter to an UDF? I did not find a way to do it.
And then I define an UDF,
public String SetExportPara(String sss, Container container) throws StreamTransformationException{
String str = "GOOD";
GlobalContainer gc = container.getGlobalContainer();
OutputParameters paras= gc.getOutputParameters();
if(paras.exists("EXPORT_PARA ") == true) {
paras.setString("EXPORT_PARA ", str);
}else {
str = "NOT FOUND EXPORT_PARA";
return str;
And I assign this UDF to one element of my output XML, I tried to run it in IE, it always output "NOT FOUND EXPORT_PARA.
why?????
I know there is a blog : https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8654. [original link is broken] [original link is broken] [original link is broken]
But it did not talk how to set export parameters.Hi,
i read thread
How to export parameters from Message Mapping
and blog
/people/jin.shin/blog/2008/02/14/sap-pi-71-mapping-enhancements-series-parameterized-message-mappings
but not found issue
in this topic
http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c3e1fa6c31599ee10000000a1553f6/frameset.htm.
if i writting this code in UDF, i getting an error.
If use this code:
GlobalContainer gc = container.getGlobalContainer();
OutputParameters paras= gc.getOutputParameters();
paras.setString("EXPORT_PARA ", str);
the export parameter is defined locally (in transformation step area). In integration process area parameter is equal to NULL.
How send export parameter to Integration Process? For exapmple, i wanna send parameter to other transformation step in my integration process.
thx. -
Error exporting XIM file from message mapping
Hi.
We are trying to export XIM files from message mapping with CTRL + SHIFT + 0 but is not working. Iu2019ve tried to solve it with this link:
[http://support.microsoft.com/kb/967893]
but is still not working.
We are with SAP PI 7.11 SP 07. Is there any SP level prerequisite to be able to export message mappings in xim files?
Thanks a lot.
Edited by: Christian Abad Chico on Feb 28, 2012 11:15 AMI think you can't use 1.4 in SAP PI 7.1.
I've downlaned the JDK 5 and I've associated it to enviroment variables PATH and JAVA_PATH but the application is still opening with JAVA 6.....
Any idea?
Regards.
Edited by: Christian Abad Chico on Feb 28, 2012 1:18 PM
Edited by: Christian Abad Chico on Feb 28, 2012 1:19 PM -
Is it possible to retreive data and store it in database from a AWM cube?
Hi all,
Table to cube is possible by maintaining..but Is it possible to retreive data as it stored in cube and store it in database from a AWM cube?
Regards,
Arjun JkoshiHi there,
Yes, it is possible - and very easy. Remember an OLAP cube is fully integrated with the Oracle database and therefore treated very much as a native object.
With 11g OLAP, cube views are created automatically when you define a cube using AWM. These views provide SQL access to the data in the OLAP cube meaning that it is very easy to transfer data into a table using techniques such as 'create table as select * from cube_view' or 'insert into table select * from cube_view'. You can use WHERE clauses to filter specific values from the cube into the table, and in 11g, an optimisation has been added to ensure that NULL rows are eliminated from the result set automatically (OLAP cubes are typically very sparse and therefore contain many NULL values)
With 10g OLAP, cube views can be added on top of existing cubes that have been created using AWM. It is easiest to do this using the [view generator|http://www.oracle.com/technology/products/bi/olap/viewGenerator_1_0_2.zip] utility from the [OTN OLAP home page|http://www.oracle.com/technology/products/bi/olap/index.html]. With the views in place it is once again very easy to transfer data into a table using techniques such as 'create table as select * from cube_view' or 'insert into table select * from cube_view'.
I hope this is clear and makes sense. Which version of Oracle OLAP are you using?
Thanks
Stuart -
JCO from Message Mapping in XI
I'm trying to create a function in XI Message Mapping that saves some information in a XI DB table using JCO.
I've created DB table ZEDI with Fields A,B,C,D. My function is following:
imports:java.lang.String;java.io.ByteArrayInputStream;java.io.InputStream;com.sap.mw.jco.*;
public String WriteTable(String ISA,String GS,Container container){
//write your code here
String DBTABLE = "ZEDI";
String sapClient = "200";
String hostName = "10.1.10.81";
String systemNumber = "00";
String userName = "DBuser";
String password = "DBpass";
String language = "EN";
int i = 0;
JCO.Repository mRepository;
JCO.Client mConnection = JCO.createClient(
sapClient,
userName,
password,
language,
hostName,
systemNumber );
// connect to SAP
mConnection.connect();
// create repository
mRepository = new JCO.Repository( "GenericLookup", mConnection );
// create function template to select data from any table
JCO.Function function = null;
IFunctionTemplate ft = mRepository.getFunctionTemplate("ZEDI");
function = ft.getFunction();
//JCO.ParameterList lookupFieldPos = function.getImportParameterList();
JCO.Table FieldPos = function.getTableParameterList().getTable("ZEDI");
// Pass function parameters
FieldPos.setValue(ISA,"A");
FieldPos.setValue(GS,"B");
mConnection.execute(function );
mConnection.disconnect();
return ISA;
Message Mapping test returns Exception:[java.lang.NullPointerException].
Do you have any idea what do I need to change to make it working?
Thanks!
NaychoHi Naycho
You have created a SAP table, but you have to create ABAP Function Module (RFC) with import /export parameters to access tables via JCO.
The null pointer exception is because - IFunctionTemplate ft = mRepository.getFunctionTemplate("ZEDI");
is searching for a function not table name.
hope this helps
Regards
Prahllad -
Use exported parameter from message mapping (via UDF) in next mapping prog
Is there any chance to assign an exported parameter from one message mapping to another mapping program within an operation mapping?
Hi,
Try using dynamic configuration
1. Set value in message mapping and
2. Get value in java mapping
Refer this link http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
Regards
Suraj -
How to export parameters from Message Mapping
You can make use of this export parameter only in transformation step of Integration Process. You may use the following "Parameterized Mapping Programs"
http://help.sap.com/saphelp_nwpi71/helpdata/en/27/db283fd0ca8443e10000000a114084/content.htm
Regards,
PrateekIf you have defined the signature of your UDF then the return value of the UDF must be assigned to the Export paramter of message mapping.
Basically import parametrs represents the inputs to be passed for that function(message mapping here)
and export represents the output of that function.
so in your case if you want toassign the value to Export parameter (ERROR_TEXT) in UDF catch block
assign the error returned to the ERROR_TEXT field
http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c3e1fa6c31599ee10000000a1553f6/frameset.htm
Check this link
Hope this is clear
Rajesh
Edited by: Rajesh on Mar 13, 2009 5:31 PM -
JDBC Data Sources: connecting the HR database from Oracle Express
What goes in the data string?
Where do I find the information for Host name, port and SDI?
Thanks!try these link
About 'create database link ...'
http://www.dba-oracle.com/t_how_create_database_link.htm
http://forums.oracle.com/forums/search.jspa?threadID=&q=dblink&objID=f251&dateRange=all&userID=&numResults=15&rankBy=10001
Edited by: Binepal on May 20, 2010 7:44 AM -
Error when testing from Message mapping test tab
Hi Experts,
I am wondering that when i test the message in the MM test tab its giving error and target message is not generating. I am not testing end to end then why it is triggering communication channel?
I can see that the 'RFC_Alert_Service_RFC_Receive' communication channel is in Red color RWB--> communication channel monitoring. I even even refreshed the cache and also activated the RFC channel but no use.
Below are the error details:
Error when testing message from test tab of mapping -->
java.lang.RuntimeException: Exception during processing the payload.Problem when calling an adapter by using communication channel RFC_Alert_Service_RFC_Receiver (Party: , Service: RFC_Alert_Service, XI AF API call failed. Module exception: 'error while processing the request to rfc-client: com.sap.aii.af.rfc.afcommunication.RfcAFWException: RfcAdapter: receiver channel has static errors: can not instantiate RfcPool caused by: com.sap.aii.af.rfc.RfcAdapterException: error initializing
Error in Communication channel monitoring -->
Receiver channel 'RFC_Alert_Service_RFC_Receiver' for party '', service 'RFC_Alert_Service'
Error can not instantiate RfcPool caused by:
com.sap.aii.af.rfc.RfcAdapterException: error initializing RfcClientPool:com.sap.aii.af.rfc.core.repository.RfcRepositoryException: can not connect to destination system due to: com.sap.mw.jco.JCO$Exception: (103) RFC_ERROR_LOGON_FAILURE: Password logon no longer possible - too many failed attempts.
Please help me how can i resolve this issue to successfully test the message in mapping-test tab.
Regards,
Suresh.> Error in Communication channel monitoring -->
> Receiver channel 'RFC_Alert_Service_RFC_Receiver' for party '', service 'RFC_Alert_Service'
> Error can not instantiate RfcPool caused by:
> com.sap.aii.af.rfc.RfcAdapterException: error initializing RfcClientPool:com.sap.aii.af.rfc.core.repository.RfcRepositoryException: can not connect to destination system due to: com.sap.mw.jco.JCO$Exception: (103) RFC_ERROR_LOGON_FAILURE: Password logon no longer possible - too many failed attempts.
Unlock the user you are using in the RFC channel and provide the correct password in the channel configuration. Once the channel error is resolved you would be able to test the Mapping sucessfully...
>>why it is triggering communication channel?
You would be using RFC lookup in the mapping....
~SaNv...
Edited by: Santhosh Kumar V on Jul 8, 2009 5:48 PM -
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 -
Alert from Message Mapping Response
Hi All,
I am working on a scenario wherein I am using BAPI Request & Response Messages in my mapping. I am receiving a no. from Bapi Response if the request i successful. If the number returned from BAPI is null or '', then an alert has to be thrown and send an email to support, otherwise normal processing of message.
My question is how can I raise an alert from BAPI return Variable Value without using BPM or JAVA UDF.Hi,
Alert Configuration
http://help.sap.com/saphelp_nw04/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm
Alert Inbox
http://help.sap.com/saphelp_nw04/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm
Alert Notification Step-by-Step
http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
Defining Alert Classifications
http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
Triggering Alerts
http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
Setting up alerts
Setting up alerts in RZ20
Alert Management
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e04141e8-0f11-2a10-adaa-9d97b062c2df
Alert Notification
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90f449a8-a6db-2910-a386-d2b5999f5751
Regards,
Phani -
How to Cache Data from database for java mapping ?
Hi
I have a scenario where i have to dynamically query a huge table in some other database from java mapping code.
Therefore instead of making a new Database trip everytime is there a mechanism by which i can cache the entire table contents into XI first and then use this cache for looking up data through my java mapping.
Any other alternative also welcome which would give best performance.
Please Suggest
regards
Nilesh Taunk.Hi Nilesh,
I am not sure if you can actually cache the table in XI. You will have to look up directly from your Database everytime your mapping excecutes.
To perform DB lookup during mapping very efficiently, I would suggest that you take a look at this blog,
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
Also, instead of doing the DB look up in mapping, you can also use your JDBC adapter as a sender and collect the information you want from your DB,
If you are using your JDBC as a sender, then your JDBC will poll over your database and select the rows that satisfy your Select Query. Also, there is another field in your JDBC adapter that is very important and that is the Update satatement. Once your JDBC adapter executes your select query and selects rows from the database, you might not need those rows to be selected again. In this csse, you can use the Update statement to update the database.
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
The choice between a JDBC sender adapter , and the DB lookup will have to be on the basis of your requirements.
Regards,
Bhavesh -
Remove Deteled Databases from SQL Server Management Studio List
Hi,
I am using SQL Server Express 2008 Management Studio & in the databases list are some databases that are non existent (have been deleted in Windows Explorer). How do I remove them as trying to delete when logging in using Windows authentication
fails?
Thanks
Paul.
Paul WainwrightHi pr_wainwright,
I’m writing to follow up with you on this post. Was the problem resolved after performing our action plan steps? According to your description and error message, we need to verify if your windows login account has sysadmin permission. The error 3701 occurs
when you use an account to execute the script who has not grant the permission about modifying database properties and creating database. I do a test, when the SQL Server Service is stop, I delete the data and log file of database from Windows Explorer, then
restart the service again, and connect to the SQL Server instance via windows login account which is sysadmin role. In SSMS list, you can right click the database and choose “ delete” option. Or you also use the drop statement by using master database first.
and two ways can all run well.
Regards,
Sofiya Li
If you have any feedback on our support, please click here.
Sofiya Li
TechNet Community Support -
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 -
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
Maybe you are looking for
-
Can anyone get a straight answer from Openreach......
Is there anyone or anywhere you can get a straight answer from openreach on when a cabinet wil be connected? I think I know whats going on. They are connecting exchanges to meet targets but not bothering with cabinets. Exchange connected = Fibre in a
-
When I always shut Down my Laptop so during shutting down I am getting error message. I am not able to note down the message coz it went out quickly.
-
HOW DO YOU REINSTALL THE SAFARI APP ON AN IPOD TOUCH?
MY SON HAS DELETED THE SAFARI APP ON HIS IPHONE AND WE CAN'T FIND OUT HOW TO REINSTALL IT?
-
Tab pages do not have "scroll" feature in 9i
I have a couple of forms with a lot of Tab pages, and in the Forms9iDS it appears to have that small, horizontal "scrollbar" (widget with [start][scroll on tab page back][scroll one tab page forward][end] at the upper right corner). However, the tab
-
Any reason to keep my VST Plugin's?
I have a ton of VST plugins about 400 megs. Often while installing an AU the corresponding VST gets installed also. Is there any reason I should keep these? I never use them and beofre I toss them I thought I'd give a shout.