on 03-19-2009 8:05 AM
Hi Everybody,
i have the following problem ans hope thet anybody can help me.
i have an input xml file. A part of it seems like this:
L_ANF_TEXT
-item
--EBELP
--TDID
.....
my ouput message seems like this:
Langtexte
- ebelp
- tdid
my problem is that the output message have at every part have 1..1 as occurences.
The Part in the input message have an occurences from 0..1.
How can i do that in the message mapping.
I hope anybody can help me
Best Regards
Markus
Your source has an occurrence of 0-1 and target 1-1.
There are two ways you can handle it.
1. Make sure your source system always sends data
2. Do a check and in case there is no data i.e the node does not exist in the source then pass an empty constant. This empty constant should be interpreted at the target as that the source didnt send any data.
Then - (Pass source field)
source field - EXIST -> IF -> Target
Else - (Pass Empty Constant)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i have do it with the if-then-else like this
L_ANF_TEXT
-item
--EBELP
Langtexte
-EBELP
if item exist then item to langtexte else constant 0 to langtexte - that works fine.
if ebelp exist then ebelp to ebelp else constant 0 to ebelp - that works only fine when item exist. when item not exits i get an error by testing:
Cannot produce target element /Anfrage/Langtexte/ebelp. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
Best regards
Markus
No need to use exists function when you are using mapWithDefault.
The mapping will be simple like this....
> i had:
>
> item-> then
> item -> exits -> if -> Langtexte
> item -> mapWithDefault -> else
>
item ->mapWithDefault--> Langtexte.
> and
>
> ebelp-> then
> ebelp -> exits -> if -> ebelp
> ebelp -> mapWithDefault -> else
>
ebelp ---> mapWithDefault --->ebelp.
Hi,
use Source --> exists --> createIf --> target
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could do this way:
IF souce field EXISTS => map to target field
ELSE => MAP WITH DEFAULT
This way you will definetely create a target field! If the content (in case the source field is not existing) of the target field is not required to be filled with a specific value - that's you solution.
Kai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please use node functions.........
More help refer this blog........
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Markus,
Please provide the complete source and target structure, along with their cardinality, to help us visualize more into the problem.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.