on 07-31-2006 8:23 PM
Hi Everyone,
We are doing some RFC Lookups at a header node that are returning tables for all of the items (for performance reasons). I am trying to figure out what the best way to extract the values from the table, which is most of time has more than 1 key column. At the moment I am doing this through DOM, but I have also heard about using arrays, and have even seen an example of using a hashtables with all of the values concatenated together to later parse out using substrings. I'm looking for the best approach to:
1) Store this data as some kind of global object to lookup during the header
2) Search and Parse from the global object during linte items.
As an example, I have the following lines in my table:
Key1,Key2,Value1,Value2,Value3
A,A,1,2,3
A,B,1,2,4
A,C,3,4,2
B,A,2,4,6
And during line item processing I may want to find the value for Key1=A, Key2=C.
Thanks
Peter
Peter,
There are 2 options. Use DOM parser like you have or use a SAX parser.
If the XML structure ( Response XML strucutre ) is not too large, then using a DOM is a simple and an effective option. But, in case, the Response XML is going to be too big, using SAX would be a better option.
Just remember that DOM loads up the whole strcuture into the memory and so, if it is to big, a memory overflow exception can occur while SAX is a memory less parser, it is a bit more complex and back tracing over your XML tree is not possible.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In scenarios wherein you have to import N number of fields and then use them in different fields of different segment. In this case it is better to make one call to the R/3 system at node level and keep the data in the global variable and then use it during mapping rather then making a call at every field level.
The hash structures will help you keep the data structure (table) and can be used repeatedly if required.
Regards
Vijaya
Hi Peter,
Please take a look at these...
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
cheers,
Prashanth
P.S Please mark helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.