Skip to Content
0
Former Member
Aug 08, 2007 at 02:31 PM

Call transformation with an object

78 Views

Hallo,

in my BSP I want to transform my model object into a xml string to set an server side cookie.

Therefore my code is:

  DATA:
    lv_xml      TYPE string,
    lv_username TYPE string.

 model    ?= get_model( model_id = 'main' ).

  lv_username = sy-uname.

  Call TRANSFORMATION id SOURCE o = model  RESULT XML lv_xml.
  cl_bsp_server_side_cookie=>set_server_cookie(
        name                  = 'MODEL'
        application_name      = runtime->application_name
        application_namespace = runtime->application_namespace
        username              = lv_username
        session_id            = runtime->session_id
        data_value            = lv_xml
        data_name             = 'MODEL'
        expiry_time_rel       = 3600 ).

But after the command "Call Transformation" the xml-string doesn't contain all the data of my object, only this:

# http://www.sap.com/abapxml" version="1.0"> http://www.w3.org/2001/XMLSchema" xmlns:abap=" http://www.sap.com/abapxml/types/built-in" xmlns:cls=" http://www.sap.com/abapxml/classes/global" xmlns:dic=" http://www.sap.com/abapxml/types/dictionary">

></asx:heap></asx:abap>

What is wrong?

Regards.

Martin