on 01-12-2007 9:35 PM
Hi !
I have to map one TXT file to an IDOC. One field of the source file is needed to define values of several IDOC target fields.
I've developed an advanced java UDF that receives the source field, calls an RFC via JCO to convert the source value, and returns the converted value.
Then I use this UDF as part of the graphical mapping, to define the values of about 10 or 15 fields of the IDOC. That is, the UDF is placed 10 or 15 times, one time for each target field.
My doubt is if this an expected way of solving this kind of problem..I'm worried about calling the UDF (RFC via JCO) about 15 times for each source file record...and they could be 1000 aprox !
I've added a trace, and a global variable, and inside the UDF, I check if the current input value is equal the last processed value, if it is that case, then I return automatically the buffered value (in a global variable), avoiding the call to RFC....
Checking my trace...I see that the UDF is called with several different input values in some random order, so my "optimizacion method" does nothing.
Some ideas?
Thanks. Have a nice weekend.
Hi Matias,
we had a similar problem, and we solved it using a java has table stored in the global container.
During the mapping program, every time a new source-value has to be look up, that value becomes a new key of the hash and the result of the RFC call (target-value) is stored in the hash table as the value corresponding to that key.
So this avoid the problem of random calls with different values and you can read from the hash table if a value already exists in the hash table before calling the lookup RFC.
We implemented this solution and it works like a charm
Hope it helps,
Kind Regards,
Sergio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My idea would be following: Write a UDF which gathers all values that have to be looked up from R/3. Asign this UDF to the target root node to make sure that this UDF is called at the beginning of the mapping.
Then you need an RFC which is able to look up all values at once. It might happen that a need a wrapper RFC for the standard. The valus are stored in a container and can be read when they are needed from a second UDF.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if the input value and RFC returned values are fixed, you can go for value mapping instead of calling jco for every call. I mean its like set of input values you going to map with set of output values. Check whether you can use value mapping instead of RFC calls.
--Archana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.