on 09-15-2009 6:02 PM
Hi guys,
I am working on IDOC to File scenario where I need to pass empty value for each field we map.. I see in IDOC there are no segments at all and for such I am unable to send any value to the file..
Eg: Field1,Field2,Field3
I am getting in File as : A|B
A if there are no values for B and C
But it should be A| | If there are no values for B and C.
How could I make it?
Thanks
Rajeev
Hi Rajeev,
For all the fields in your mapping, use mapwithdefault funciton. Double click on the function and put space there. So if the field is present field value will be populated, if the field is not present then mapwithdefault which is space will be populated inthe file.
source field --> your logic --> mapwithdefault(space) --> target.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajeev,
Does the segment for target field is populating? If the segment is populated then at field level if you use mapwithdefault it should work. If the segment is not populated then as suggested by juan you need to use if else. First make sure you have segment and then the field.
Regards,
---Satish
Hi,
I am using what Juan said if else constant approach by checking wheather this filed exist by mapbydefaultvalue
I am working on one condition:
If Filed1 =Y or Field2=Y or Field3=1 or Fiedl4=1 then target field = A
or if all of the 4 fields are satisfied then B
I wrote a java UDF but I am getting <null> and [/] in the context queue. Ofcourse fields are with / and some fields doenst exist.. in this case how can I handle ?
THanks
Rajeev.
Hi Rajeev,
You don't need to write a UDF, in that case in which the field.. could come empty.. or even couldn't come, you have to ask for, if the field EXISTS, and if exists... if it's EQUALS to '' (empty field)
Try that to validate both conditions,
Regards,
Juan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rajeev,
What Satish told you, works if the node, or segment, doesn't exist. NOT if this is blank because there aren't any value.
If you want to populate them when they are blank, you have to do an IF as I told you, asking if it's equals to '' (nothing). That value is different than a non-existence node.
Regards,
Juan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajeev,
You can achieve this by using standard mapping functions such as:
if Node (or segment) exists
[you pass the value of that node]
else
[you can pass a constant space ' ']
In here you'd have to use, the function IF, EXISTS, and CONSTANT.
Try it,
Regards,
Juan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
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.