Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

"Java sections" + UDF -> How to call a UDF from Initialization Section?

Hi all,

I have a UDF that makes an RFC Lookup to get some parameters from ECC. Some of these parameters are used in many different fields. So, to not call the UDF with RFC Lookup to the same parameter many times, I create a global variable at "Java Sections" and would like to load this variable on the Initialization Section, like this

myVariable = myUDF("param");

But the "myUDF" is not found using by this way.

The "natural" workaround would be to make a mapping to the root node of target message setting the value to the Global Variable, but if some of you know how to call UDF's directly at the Initialization Section I think it could help in other more complex scenarios.



Former Member

You cannot call a UDF in the Java Section.

One simple and better workaround though -

1. Create a Java Class that does your RFC lookup . You would need to define method in this class that Performs the lookup and return the appropriate data to you.

2. Import this class in the imported archive.

3. In the java section call this class, by creating an object for this class and get the required output from the class.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question