on 06-16-2006 1:38 PM
Dear All,
I am working on an IDOC to file scenario. In my user defined function, I want to check whether a particular field of the idoc is populated. I can perform this test in message mapping by comparing the field with an empty constant.
How can I do the same test in an advanced user defined function? I have tried all the following, but none has worked so far
If (a.length == 0) .
If (a[0].length == 0)
If (a[0] == )
If (a[0] == )
Am I doing something wrong?
Thx/Farshad
To check whether an element is not available:
if (a.length == 0)
but you have to set cache to context. If you set cache to queue, it will not work, as in this case the context changes are part of the array a.
To check whether an element is empty:
if (a[0].equals(""))
Regards
Stefan
Message was edited by: Stefan Grube
Message was edited by: Stefan Grube
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fatin,
Before calling user defined function, first check that field exists. For this you can make use of "Exists" node function in the message mapping.
So with this you can use If-Else logic. Then give this output into your UserDefined function.
Because if you don't have a value, then Idoc will not contain that field so there will not be any xml tag generated for that field.
Hope this helps,
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
but you have the idoc field of not?
if so then try If (a[0] != null)
you can also try standard <b>Exist </b>function
from <b>Node functions </b>
if checks if the element exists or not
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.