cancel
Showing results for 
Search instead for 
Did you mean: 

Removing NULL from SAP CPI mapping - context

das_sappo
Participant
0 Kudos

Hi Experts,

Please suggest how can I remove the NULL from the context ? tried couple of script but none working.

 

das_sappo_1-1712246005084.png

 

das_sappo
Participant
0 Kudos
thanks . still coming

Accepted Solutions (0)

Answers (3)

Answers (3)

Dinu
Contributor
0 Kudos

Dear @das_sappo,

Could you please explain why you want to do this. My understanding is that this, having NULL in the first row, is normal. You cannot remove it. It represents the previous value when the context changed. For the first change there is no previous value. So it is always NULL. 

Perhaps you should take a step back and look at why you thought it necessary to remove the NULL. 

See Set the Mapping Context | SAP Help Portal 

das_sappo
Participant
0 Kudos

das_sappo_0-1712250667981.pngdas_sappo_1-1712250714360.png

 

Andrzej_Filusz
Contributor
0 Kudos

Hello,

Could you try the following code please?

def void removeNullFromContext(String[] items, Output output) {
    items.each { String item ->
        if (item != null) {
            output.addValue(item)
        }
    }
}

BR,

Andrzej

das_sappo
Participant
0 Kudos
Hi Andrzej, still appearing