cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing table from Message mapping

Former Member
0 Kudos

Hi,

I am developing an File to proxy scenario.

Here, I need to access some data from the UDF of message mapping as depending on master data stored in the table I need to do some validation in the message mapping.

Is it possible to do ?

If yes then how to do it ?

Accepted Solutions (0)

Answers (3)

Answers (3)

Bhavani_Baisani
Participant
0 Kudos

As gagandeep discussed you can use look ups then you can acheive your requirement

Former Member
0 Kudos

Hi Apu,

Yes..you can do by using UDF.

If you are using JDBC look up, by following below steps you can achieve.

Steps:

You have to create jdbc channel to connect database system

In UDF you have to write select query according to your requirement

write code to connect database table,execute select query and to map fields.

Below are few methods which will help you to connect database,execute select query and to map fields.

//Determine a channel, as created in the Configuration

channel = LookupService.getChannel( BUSINESS_SYSTEM, "JDBC channel name to connect database");

//Get a system accessor for the channel. As the call is being made to a DB, a //DatabaseAccessor is obtained.

accessor = LookupService.getDataBaseAccessor(channel);

//Execute Query and get the values in resultset

resultSet = accessor.execute(Query);

for(Iterator rows = resultSet.getRows();rows.hasNext();){

Map rowMap = (Map)rows.next();

  1. result.addValue(fieldnameindatabasetable= String.valueOf(rowMap.get("field name in your mapping")));

Regards,

Neelima.

gagandeep_batra
Active Contributor
0 Kudos

Hi Apu,

It depend on the table where it is store?

you can go for RFC lookup or JDBC lookup based on  table where it store

Regards

GAgan

Former Member
0 Kudos

Hi Gagandeep,

Thank you so much for your reply.

I have a master table in SAP ISU from which I need to access data.

gagandeep_batra
Active Contributor
0 Kudos

Then i think  you have to go for RFC look up check below

http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/01/28/graphical-rfc-lookup-and-how-you-...

Regards

Gagan