on 05-24-2006 8:17 AM
Hi All,
This is for RFC-to-JDBC Scenario.
I import an RFC from SAP for Vendor Master ( BTE Event : 00001421). In that there are tables and structures.
When i create a Vendor in transaction XK01, if i dont fill any of the values in structure WYT3, it gives an exception in mapping in XI when i test it in Message Mapping ( Cannot produce target element /ns1:MT_MDM_RECEIVER/STATEMENT1/NC_SUPPLIERMASTER/ACCESS/PARTNERTYPE. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd ).
In the XML format in XI at sender side it doesn`t show the fields in the structure at all if it doesnt have any data.
Thanks & Regards,
Ruchi
Hi Ruchi,
For the RFC the field might be mandatory but it might not be a mandatory data for creating the vendor Master through standard transaction.
If you are not sending the data then the node is not getting created and going into error.
Check in RFC if this is a mandatory data?
Regards
Vijaya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijaya,
Its not a manadatory field, but then it is mapped to a field in oracle DB, so it is possible that it doesn`t have any data.
I noticed that the node is not created when the structure doesnt have data.
So how do i eliminate this error. Is there somethin in the mappings by which i can check if the node for that field is created, pass the data else avoid it from throwin runtime exception.
Thanks & Regards,
Ruchi
Vijaya,
I tried the same thing , but it doesn`t work.
I get the same exception.In Display Queue it doesn`t show any value for exists, neither true nor false.
The senderfield node is not there at Runtime bcoz it doesn`t have any data.
'exists' does check for the existence of the node, but its not workin here....dont know why !!!
Thanks & Regards,
Ruchi
Hi All,
I check for a node exists in NODE Funtions, if the node is there it returns 'true', but if its not there, it doesnt return anyhting.
Sourcefield->exists->ifthenesle-?targetfield
Here i use if-then-else, so ideally it should execute the else part, but it doesnt do that.
It gives an error 'Cannot produce targetfield'.
Can anybody pl. help me on this.
Thanks & Regards,
Ruchi
Hi,
You have specified PARTNERTYPE in target as a mandatory field (ie its having an occurence of 1)...
Now if this field is not mapped then it will give error, so you have to map. IF your source doesn't have any value to map to it then give a constant. For that you have to use IF-THEN-Else but with suitable context handling.
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suraj,
Actually the problem is tht sourcefield is in a structure. Now if i dont pass any data in any of the fields in this structure it doesnt create any field nodes at all , i.e in my sender xml file i dont have the sourcefield.
So it doesnt find the source field to be mapped to the target fieldand it gives Runtime Exception 'Cannot produce target'.
Also i tried working with exists and all, but its not working.
I have not worked with Context Handling. So, pl. can you help me more on this.
Thanks & Regards,
Ruchi
Hi Ruchi,
What you need to do is that in the message mapping, you map your source field to your target field and in between from the standard functions available select node functions -> mapWithDefault. Now for the field which is not getting generated, once you make use of this function it will be looking like,
source field->mapWithDefault->target field.
what this does is that even if the source field xml tag is not there, then it will generate the xml tag in the target side and if any value is present then will pass that to the source structure.
Cheers
JK
PS: Award points if this helps you
Hi Suraj,
The sender xml is a structure(FWYT3) which might have data and might not , -
- <xsd:complexType name="FWYT3">
- <xsd:sequence>
- <xsd:element name="PARVW" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="2" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
If this structure doesnt have data it`ll only show like this in sender xml,ni.e it doesnt show the fields in this structure (T_YWYT3).So this field parvw is mapped to partnertype in target.But when parvw doesnt have any data this field is not at all displayed in this structure WYT3.
- </T_YWYT3>
The target xml structure is whose occurence is '1'-
- <xsd:element name="PARTNERTYPE" default="Supplier">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">d27dbd80e40b11da8293ece80a9821f4</xsd:appinfo>
</xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="40" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
Thanks & Regards,
Ruchi
Hi,
I hope PARTNERTYPE doesn't have any parent node and if it have then that nodes occurence is not minOccurs as 0.
Because if it has a parent node with minOccurs as 0 then you can allow that node to be created only when PARVW in the source exists.
Now if PARTNERTYPE is not haveing a parent node then:
1) Use IF then ELSE : You have to take care of the contexts. Right click on each node and see th edisplay queue for more help with contexts.
2) MapWithDefault : If you didn't have any value for the source node then this Default value is assigned to the target field.
Regards
Suraj
User | Count |
---|---|
84 | |
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.