cancel
Showing results for 
Search instead for 
Did you mean: 

Error in creation of target node

Former Member
0 Kudos

Sender MessageType:

1 .Root 1..1

2. Message header 1..1

3 -code

3-Name

3-HeaderNote

2. Data Range 1..1

3-No

3-type

2. Invoice header 1..unbounded

3 - Indicator

3 -invoicetype

3--invoicecode

3 -number

3 -no of line items

3 -note

3 *lineitem 1..unbounded

4 -numb

4 -type

Receiver Message type

1 Root 1..1

2 * Message header 1..1

3 -code

3 -Name

3-HeaderNote

2*Invoiceconfirm 1..unbounded

3-ReqID

3 -ID

3 -Typecode

3-CateCode

3-Note

Mapping : between sender receiver

2* Invoice header 1..unbounded -


>> 2 *Invoiceconfirm 1..unbounded

3- Indicator -


>> 3-ID

3 -invoicetype -


>> 3-Typecode

3--invoicecode -


>>3 -CateCode

3 -number -


>>- 3- ReqID

3 -no of line items

3 -note -


>>> 3-Note

3 *lineitem 1..unbounded

4-numb

4 -type

<u>File Content Conversion:</u>

Recordsetname: sender root

NAmesapce: http:

recordsetStructure : MessageHeader,1,DataRange,1,InvoiceHeader,*

recordsetpermessage:1

keyfieldname: keyfield

<b>Parameters:</b>

MessageHeader,3,DataRange,3,InvoiceHeader,*,LineItemOfInvoice,11

MessageHeader.fieldNames = keyfield,Name,HeaderNote

MessageHeade.keyfieldvalue=1

MessageHeader.fieldSeparator= ~~

MessageHeader.endSeparator=’nl’

<b>DataRange.fieldNames =keyfield,type

DataRange.keyfieldvalue=2

DataRange.fieldSeparator =~~

DataRange.endSeparator=’nl’</b>

InvoiceHeader.fieldNames: Indicator,keyfield, invoicecode, number, no of line items, note

InvoiceHeade.keyfieldvalue=2

InvoiceHeade.fieldSeparator =~~

<b>There Is no error in filesender :</b>

File is getting picked.

<b>In sxmb_moni:</b>

Cannot create target element /ns0:Root/ Invoiceconfirm /TypeCode. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD at com.sap.aii.mappingtool.tf7.AMappingProgram.processNode

Accepted Solutions (0)

Answers (3)

Answers (3)

prabhu_s2
Active Contributor
0 Kudos

Seems to be one of the field in the target structure is not having any data. This could be if the cardinality of the node is set > 0

Former Member
0 Kudos

The error msg is very clear.

<b>Cannot create target element /ns0:Root/ Invoiceconfirm /TypeCode. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD at com.sap.aii.mappingtool.tf7.AMappingProgram.processNode</b>

Here the TypeCode field is not populated but this is a mandatory field.Check your mapping Test your mapping

/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios

Have you used any UDF for the field TypeCode? If so check that.

Regards,

Jai Shankar

Former Member
0 Kudos

The same works fine without content coversion (When the input is XML file.).

So I think there is no problem with mapping.

Former Member
0 Kudos

Hi ;

Just copy the data getting picked up from the source file from sxmb_moni and test it in the mapping prog.Also check in the queue of the target node.

Mudit

Former Member
0 Kudos

Hi Mudit,

I think this might help.. iwill try.

Could u to tell how to write parameters of content conversion for one

substructure within a structure .As u can see lineitem under Invoice header.

We mention Invoice header in recordsetstructure where do I mention elements of Lineitem.

If I mention Lineitem in recordsetstructure .It comes at the same level as Invoice header .Which should be a subnode of Invoice header .

prabhu_s2
Active Contributor
0 Kudos

content converion for sender file adapter need to satisfy the structure:

<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm</a>

and for recevier

<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm</a>

for ur post refer to:

[url=https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1825] [original link is broken];https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1825[ [original link is broken];/url]

Former Member
0 Kudos

I think the problem is with the keyfield.

when I tried to run the content of payload in mapping test It gave same error.

As Itemtypecode is keyfield in content conversion parameter.

It isnot able to map to target as the mapping program has different name in sender message type (due to content conversion it becomes keyfield).

What to do to get column name instead.

As I need to also use keyfiled value.

Not sure ... If my assumtption is right

prabhu_s2
Active Contributor
0 Kudos

hi chandra

<b>when I tried to run the content of payload in mapping test It gave same error</b>

check if all the mandatory fields are filled. once the error in mapping is resolved then we can check of the rest. You can also post the error u encounter while testing the MM.

Former Member
0 Kudos

sender structure:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:CN_GoldenTax_SJJK0201FileMessage xmlns:ns0="http://sap.com/xi/AP/Globalization">

<MessageHeader>

<b> <HeaderCode/></b>

<HeaderName/>

<HeaderNote/>

</MessageHeader>

<DataRange>

<b> <NumberOfInvoices/></b>

<BeginningDateInvoices/>

<EndDateInvoicesSelected/>

</DataRange>

<InvoiceHeader>

<CancellationIndicator/>

<GoodsListIndicator/>

<InvoiceType/>

<b> <InvoiceTypeCode/></b>

<InvoiceNumber/>

<NumberOfLineItems/>

<InvoiceDate/>

<TaxMonth/>

<BillingDocumentNumber/>

<NetVATamount/>

<TaxRate/>

<TaxAmount/>

<ClientName/>

<ClientTaxCode/>

<ClientAddressPhone/>

<ClientBankAccount/>

<SellerName/>

<SellerTaxCode/>

<SellerAddressPhone/>

<SellerBankAccount/>

<Note/>

<NameofInvoiceIssuer/>

<NameofVerifier/>

<NameofCollector/>

<LineItemOfInvoice>

<DiscountRowSymbol/>

<ProductDescription/>

<Specification/>

<UnitsofMeasure/>

<Quantity/>

<NetVATamount/>

<TaxAmount/>

<TaxRate/>

<UnitPrice/>

<ModeOfUnitPrice/>

<ProductTaxItem/>

</LineItemOfInvoice>

</InvoiceHeader>

</ns0:CN_GoldenTax_SJJK0201FileMessage>

Receiver structure in Sxmb_moni:

<?xml version="1.0" encoding="utf-8" ?>

- <ns:CN_GoldenTax_SJJK0201FileMessage xmlns:ns="http://sap.com/xi/AP/Globalization">

- <MessageHeader>

<b> <keyfield>201</keyfield></b>

<HeaderName>19980201</HeaderName>

<HeaderNote>2</HeaderNote>

</MessageHeader>

- <DataRange>

<b> <keyfield>2</keyfield></b>

<BeginningDateInvoices>19980501</BeginningDateInvoices>

<EndDateInvoicesSelected>19980531</EndDateInvoicesSelected>

</DataRange>

- <InvoiceHeader>

<CancellationIndicator>1</CancellationIndicator>

<GoodsListIndicator>0</GoodsListIndicator>

<InvoiceType>0</InvoiceType>

<b> <keyfield>1306981140</keyfield></b>

<InvoiceNumber>00010004</InvoiceNumber>

<NumberOOfLineItems>1</NumberOOfLineItems>

<InvoiceDate>19980512</InvoiceDate>

<TaxMonth>05</TaxMonth>

<BillingDocumentNumber>96110002</BillingDocumentNumber>

<NetVATamount>76233.35</NetVATamount>

<TaxRate>0.17</TaxRate>

<TaxAmount>11076.66</TaxAmount>

<ClientName>1</ClientName>

<ClientTaxCode>321000789010005</ClientTaxCode>

<ClientAddressPhone>12</ClientAddressPhone>

<ClientBankAccount>123</ClientBankAccount>

<SellerName>12</SellerName>

<SellerTaxCode>130601000000000</SellerTaxCode>

<SellerAddressPhone>233352051</SellerAddressPhone>

<SellerBankAccount>2345326113357211</SellerBankAccount>

<Note>234</Note>

<NameofInvoiceIssuer>1</NameofInvoiceIssuer>

<NameofVerifier>2</NameofVerifier>

<NameofCollector>3</NameofCollector>

</InvoiceHeader>

</ns:CN_GoldenTax_SJJK0201FileMessage>

If I use this in test of mapping : It gives error inovicetypecode not created.

As u can see it has keyfield in sxmb_moni instaead.

Howsover if I remove keyfieldwith invoicetypecode It works fine.

So i think the name is not matched.

So in conversion parameter how I cann retain the name insted of keyfield.

As I also want to use the keyfieldvalue to identify a record in file

prabhu_s2
Active Contributor
0 Kudos

set the cardinaltiy of the <b>inovicetypecode</b> to 0..1 and then test the mapping

Former Member
0 Kudos

Error is still there.. even afetr changin gthe cadinality

prabhu_s2
Active Contributor
0 Kudos

also can u test by setting to 0..1 for the nodes corresponding to inovicetypecode (source adn target)

prabhu_s2
Active Contributor
0 Kudos

lost in the conversation....

ensure:

the message mapping passes the test successfuly. take the payload and check

if MM test is giving an error check if all the mandatory fields in the target node are having data in the source node to which it is mapped. Since SMX_MONI shows error for the fields TypeCode check if data for invoicetype is present as this is the field which is mapped to.

Former Member
0 Kudos

There is no error in MM test.

If I donont use keyfield in paramater there is no error and file is generated.

If I use this blog there is no error:

url=https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1825] [original link is broken] [original link is broken] [original link is broken] [original link is broken];https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1825[ [original link is broken] [original link is broken] [original link is broken] [original link is broken];/url]

But this is meant only for keyfields as first column.

Since in my scenarios keyfield is not the first column

I have used the following blog

If I use this blog the error comes:

see: that in this blog keyfieldname is used insted of element name but in the first blog keyfield is same as the element name.

And here lies the problem.

In the second blog since the element name is replaced by keyfield it is not able to map.

prabhu_s2
Active Contributor
0 Kudos

I guess that this might have an issue as the sourcefield will be replaced by keyfield text in the xml and in the mapping ( source to target) an issue might arise as some of the source node will not be compatible and data is not mapped to target.