cancel
Showing results for 
Search instead for 
Did you mean: 

XML - ABAP conversion, empty tag

Former Member
0 Kudos

Hi.

Im sending data from a DB to a proxy using XI.

But when I get an empty response from the DB, wich gives me an empty XML tag the proxy shows me an error:

-PARSE_APPLICATION_DATA Error during XML => ABAP conversion (Response Message; error ID: CX_ST_MATCH_ELEMENT;

-Error during XML => ABAP conversion (Response Message; error ID: CX_ST_MATCH_ELEMENT;

-System expected the end of the element 'STMT_DC_response'

This is the message that originates the fail:

<ns0:MT_xxx_response xmlns:ns0="urn:s-com:xi:SD">

<STMT_response>

<row>

<c11>P</c11>

<c12>55062330</c12>

<c13>1</c13>

</row>

</STMT_response>

<STMT_DC_response />

</ns0:MT_xxx_response>

In case that the tag is filled runs ok

<ns0:MT_xxx_response xmlns:ns0="urn:s.com:xi:SD">

<STMT_response>

<row>

<c11>P</c11>

<c12>55062330</c12>

<c13>1</c13>

</row>

</STMT_response>

<STMT_DC_response>

<row>

<c21>P</c21>

<c22>55062330</c22>

<c23 />

</row>

</STMT_DC_response>

</ns0:MT_xxx_response>

The definition for the data is:

STMT_DC_response 0..1

row 0..n

tipo 0..1

Thanks for the help you can give me about my problem with empty tags.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello ,

Change the minimum occurence rate for that elements to 0 or u can check whether the node exists by exists node function and append a whitespace to create the element in target.

**************Reward points if found useful

Former Member
0 Kudos

You are right, with the exist function I could make a new mapping to avoid sending that node.

But this is a synchronous proxy, with an input and an output, and is simpler to put it directly without making an Integration Process.

I dont understand why abap cant get that empty tag.

I have put some extra mappings to avoid those empty nodes, but with this case I would like to keep it simple because I think It would be faster and lighter.

Answers (9)

Answers (9)

Former Member
0 Kudos

It couldnt be implemented on that way

former_member190389
Active Contributor
0 Kudos

HI,

yes i have seen this problem. In the foreground it shows <STMT_DC_response /> but the source has <STMT_DC_response ></STMT_DC_response >. Option would be to suppress this tag.

Former Member
0 Kudos

The tag is a response from the DB, I dont know how to supress it, I think it cant be supressed.

On the Communication Channels, on Sender mode, I can set the advance parameter "Remove Empty tags", but on the Receiver mode, wich Im using, that parameter is not showed.

Do you know a way of doing that?

henrique_pinto
Active Contributor
0 Kudos

You don't have any mappings in the response message?

Regards,

Henrique.

Former Member
0 Kudos

No. My scenario:

Proxy -> XI (map the input to 3 DB querys) -> DB

<- DB query response

thats a Synchronous Proxy with an input parameter. It request directly the DB using a mapping. The mapping has 3 statements (STMT1, ...) and the DB put the response back to each one (STMT1response,...) wheter the response have data or not.

Former Member
0 Kudos

hi

the XML si show as <STMT_DC_response />, but actually the XML code is:

<STMT_DC_response>

</STMT_DC_response>

My System is 7.0 SP14

does anyone have seen this error?

henrique_pinto
Active Contributor
0 Kudos

Hi Jean,

the problem is probably related to schema validation.

If the field is optional but is empty, it should not be created at all.

Try to validate this xml against the xsd that you described (with occurrence 0...1 for the field) and you'll see it's invalid.

You'll have to either change it in the DB so that the empty field is not sent or treat it in mapping.

Regards,

Henrique.

Former Member
0 Kudos

I see....

but I cant validate it on the Integration Builder. I have maping that takes one input parameter and then makes 2 query request, like:

STMT1

. action

. access

STMT2

. action

. access

I know that the database will return

STMT1_response

. row

. . a1

STMT2_response

. row

. . b1

and if there is no data It will return:

STMT1_response

. row

. . a1

STMT2_response

now, to close the question.

Do you think there is no way that when making a query request from a proxy it will not fail in case that the query return nothing?

Thanks a lot Henrique

henrique_pinto
Active Contributor
0 Kudos

If the parent field is always created, its definition is then 1...1 and not 0...1.

Try to change this in the data type to check the ABAP Proxy behavior.

Regards,

Henrique.

Former Member
0 Kudos

System expected the end of the element 'STMT2_response' :(

henrique_pinto
Active Contributor
0 Kudos

Did you regenerate the proxy?

Henrique.

Former Member
0 Kudos

yes.

regenerate, save and activate

henrique_pinto
Active Contributor
0 Kudos

Is the scenario sync or async?

If async, try to test the proxy through sproxy. (mark the 'XML' flag).

Paste the response xml from DB but instead of

<STMT_DC_response />

put

<STMT_DC_response/>

(remove the blankspace).

Let me know the result.

I'm supecting that it's not being able to find the end tag mark because of this.

Anyway, removing the empty tag in the mapping would be the easiest solution.

Regards,

Henrique.

Former Member
0 Kudos

It Is a sync scenario

Im testing from the sproxy, but dont let me change the incoming xml, or I dont know how

you are right, that blank space could be a problem, but i cant control that

Thanks again

Former Member
0 Kudos

What do you think if after the query I made I put a dummy query that gaves me empty data

like:

SELECT DATA1, DATA2 FROM T1

UNION

SELECT '', ''

If theres another way please tell me.

Thanks

Former Member
0 Kudos

I have 6.40 SP20

XI 3.0

Former Member
0 Kudos

thanks for your help!

yes, The definition for the data is:

STMT_DC_response 0..1

to be sure I disabled that node, so I wont get it from the DB, and It was ok

this is ok:

<ns0:MT_xxx_response xmlns:ns0="urn:s-com:xi:SD">

<STMT_response>

<row>

<c11>P</c11>

<c12>55062330</c12>

<c13>1</c13>

</row>

</STMT_response>

</ns0:MT_xxx_response>

but this is not

<ns0:MT_xxx_response xmlns:ns0="urn:s-com:xi:SD">

<STMT_response>

<row>

<c11>P</c11>

<c12>55062330</c12>

<c13>1</c13>

</row>

</STMT_response>

<STMT_DC_response />

</ns0:MT_xxx_response>

Former Member
0 Kudos

Which SP ? you are using

Former Member
0 Kudos

check the ouccurence for <STMT_DC_response> if its ocuurence is 1..1 change to 0..1