cancel
Showing results for 
Search instead for 
Did you mean: 

Remove SUPPRESS from ResultList

former_member187447
Participant
0 Kudos

Hi

I have the following piece of code written to have multiple occurances of a target segment A based on a value of LFIMG of E1EDL24 source and also block the occurance if POSNR = 900001

LFIMG ->UDF---> Segment A

and

POSNR = 9000001 block segment A

UDF:

int counter = Integer.parseInt(var1[0]);

for(int i=0; i<counter; i++)

{

result.addValue(" ");

}

The problem or an issue is after the mapping is done it puts SUPPRESS at the end after all the contexts, so if LFIMG is 2, 3, 2 respectively in differnt Item segments. THe SUPPRESS is the result of blocking the segment for POSNR= 900001

[]

[]

CC

[]

[]

[]

CC

[]

[]

CC

SUPPRESS

My task is to use the output of this segment occurance in UseOneAsMany function to make sure the field in this segment has same number of occurances as parent segment(segment A), but the last SUPPRESS is considered by UseOneAsMany as another context , and it says context of first and second queue doesnt match in the error.

So, is there anyway to remove the SUPPRESS from the queue.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> So, is there anyway to remove the SUPPRESS from the queue.

I don't know any standard way.

It can be done with another UDF.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kalyan,

Try with the below UDF:


public void RemoveSuppress(String[] a,ResultList result,Container container){
for (int i=0; i<a.length;i++)
{
if (!a.equalsIgnoreCase(ResultList.SUPPRESS))
{
result.addValue(a);
}
}

Thanks,