on 04-15-2009 9:58 AM
Hi All,
I want to do lookup fro SAP PI table in the graphical mapping.how to do that one.
My table is with two columnd like EMPID EMPNAME
There is one table in SAP PI.In graphocal mapping from source i will get EMPID i want to get the corresponding EMPNAME from the table and send it to target filed.
Is there any easy way to do it in SAP PI 7.1 by usinf RFC lookup conversion?
please tell me easy way to achive this one
Thanks
rams
Hi,
In PI 7.1 RFC Lookup is much easier, you need not to write UDF for RFC, JDBC an SOAP Lookup
1. First you need to create a RFC Communication Channel as a receiver to be used for Lookup
2. Create a message mapping where input will be passed to RFC Lookup.
A) Go to Signature Tab and Define a Channel Parameter under parameters section
Parameter: Name, Category and Type.
B) Go back to design tab, click on RFC Lookup and select the channel defined in signature tab.
Click on white box Icon below channel to select the RFC structure. (This will show the RFCs under
imported objects).
C) Going ahead, select and add fields in the request and response sections to define lookup import and
export parameters.
D) Go to test Tab to test this scenario. Under Parameters section specify the actual communication
channel name defined in Integration Builder.
E) Go back to Document tab, provide any input string and execute the mapping. And here we can see
the target field u201Cresultu201D populated with RFC response
Cheers! Hope It hepls you
Sameer!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use RFC look up and build UDF with below code.
//write your code here
//write your code here
//String DBTABLE = a[0];
String lookUpField =a;// d[0];
String returnVal = "";
//String WHERE_CLAUSE = b[0]" = ""'"c[0]"'" ;
String sapClient = "200";
String hostName = "10.215.134.107";
String systemNumber = "00";
String userName = "username";
String password = "pwd";
String language = "EN";
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( "GenericRFCMappingLookup", mConnection );
// create function template to select data from any table
JCO.Function function = null;
IFunctionTemplate ft = mRepository.getFunctionTemplate("RFC_READ_TABLE");
function = ft.getFunction();
// Obtain parameter list for function
JCO.ParameterList input = function.getImportParameterList();
// Pass function parameters
// set import parameters table name and RFC
input.setValue( "QUERY_TABLE", "Table Name");
input.setValue("DELIMITER", ";");
//Fill the where clause of the table
//JCO.ParameterList tabInput = function.getTableParameterList();
//JCO.Table inputTable = tabInput.getTable("FIELDS");
//inputTable.appendRow();
//inputTable.setValue(WHERE_CLAUSE,"TEXT");
mConnection.execute( function );
//Find the position of the field that has to be lookedUp
JCO.Table lookupFieldPos = function.getTableParameterList().getTable("FIELDS");
int pos = -1;
int landPos = -1;
for (int i = 0; i < lookupFieldPos.getNumRows(); i++)
{
lookupFieldPos.setRow(i);
if (lookupFieldPos.getString("FIELDNAME").equals("EMPID"))
pos = i;
if (lookupFieldPos.getString("FIELDNAME").equals("EMPNAME"))
landPos = i;
}
//Get the exact lookupvalue from the position obtained above
JCO.Table valueSet = function.getTableParameterList().getTable("DATA");
for (int i = 0; i < valueSet.getNumRows(); i++)
{
valueSet.setRow(i);
String resultSet [] =valueSet.getString("WA").split(";"); //valueSet.getString("WA").split(",(?=(?:[\"]*\"[\"]\")(?![^\"]*\"))");
if(resultSet[pos].equals(a))
{
returnVal = resultSet[landPos];
}
}
mConnection.disconnect();
return returnVal;
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes you can go ahead with RFC lookups.......
I think in PI7.1 there is standard fucntion for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.