on 05-12-2011 11:24 AM
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
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
first(remove(remove(remove(stringtolist(<SAPMEROUTERBO>,","), 0), 0,), 0) works fine for me
that is much more comfortable then creating string parts with dynamic string length and index of calculation
thank you very much
regards
Matthias
for example:
Transaction.sRouterRef=RouterBO:1234,144714-1,U,A-2
first(remove(remove(remove(stringtolist(Transaction.sRouterRef, ","), 0), 1), 1)) Result=144714-1
first(remove(remove(remove(stringtolist(Transaction.sRouterRef, ","), 0), 0), 0)) Result=A-2
first(remove(remove(remove(stringtolist(Transaction.sRouterRef, ","), 0), 0), 1)) Result=U
or:
first(remove(stringtolist(Repeater_0.Output{/responses/production:sfcRef}, ","), 0)) Result=Sfc
Sireesha,
below you will find the solution to read the listvalues. Please remember that the List starting with index 0.
Transaction.InputParamaterList{#For_Next_Loop_0.CurrentItem#}
BR
Pedro Iglesias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
7 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.