cancel
Showing results for 
Search instead for 
Did you mean: 

Empty line needs to be removed,

Former Member
0 Kudos

Hi Experts,

I found out while testing one of my mappings that , in a queue, the output had a value as follows

input output

[ ] [ ]

11121 1235iuyu7.

The issue is I am unable to remove the first line and take the secound line , as a result of which the target is poplated with no value.I have tried split by Value and Remove context, but still unsuccessful.

I tried writing a UDF type QUEUE and trap it , but couldnt go much further, as I am not good in java.

Suggestions from experts awaited.

Regards,

Arnab.

Edited by: Arnab Mondal on Jul 4, 2010 3:53 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

you can use standard function for this.

A combination of equalS, constant (blank) ifWithoutElse will do.

See my blog:

/people/stefan.grube/blog/2006/01/09/the-use-of-suppress-in-the-xi-30-graphical-mapping-tool

Former Member
0 Kudos

hi Arnab,

You can try adding the suppress if empty value is coming it will not propagate to target,Try the following UDF if it helps...

for (int i = 0; i < input.length; i++) {
if (input<i>).length() = 0) {
  result.addSuppress();
}

see if it helps...

Regards.

Srinivas

Former Member
0 Kudos

I tried this code, but it is again giving some error.

Declaration as input type string and execution type as : all values of queues.

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

{

if (input<i>.length() = 0 );

{

result.addSuppress();

}

}

The error is coming for the line if (input<i>.length() = 0 );

error is :

Check Result for Object MM_WebServiceResponse_Mail

Source text of object Message Mapping: MM_WebServiceResponse_Mail | urn:xxxxxxxxxx:SharedAcknowledgement has syntax errors:

Function Remove_Blank_Context, Line 6:

unexpected type required: variable found : value if (input<i>.length() = 0 );

^

Note: /usr/sap/PID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map38c1982b87fe11dfc155000000830fc2/source/com/sap/xi/tf/_MM_WebServiceResponse_Mail_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/sap/PID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map38c1982b87fe11dfc155000000830fc2/source/com/sap/xi/tf/_MM_WebServiceResponse_Mail_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error

Kindly suggest , where am I getting wrong . !!

Former Member
0 Kudos

hi

unexpected type required: variable found : 

Add declaration for input in the beginning,

string input="";

Srinivas

Former Member
0 Kudos

Hi,

your UDF should have input as string array, so your UDF should have string input[];

moreover in if condition use i == 0

Regards,

Rajeev Gupta