Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Context problem

hi all,

i have a problem regarding contexts.

for example i have an input:

A

B

C

context change

D

E

context change

F

context change

G

H

I

if i do collapsecontext, the output would be

A

D

F

G

but in my case, the output should be the last value of per context:

C

E

F

I

is this possible without using UDF?

Thanks all!

Former Member
Former Member replied

try this with a udf.

mapping:

source>reverse>collapse context-->target

UDF:

execution type:All Values of context

public void reverse(String[] var1, ResultList result, Container container) throws StreamTransformationException
{
int l=var1.length;
int i=0;
while(i<l)
{
	result.addValue(var1[l-i-1]);
	i++;
}
}

Thanks,

Anand

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question