cancel
Showing results for 
Search instead for 
Did you mean: 

UDF centrally? is it possible

Former Member
0 Kudos

I have as many as 30 interfaces which will have to use the same UDF. So I have to create a new UDF in each Interface.

My question is is there a way that we can place this UDF centraly something like a Function Module or a Subroutine and call it or use it where and when require. Because, if tomorrow, if any small change comes for in the UDF... It is very laborious work we need to do.

I want to control this at ID level rather than IR.

So that I can control before the mapping itself.

Any thoughts please...

Thanks

Kiran

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

its avilable in new version PI7.1

stefan_grube
Active Contributor
0 Kudos

You can create a mapping template in a central SWVC. Here you define all UDFs that you need. Apply this template to all your mappings.

The only issue is: When you find a bug in an UDF, you have to fix this in all mappings, that use the UDF already.

But a combination of external classes and UDF in mapping template should help for 7.0.

Regards

Stefan

Former Member
0 Kudos

Hi Kiran,

I am fine ...

An Idea for your post ---> <b>If your set of source & target values are fixed</b> then you can do as follow,

1. As per your requirement you can go for Value mapping . in your mapping by using value mapping function you can retrieve the corresponding values from source to target in all of u r sceanrios.

2. If you dont want to use the value mapping,Create a Z table and maintain the source and target values in that table.While population of Idoc( User exit of the transaction which is using for populating the Idoc) u need to do the validation and get the corresponding value for your source to target from the table and modify the Idoc field with the value from table.So that in all of u r mappings its just one to One mapping.

Hope it will helps to you..

Cheers

Veera.

Former Member
0 Kudos

Hello!

> My question is is there a way that we can place this UDF centraly something like a

> Function Module or a Subroutine and call it or use it where and when require.

The best approach is to put logic which is needed in several UDF in separate java classes as imported archives.

Within the UDF there would be no logic but you'd just call the logic in the imported archive classes using something like:

return MyClass.myMethod(parameter);

That way all the UDF share the same function and you need to make changes only in the class in the imported archive and not in all UDF.

Regards, Tanja

Former Member
0 Kudos

Hi,

What you can do is write a Java code and import it into one common SWCV. Now this java code will be accessed from any of the software component version.

Now pass the value to this common java code from the interface and this common java code will return back the result to your interface.

For example:

1)First import the package inyour UDF which will be calling the common java code.

2) pass the value to the common java code.

For example:

public boolean file(String InterfaceID,String FileName)

file is the class which is written in common java program and the interfaceiD and fileName is the value which are passed to common java code.

I think this will resolve your problem.

Thanks and Regards,

Chirag Gohil.

Former Member
0 Kudos

Hi Kiran,

What is u r exact requirement, what is the common functionality for all 30 interfaces u want to fullfill by writing the UDF. Provide some more details on this for more ideas ..

Cheers

Veera

Former Member
0 Kudos

Hey veera,

How are you?

My requirement is: Actually an IDoc to File Scenario.

I already posted in my earleir post and however expalining the same again here....

I will have set of faulty numbers in Idoc and each number shall be identified and shall be replaced with another number and put them into FILE.

So I had a code for this in UDF and using it.

Till here, its working fine.

But this functionality is to be put into as many as 30 interfaces. Thus I am seeking for some clues to know if any coding can be handled centrally in ID area. MIND not in IR because, I saw ajays explanation to import .jar files. But this way, i am again creating UDF in each interface which I want to avoid.

Hope am clear in expressing.

Please let me know your thoughts.

Thanks

Kiran

Former Member
0 Kudos

Hi Kiran

Yesterday I post the same doubt.

Regards,

Carme

Former Member
0 Kudos

I have an idea of the way Ajay gave you.

But as I said, I want to control in ID rather than IR

Any Clues?

Kiran

Former Member
0 Kudos

No you cannot write UDF in IR or ID that u can use want to use in n numbers of interface. TIBITs itself says that UDF is limited to the Mapping Programes in which it is created...so no chance till PI 7.0...that u write one and use it anywhere:-)

Thanks

Farooq.

Former Member
0 Kudos

It is possible from 7.1 but not 7.0 or before.

Former Member
0 Kudos

hi barry,

very interesting. can u throw more light or provide any reference document containing this info?

regards,

latika.