cancel
Showing results for 
Search instead for 
Did you mean: 

populate target only if source field have same value in all items

Former Member
0 Kudos

Hi,

I have a field BSTNR at Item level in the Idoc (E1EDL20 - E1EDL24 - E1EDL41 001- BSTNR). I have a requirement where I should populate the target field only when all the Items have same BSTNR value. E1EDL24 will be repeating. Can this be done using graphical or is UDF required and how

Thanks

Varun

Edited by: Varun Reddy on Jul 14, 2011 2:43 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can do this very easily using UDF :

use a queue to iterate through the array. check if the first element equals all the subsequent elements. If a o match is found, it means all BSTNR do not have the same value.

without UDF try this :

BSTNR (keep context at highest level) >sort>splitByValue(Value Changed)>collapseContext>removeContext>count>EqualS (check if equals 1)-->createIf -->target field

the idea is to sort and then collapse the values. If all values are equal, you will be lest with on;y one value in the queue.

Regards

varun_k
Contributor
0 Kudos

I tried using context functions but didnt think of count function....

Thanks

Answers (0)