Skip to Content

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

Fetching the value in a list for a given index position

Hi All,

I have a Transaction.InputParamaterList of type list

InputParamaterList : [[string:Parameter1], [string:Parameter2], [string:Parameter3], [string:Parameter4]]

Now i need to loop through the list, so ill be using size (InputParamaterList ) and i need to get the value from a list by specifing its postion.But there was no built in function to acheive this for example if position=2, then it should return Parameter2.

Please let me know if any one knows how to achieve this.

(I am using SAP MII Version 12.1.8 )

Regards,

Sireesha

Former Member
Former Member replied

Hi Sireesha

I was also suprise not finding an expression to get value from the list. However I think I got a solution to your problem.

So based on your example:

InputParamaterList : [string:Parameter1, string:Parameter2, string:Parameter3, string:Parameter4]

To get value of item2, you need to remove item1 from the list and then get the first item (but firstly create a local variable to store your transaction variable).

The expression will be first(remove(InputParamaterList,0))

This mean if you need to get value of item 3 you need to remove 0 two times. The expression will be

first(remove(remove(InputParamaterList,0),0)

Maybe there are better way to do it...

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