on 03-10-2008 9:21 AM
Hi Folks,
My current scenario is that I have used fixed value mapping to map a single target field. These details are actually maintained in the TP_Code table in R3 (a sample table).
TradingPartner:SAP:Short Text
PA:PA:Package
PL:PAL:Pallet
.....
The table contains 20 entries.
I am thinking that fixed value mapping is not a good option since there might have future changes in the TP_Code table.
Is rfc lookup a good option? But I am not sure which rfc to use and if there is any udf availble to be used in parsing the xml payload.
Please advise.
Thanks a ton!
hi
In this type of scenario Value mapping is not a good option ,You hv to RFC lookup.
In the below link it has all the information..how to do the RFC lookup...
chk this link for more information
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
Thanks
MANas (reward with points)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
IF u r thinking to replace the Fixed value with RFC lookup then u have following configuration to be done.
To be done in XI:
1) Create one R3 table and maintained all the entries.
2) Through UDF u need to passthe input value to RFC function module where u will select the output value for that input value.
3) Return the value to the UDF.
refer the below link for RFC lookup:
RFC lookup using JCO (without communication channel)
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
RFC lookup with communication channel.
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
Now disadvantage of this is:
Everytime u need the output value u need to jum from Java stack to abap stack. this will not be a good solution if u ony required to get the values.
If u wanted to maintain only 20 values then I suggest u go for fixed value mapping only.
Thnx
Chirag
Thanks so much for the links!
I managed to use and run the RFC lookup to an R3 table using JCo. However, I am not getting the right result.
I am getting the result in this format -> 800,PA,PAC,Package
The correct output is PAC which is the third node. Could this only be achieved by using java tokenizer?
The code that I have used is as follows:
Import com.sap.mw.jco.*;
//write your code here
String DBTABLE = a;
String WHERE_CLAUSE = b" = ""'"c"'" ;
String sapClient = "xxx";
String hostName = "nnnxxx";
String systemNumber = "xx";
String userName = "nnnnn";
String password = "******";
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( "SAPLookup", mConnection );
// Create function
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
input.setValue( DBTABLE, "QUERY_TABLE");
input.setValue( "," , "DELIMITER");
//Fill the where clause of the table
JCO.ParameterList tabInput = function.getTableParameterList();
JCO.Table inputTable = tabInput.getTable("OPTIONS");
inputTable.appendRow();
inputTable.setValue(WHERE_CLAUSE,"TEXT");
mConnection.execute( function );
JCO.Table valueSet = function.getTableParameterList().getTable("DATA");
String resultSet = valueSet.getString("WA");
mConnection.disconnect();
return resultSet;
Hi Raj,
Thank you for the snippet.
Btw, I found another method called split().
Here's the code that I have come up with...
...import com.sap.mw.jco.;java.lang.String.;
JCO.Table valueSet = function.getTableParameterList().getTable("DATA");
String resultSet []= valueSet.getString("WA").split("
,");
mConnection.disconnect();
return resultSet[2];
Hope you'll find it interesting as much as I did.
Regards,
Lex
Lex,
I really appreciate it! I will make use of Split function too! Thanks for sharing the knowledge. By the way in the snippet which I provided small modification, I forget to give the token ,
StringTokenizer st = new StringTokenizer(resultset,",");
Anyhow your code looks perfect. You can go ahead with that!
Thanks,
raj.
Hello,
for RFC Mapping lookups please have a look here:
And here is another thread about this topic:
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
Regards
Seshagiri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.