cancel
Showing results for 
Search instead for 
Did you mean: 

production issue -help needed

Former Member
0 Kudos

Hi,

I am giving a user-defined java code below, which we need to change. I understod that the fucntion is used to store values in memory. But my doubts are something else.

-


GlobalContainer gc = container.getGlobalContainer();

AbstractTrace trace = container.getTrace();

int j = 0;

for (int i = 0; i < ConnectEAN.length; i++) {

if (ConnectEAN<i>.equals("__cC_")){

j++;

if (PremiseID[j].equals("__cC_")){

j++;

}

} else {

trace.addInfo("EAN = " + ConnectEAN<i> + " Prem = " + PremiseID[j]);

gc.setParameter( ConnectEAN<i>, PremiseID[j] );

}

}

result.addValue("");

-


I need to know what ' equals("__cC_") ' means.??? whats the underscore doing there??

Also what does the below line doing?

trace.addInfo("EAN = " + ConnectEAN<i> + " Prem = " + PremiseID[j]);

Why do we need to add info to the trace? whats is its concept?

Please help.

Thanks,

John

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi John,

trace.addInfo("EAN = " + ConnectEAN + " Prem = " + PremiseID[j]);

This object enables you to transfer messages to the mapping trace. If the trace level is set correspondingly. then the trace is visible in message monitoring (transaction SXMB_MONI). The execution of the mapping is not interrupted when the entries are written to the trace.

so go to SXMB_MONI expend the tree and go to trace you can fond the corrosponding trace out there.

Trace object have the following Methods

1)void addInfo(String message); Adds a message message to the mapping trace with the trace level info.

2)void addWarning

(String message); Adds a message message to the mapping trace with the trace level warning.

3)void addDebugMessage (String message); Adds a message message to the mapping trace with the trace level debug.

regards,

navneet

Former Member
0 Kudos

Hi,

thank u for the answer on trace.

I als want to know, as to whats the meaning if you write "_CC_" inside the equals function?

equals("__cC_").

Does it have a special meaning?

Former Member
0 Kudos

Hi,

It means you are comparing the input string with the string _cC . if the input field has value _cC then only come inside if condition else the code inside if condition won't be executed.

Please see it is case sensitive. Only if the first alphabet is _ , second is small c and third capital C, this condition will be satisfied.

Hope this cleares your doubt.

Thanks

Amit

Former Member
0 Kudos

Hi John,

the UDF has an inputParameter named: ConnectEAN

The ConnectEAN is an StringArray. This means it has one or more entries.

Before this UDF was called another UDF - that you havent mentioned - was called.

This UDF wrote entires to the globalContainer, also in kind of a list with one or more entries.

The UDF you mentioned just reads the amount of ConnectEAN and PremiseID

and writes it for information into the trace.

Regards Mario

Former Member
0 Kudos

Hi,

You forgot to answer my question.

i only asked two questions.

1. whats the concept of writing something to trace.?

2.whats the meaning of writing "_CC_" inside the brackets of the 'equals' function?

Thanks,

John