cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging a mapping program

Former Member
0 Kudos

Hi Experts,

is it possible to analyze a specific UDF written in Graphical-Mapping program? like in abap we use F5,F6 and F7 for step by step analysis... (i.e what is the input entering into perticular field and at each step we can see what the value that is getting populated into each field)????

What is the difference between setting different trace levels in message mapping (in the test tab)... please tell me the exact difference..._please don't give the normal definitions of using trace levels_...

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

You can use code like


MappingTrace trace = container.getTrace();

trace.addInfo(put your variable)

raj.

Former Member
0 Kudos

HI Raj,

Thanks for the immediate reply...but where exactly I have to write this peace of code? I was asking about step by step analysis of UDF (i.e. java code)..please tell me if u know?

Thanks,

Shabbeer

justin_santhanam
Active Contributor
0 Kudos

Hi,

Consider the below piece of code


for(int i=0;i<LineItem.length;i++)
{
for(int j=0;j<Record.length;j++)
{
result.addValue(Record[j]);
result.addContextChange();
}
}

You want to know what's the value for Record[j] or LineItem<i> in the loop, so you can write the code as


MappingTrace trace = container.getTrace();

for(int i=0;i<LineItem.length;i++)
{
trace.addInfo("LineItem["+i+"] ="+LineItem<i>);
for(int j=0;j<Record.length;j++)
{
trace.addInfo("Record["+j+"] ="+Record[j]);
result.addValue(Record[j]);
result.addContextChange();
}
}

Then you can use Display Queue or execute the mapping program to see what value is being populated.

raj.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Shabbir,

analyze a specific UDF written in Graphical-Mapping program? like in abap 
we use F5,F6 and F7 for step by step analysis

there is no direct debugging available like in any IDE where you can see the step

by step code.

However you have following options:

1. Adding the mapping trace code in your udf as explained by Raj, wherever you

want to a check value , use your own text indicator to print the log and u can print

the values coming at each step.similar way which we do in normal checks for

java code i.e printing out values wherever required.

after putting the required trace, go to test tab and select debug level on internal trace to debug

.In the processing log you can see the trace value you have set.

2. You have Display queue option , if you right click on the mapped Object you

can see the values coming in and going out of that object .

Regards,

Srinivas

Former Member
0 Kudos

Hi Srinivas,

Thanks for ur answer.

Can u please tell me what is the exact difference in putting the different trace levels in Test tab.

If I put ( Debug, info and al ) as the trace levels, I can see the same result i.e. I can see that what is the value entering into the fields.

please let me know the difference in putting different trace levels????

Former Member
0 Kudos

Hi Shabbir,

If I put ( Debug, info and al ) as the trace levels, I can see the same result 

Warning will display what you have written in addWarning() method.

Info will display what you hjave written in addInfo() method.

Debug will display what you hjave written in method.addDebugMessage() method.

All will display all trace messages .

For more details refer these links

[Trace Level |http://help.sap.com/saphelp_nw70/helpdata/en/3b/c18c4037fba62be10000000a1550b0/content.htm]

[MappingTrace Object |http://help.sap.com/saphelp_nw70/helpdata/en/c8/98e7d5c1620642973565ea3dd319d1/content.htm]

Regards,

Srinivas

Former Member
0 Kudos

Got posted multiple times ...pls see below..can be removed