cancel
Showing results for 
Search instead for 
Did you mean: 

Outbound ABAP Proxy. Field with initial value removed from the xml

0 Kudos

I have a structure in which the fields can be sent the initial value. In this case, FIELD1 declared as an integer type whose initial-value - is 0. I now, optimizer side SAP system operates in such a way that by default does not form the elements xml-message for initial values. Accordingly, the element for the field №1 was not generated. I have to transfer all fields in the SAP PI XI, even if the values in the field is initial or = 0.

According to http://help.sap.com/saphelp_nw74/helpdata/en/48/591b845e024bb9e10000000a42189b/content.htm

i need call method "set_extended_xml_handling", but i don now, where I shall describe a method call?


in the generated class i have:

IF_PROXY_BASIS_INTERNAL~CREATE_FRAMEWORK

IF_PROXY_BASIS~GET_PROTOCOL

IF_PROXY_BASIS~GET_TRANSPORT_BINDING

IF_PROXY_CLIENT~EXECUTE

CONSTRUCTOR

SI_INV_PROJ_AO

method CONSTRUCTOR not modifiable, method SI_INV_PROJ_AO not modifiable to.

Reason:

The entered class is a generic proxy type. These proxy types cannot be

processed using the Class Builder, but using the transaction SPROXY.

Create a new method there is no possibility to.

Where i need to call method SET_EXTENDED_XML_HANDLING of interface  IF_WSPROTOCOL_PAYLOAD before calling proxy?

Could you explain to me step by step?

Best Regards, Pavel.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor

Hi Pavel,

By default if the field is optional and if the field contains initial values then the field will be removed from the xml, if you want to override this behavior you can use Extended XML Handling by setting the below values to the CONTROLLER for the complex type.

  • sai_ctrl_initial -  Send initial value
  • sai_ctrl_nil  -  Send xsi:nil='true'
  • sai_ctrl_none - Suppress Element

To enable extended XML handling in proxy program you need to call method SET_EXTENDED_XML_HANDLING of interface  IF_WSPROTOCOL_PAYLOAD before calling proxy like below.

*...get payload protocol to enable extended XML handling

         lr_payload_protocol ?= lr_client_proxy->get_protocol( if_wsprotocol=>payload ).

         call method lr_payload_protocol->set_extended_xml_handling( abap_true ).

To set which fields you need to activate this by using below code.

ls_prxctrl-field = 'FIELD1'.

ls_prxctrl-value = sai_ctrl_initial. " This will send initial value

append ls_prxctrl to ls_output-message_type-item-controller.


*Send proxy message to middleware

         create object lr_client_proxy.

*...get payload protocol to enable extended XML handling

         lr_payload_protocol ?= lr_client_proxy->get_protocol( if_wsprotocol=>payload ).

         call method lr_payload_protocol->set_extended_xml_handling( abap_true ).

*...send proxy message to middleware

         call method lr_client_proxy->DEFAULT_VALUE_DATA_OUT

           exporting

             output = ls_output.

Regards,

Praveen.

Answers (0)