cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Hash Map/Hash Table as global in a mapping

jegathees_waran
Active Participant
0 Kudos

Hi Friends,

I have one requirement. It needs to lookup a custom table in ECC for  Legacy Customer Number to SAP Customer Number through RFC lookup in PI. Now, the input file contains huge amount of records. Many of the records have same Legacy Customer Number.

To reduce the no.of look up calls to ECC , we think that take the unique Legacy customer number from source and call the RFC, pass these entries at one call. The RFC will return the Legacy Customer Number along with SAP customer Number. This works fine.

But, this RFC should be executed only one per file. i.e Store the result values (Legacy Customer Number, SAP Customer Number) in Hash Map (or) Hash Table before mapping starts.

Then during mapping execution, for each record, it will refer the Hash table to get the SAP Customer Number.

If we pass the RFC return results as array to UDF and inside UDF, define the Hash table and store the result, once return from UDF, will that hash table be removed from memory? that is my doubt.

Now, my query is 1) How to make the Hash Table as global  2) How do we refer Hash table when each record is executed in the XML.

Could you please clarify?

Thanking you.

Kind regards,

Jegathees P.

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>1) How to make the Hash Table as global

define the hashmap in the init section of the mapping

>>>>2) How do we refer Hash table when each record is executed in the XML.

in the normal way if you define it in the init section

Regards,

Michal Krawczyk

jegathees_waran
Active Participant
0 Kudos

Hi Michal

Thank you very much for your reply.

I will try this option how it works.

If you have any code snippets about storing data in Hash Table and retrieving data from Hash Table, kindly share.

Regards,

Jegathees P.

former_member10771
Active Participant
0 Kudos

Hi,

Can you please tell me how did you proceed with the requirement. i have a similar requirement.

Former Member
0 Kudos

Hi amit,

Could you please elaborate your requirement?

iaki_vila
Active Contributor
0 Kudos

Hi Narayanareddy,

You can check the Amit problem in his thread

Regards.

former_member10771
Active Participant
0 Kudos

I have a requirement similar to what you have posted above. If you could tell me the approach or the code snippet of hash table as to how you have done the coding it would be helpful.

former_member10771
Active Participant
0 Kudos

Hi narayanreddy,


Can you please let me know how did you achive this

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jegathees,

Hope you have implemented  the logic.

I had the similiar requirement where i need to fetch the data from jdbc table and pass on to target structure.

Could you please help me with steps to be followed for hash map table and also help me with the code.

Thanks

narayanareddy b