cancel
Showing results for 
Search instead for 
Did you mean: 

File Lookup in PI

0 Kudos

Hi All,

Please help me to create the UDF for file lookup to fulfill the below logic.

We have some list of policy number,(200+) When the file arrived with that policy number I have to send the value 'FL' to target field. Policy number apart from that list am validating with BETALING Category field and updating different values.

Am thinking to keep the list of policy number in the .txt file in FTP and access through File lookup.

1. How to maintain the policy numbers? Should I use comma separator or some thing else?

2. How can I read this file over UDF? Please help me to create UDF, Bcoz am not strong on JAVA.

Already gone through this blog File Lookup in UDF - Process Integration - SCN Wiki

Please let me know if you required further details.

Thanks

Arun

Accepted Solutions (0)

Answers (2)

Answers (2)

juan_vasquez2
Active Participant
0 Kudos

You can try with value mapping, this is dynamic

http://scn.sap.com/docs/DOC-3706

you can transport records

it is configuration, you need not to modify design objects

RaghuVamseedhar
Active Contributor
0 Kudos

Arun,

If values do not change frequently maintain them in FixValues or UDF (200 if conditions).

If values change frequently try JDBC Lookup or RFC Lookup. File lookup will create concurrency and maintenance issues.

Defining JDBC Lookups Graphically - SAP Library 

0 Kudos

Hi Raghu,

Thanks for the response.

This is temporary workaround till testing completion. Source system can't agree for the changes immediately. So we decided to maintain the Policy number in txt file and lookup via mapping.

If we maintain 200 Policy number in UDF directly, will it produce any performance issue?

Please provide the sample code for the same.

Thanks

Arun

RaghuVamseedhar
Active Contributor
0 Kudos

Arun,

There will be no performance issue. You can use FixValues or below UDF (200 if conditions)


public String udf_myLookup(String in, Container container) throws StreamTransformationException{

  if (in.equals("ABC")) return "0001";

  if (in.equals("DEF")) return "0001";

  if (in.equals("GHI")) return "0002";

  return in;

}