Skip to Content
author's profile photo Former Member
Former Member

UDF centrally? is it possible

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2007 at 10:04 AM

    It is possible from 7.1 but not 7.0 or before.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2007 at 10:15 AM

    Hi Kiran

    Yesterday I post the same doubt.

    User defined function and different namespaces

    Regards,

    Carme

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2007 at 11:32 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Oct 31, 2007 at 09:19 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 31, 2007 at 09:47 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 31, 2007 at 10:50 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 11:24 AM

    its avilable in new version PI7.1

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.