on 11-26-2014 7:41 AM
Hi All,
My RFC Look up is working fine. I need to store the values returned by the look up in PI. I was thinking of this hash table concept which I read in a few blogs. Can someone please let me know how we can achieve that using hash table concept. For a given input I have array of values for different country codes. How can I store the returned arrray of values using hash table.
Hi Amit,
May be I'm wrong but i think you want to use an RFC lookup with different concept that it was created. A RFC/JDBC/etc lookup has its functionality to get parametrization parameters, mainly to avoid to set them in the mapping manually or in case of a larger number of them in the ID. If you want to get data to be stored later, you will need to do an scenario to do this using a bridge or calling for example the JDBC/RFC/etc adapter to store the data in the table that you want to be hashed.
I think, Indrajit Sarkar has thought your probably problem, to get some data and to use them in output of a synchronous scenario (Also you have this option )
If you share your whole scenario, the SCN members could help you better, because from my point of view is a bad idea to have parametrization parameters replicated in two places.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
I think you should first to work with hashtables outside PI, you can try some examples in NWDS or a normal eclipse, later you can try to set the code in PI like a PI java library or to set in the java section in a mapping, all depends what you want. You can try with this example: 10 Example of Hashtable in Java – Java Hashtable Tutorial to start with this.
Regards.
Hi Inaki,
I have gone thru the link provided . I will first try to store the value received by the lookup.
Under Attributes and Methods I have declared a global variable
String globalString[] = new String[];
I am writing this UDF for filling the hash table. I am getting two values as a output from the look up. I am first trying to store them. Please check and let me know if this UDF is correct .i referred some UDF and modified it some what. But I am not getting the values from the RFC . Actually i have array of values.
import java.util.Hashtable;
public void savevalue1(String[] value1,String[] value2,ResultList result,Container container){
Hashtable htvalue1 = new Hashtable();
int Indx = 0;
for (int i = 0 ;i < value1.length ; i++) {
String strvalue1 = value1<i>.trim();
{
Object obj = htvalue1.get(strvalue1);
if (obj == null){
globalString[Indx++] = strvalue1 ;
htparam1.put(strvalue1,strvalue1);
}
}
}
if (Indx < globalString.length) {
for (int i = 0; i < value2.length ; i++) {
String strvalue2 = value2<i>.trim();
{
Object obj = htvalue1.get(strvalue2);
if (obj == null){
globalString[Indx++] = strvalue2 ;
htvalue1.put(strvalue2,strvalue2);
}
}
}
result.addValue(globalString[0]);
Hi Amit.
If you want to use an ABAP table the INSERT functionality will be in ABAP code, you can use a RFC or proxy to do this. What is your whole scenario?, is the scenario receiver the RFC lookup data destination?
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Inaki,
As of now we are doing a demo scenario to check how the values returned can be stored in PI. I am doing a single RFC call to send multiple inputs and get multiple outputs in a single call. The data returned from RFC call has to be stored in PI. Can we achieve this using the hash table concept.
THanks Indranil . I am trying to achive something on similar lines using this blog.
Actually the output I am getting is something like this from RFC look up in two fields.
IN INDIA
CH CHINA
HK HONGKONG and so on there are close to 100 values .
I want to store them using some logic like the below blog. Can you please let me know on that
http://wiki.scn.sap.com/wiki/display/Java/Using+Edit+Java+Section+in+Message+Mapping
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.