cancel
Showing results for 
Search instead for 
Did you mean: 

Using IF deprecated condition in BPM

yasha_dubey
Participant
0 Kudos

Hello All,

I have to filter ORGID based on Qualifier and populate target node. Here I am getting list values and this has to be done in BPM mapping.

I tried to use IF deprecated which works with List values and not just individual String but I get error.

I tried to use Generic function Filter which filters based on condition, but it gives me run-time error.

Mapping failed

java.lang.IllegalArgumentException: Filter criteria could not be parsed: 008

com.sap.mapping.lib.execution.api.exception.TExecutionException

at GenericFilter( StandardInvocation:invoker )

Any idea how can I achieve it ?

Thanks,

Pragya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pragya,

what is the filter expression that gave you the error?

your filter expression should look like this:

get(filterDO_Request_IP/IDOC/E1EDK14, "QUALF=008"),1)/ORGID

Regards,

Ahmed

yasha_dubey
Participant
0 Kudos

Hi Ahmed,

Thanks for the response. I was using flter wrongly here. Since I have a list of Qualf, I dont know which index would have 008. So I can't use the above expression in my case.

Please let me know if there is a way to get the orgid based on qualf = 008. However I have a list of values abs I dont have the index. I need to determine it at runtime

Thanks,

Pragya

Former Member
0 Kudos

Hi Pragya,

the below expression does the filter with the QUALF value first, before getting the first item in the result. the filter function does the filtering based on the value not the index, it should work for you. after applying the filter with the filter function, then wrap it in a get call to get the first item in the result, which should be your element.

get(filterDO_Request_IP/IDOC/E1EDK14, "QUALF=008"),1)/ORGID

Regards,

Ahmed

yasha_dubey
Participant
0 Kudos

Hi Ahmed,

Thanks for the input. Please correct me if I am doing it correctly. I need the corresponding value from ORGID where QUALF = 008.

So , as suggested I am using below expression but I get the following error.

Expression :

get(filter(DO_Request_IP/IDOC/E1EDK14/QUALF, "008"),DO_Request_IP/IDOC/E1EDK14/ORGID)

Former Member
0 Kudos

Hi Pragya,

the expression you wrote has two issues:

1- the get function second parameter should be an index.

2- the filter function second parameter should be a filter expression not a value.

please use the below expression, and let me know if you are still facing any issues

get(filterDO_Request_IP/IDOC/E1EDK14, "QUALF=008"),1)/ORGID

Regards,

Ahmed

yasha_dubey
Participant
0 Kudos

Hi Ahmed,

Thanks.

I used the expression given by you. I don't get any syntax error now.

I did a test run, but now I get a mapping exception for the field I have mapped. Although in the input I have the value for QUALF = 008, but continue to get below mapping error.

Mapping failed

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

com.sap.mapping.lib.execution.api.exception.TExecutionException

at GenericGet( StandardInvocation:invoker )

at ( DeepExpression )

at Reason3( TerminalPart:expression )

at ErrorMessages( BroadPart:child )

at errors( BroadPart:child )

at result( BroadPart:child )

at errorResponse( BroadPart:child )

at Body( NarrowPart:child )

at http://schemas.xmlsoap.org/soap/envelope/:Envelope_Error( NarrowPart:child )

at ( NarrowMapping )

Expression used :

get(filter(DO_Request_IP/IDOC/E1EDK14, "QUALF = 008"),1)/ORGID

Thank you for all the help so far.

Former Member
0 Kudos

Hi Pragya,

I'm sorry my bad, the list in BPM is 0 based index.

please use the below expression, and this should work fine

get(filter(DO_Request_IP/IDOC/E1EDK14, "QUALF = 008"),0)/ORGID

regards,

Ahmed

yasha_dubey
Participant
0 Kudos

Thanks a lot Ahmed.

The issue is resolved, else I had to use mapping and other complicated expressions to achieve this.

Many thanks!!!!

Pragya

Former Member
0 Kudos

You are most welcome Pragya

glad to know that your issue has been resolved.

Regards,

Ahmed

Answers (1)

Answers (1)

Former Member
0 Kudos

So if I understand you correctly, you get a list of ORDID and want to map them to another node.

In this case the filter function is the way to go. Based on the error you get, it seems that the the filter condition has the wrong syntax.

It has to be a valid expression that evaluates to true.

To give you a better answer I'd need additional information. E.g. how does the content of the list look like, is it a structure or just simple values? What is the condition you want to check? How does the target node look like? How does your expression look like?

Best regards,

Frank

yasha_dubey
Participant
0 Kudos

Dear Frank,

Thank you so much for taking out time and replying on the issue I am facing.

My source structure looks as below :                                        Target Structure

-- E1EDK14 (0...12)                                                  ----Error Message (0.1)

    --QUALF (0.1)                                                            ---Reason1 (0.1)

    --ORGID (0.1)

Here I want REASON in the target to have the ORGID with Qualf 008

The issue is the source is a list with multiple occurrence and target is a single value.

If I use below expression, it gives error ; expected xsd:string found list.

IF(DO_Request_IP/IDOC/E1EDK14/QUALF = "008", DO_Request_IP/IDOC/E1EDK14/ORGID, " ")

Is there a way I can push list values to single ones. Even if this is possible my problem will be solved.

I will check the conditions in the later mapping which is called in SAP PI.

The biggest challenge for me here is to map list to single value.

Thanks,

Pragya

junwu
Active Contributor
0 Kudos

put a mapping activity in your flow, which will be used to loop the collection, you can put that "if" statement in the mapping

how many 008 element will be in the collection? if maximum is one, it will be easy. if not, you have to do the concatenation.