cancel
Showing results for 
Search instead for 
Did you mean: 

UDF Code

Former Member
0 Kudos

hi all,

i am doing udf code,my requirement is like this

statecode state name

1 a

2 b

3 c

4 d

5 e

here state code is the input for udf,based on the state code input,i need to retrive the state name as an output for the udf.

two coloumns are seperated by tab(these two fields are maintaining in the file,here i need to do the lookup).

for the above requirement give me the udf code.

thanks in advance,

AVR

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi all,

solved my problem.

Thanks,

AVR

Former Member
0 Kudos

Hi,

these two fields are maintaining in the file,here i need to do the lookup

could you let us know where are you placing the file?

If its a business requirement and you are not doing for just testing out something, i strongly advocate not to go for any file lookup.

Yes we can read the file but its always not secure and reliable as its dificult to maintain the FTP (it can be deleted or archived).

use a value mapping instead which will be good to maintain and can be changed going forward in different environments.

Regards,

Srinivas

sunilchandra007
Active Contributor
0 Kudos

Hi,

Try this one !!!

return Character.toString((char)(Integer.parseInt(a) + 96));

Regards,

Sunil Chandra

Former Member
0 Kudos

Hi

Be clear whehter your state values are Fixed or dynamic. If its a Fixed/Static tehn use Fixbyvalue function, else go for File Lookup.

http://wiki.sdn.sap.com/wiki/display/XI/FileLookupin+UDF

Regards

Ramg.

Shabarish_Nair
Active Contributor
0 Kudos

dont use a UDF.

Either use standard function like Fixvalues or then use value mapping.

do search in the forum to understand these options. there are plenty posts that will help you.

madhusudana_reddy2
Contributor
0 Kudos

Hi AVReddi,

Use FixValues function which is available in Graphical mapping. Maintain the values in FixValues table like source as state code and target as state name. Give that FixValues node function as input to UDF. This is very simple.

thanks,

madhu