Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

XML - Problem trying to use XSDBOOLEAN field with False value

luis_rod
Participant
0 Kudos

( This problem occurs after a version change (before that, it worked ok) ).

We have a function module Z that consumes a web service from an external system. In the definition of the service, we send a field with a type of XSDBOOLEAN.
When we assign X to the variable it (correctly) sends the value True in the XML. Nevertheless, when we assign a space (FALSE) it does not send anything (it does not place any tag in the xml). We tried with ABAP_FALSE, same issue.

Any ideas?

TIA,

Luis

2 REPLIES 2

touzik_itc
Active Participant
0 Kudos

Please, check the article Activating Extended XML Handling describing the handling of initial values.

" create proxy
  CREATE OBJECT lo_proxy.

" get protocol
  DATA: lo_payload_protocol TYPE REF TO if_wsprotocol_payload.
  lo_payload_protocol ?= lo_proxy->get_protocol( if_wsprotocol=>payload ).

" Set the extended XML handling
  lo_payload_protocol->set_extended_xml_handling( extended_xml_handling = 'X' ).

" Populate values into respective field CONTROLLER. Set field FIELD with field name, 
" and field VALUE with sai_ctrl_initial from ABAP type pool SAI

0 Kudos

Andrei:

Thanks for your post. We solved the problem changing the ABAP type from XSDBOOLEAN to char(05) and assigning directly the value to FALSE.

As stated before, this routine worked ok until the version change, so we suppose it now pertains to a differente interpretation of the XSDBOOLEAN type.

Also, we found a reference to a SAP Note (2543153) that suggests avoiding the use of XSD* domains, and using other domains instead (e.g. R_BOOL, ODQ_BOOLEAN).


Thanks again,

Luis