on 02-21-2012 9:08 PM
HI Folks,
I am working on a graphical mapping and I am using a global container to write all my traces say trace.addInfo("Line 1"); trace.addInfo("Line 4"); etc etc
Now I want to retrieve the trace information and return them as a string or an array of string to another field/fields.
Can anyone suggest how can I write that abstract trace(which we can see while executing the mapping in test tab) information into a field ???
Thanks,
VK
Example as below...
TheContainer object supports the following methods:
- GlobalContainer getGlobalContainer(): creates GlobalContainer
- AbstractTrace getTrace(): creates an AbstractTrace object
-AbstractTrace at = container.getTrace();
at.addInfo( "This is an information" );
at.addWarning( "This is a warning!" );
at.addDebugMessage( "This is a debug message" );
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Sorry, I couldnt correlate your answer to my question.
My Question is there is already one abstract trace with some information in it.
I want to retrieve it and write it to a string or array of strings and then return it using return "X"; or result.addValue("X");
Can you please suggest something so that I can retrieve that abstract trace information and use it in place of X ????
Thanks & Regards,
VK
HI,
from the sentence mentioned by Ravi,
"populate the global variable with the same data"
This itself is my requirement where the data is already sitting in the trace and I cannot go back to populate the same thing in new variable but my requirement is to pull the data from the trace itself.
So my question is if this is possible?? Can I pull the data from the abstract trace where I have been adding in some information while mapping other field!!
Thanks,
VK
Yes, Buddy!!
I dont think that is possible and infact the trace.**** are all just related to input/output streams to print data but you cannot retrieve and there is no method for the same.
So, I guess I have to change my requirement itself a bit and I have to modify the code which is writing data to the trace.
I still expect something on this from lot of Java gurus out there!!!!
Thanks & Regards,
VK
Hi.
You can use Global Variable, as wrote.
Save trace info in this Global Variable and use it.
See http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1352
BR.
Edited by: ChizzT on Feb 24, 2012 12:53 PM
HI Everyone,
Let me make my question simple:
I am not looking for something at the stage of writing data!!
Let us assume I dont have any chance to edit it!!!
My requirement is that if the data is already there in the trace, can we retrieve it ???
When we write data into abstract trace we can see it when we execute the mapping (Just a java i/o stuff).
but I want to retrieve the data from abstract trace in some field mapping!!!
Hope this explains my question!!!
Thanks & Regards,
VK
Declare a global variable(Array of strings) and populate it with the same value that you are using in addInfo function ( i presume that you are using a UDF).
Later you can refer to this global variable to map to any other field (Using another UDF).
Best Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
My requirement is not to create any new stuff.
My requirement is to use the already existing abstract trace which holds several lines of information.
While executing the mapping the abstract trace displays all the lines like line 1, line 2 line 3 -
But I want to retrieve that information for the mapping for another field!!!!
Can you suggest something for this?
Thanks & Regards,
VK
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.