Skip to Content
avatar image
Former Member

Transfer Context data from WD1 to WD2

Hi,

I have a situation where I am working with 2 different WD applications.

I have passed URL parameters between 2 WD applications but now I am interested in passing context itself.When I posted this question in forum I got some suggestions but i have never done this before.

Any idea on FM or class which would help in doing following process?

How do we convert Internal table to XML?

How do we store this XML as Server Cookie in database?

How can we generate a unique key like GUID?

How can we deserialize it & populate it to context?

Rgds

Vara

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 31, 2009 at 02:07 PM

    >How do we convert Internal table to XML?

    With the Call Transformation ABAP syntax. You can use the built in XSLT ID. Here is a sample:

    data: ostream type string.
          call transformation id
          source itab = isflight
          result xml ostream.

    >How do we store this XML as Server Cookie in database?

    Use the class cl_bsp_server_side_cookie=>set_server_cookie.

    cl_bsp_server_side_cookie=>set_server_cookie( name = data_name
            application_name = ''
            application_namespace = ''
            username = ''
            session_id = ''
            data_name = data_name "Your GUID
            data_value = ostream
            expiry_time_rel = '1200' ).

    >How can we generate a unique key like GUID?

    data: guid_22 type guid_22.
          call function 'GUID_CREATE'
            importing
              ev_guid_22 = guid_22.

    >How can we deserialize it & populate it to context?

    Deserialize uses the same Call Transformation statement as the serialization, just reverse the parameters:

    call method cl_bsp_server_side_cookie=>get_server_cookie
        exporting
          name                  = data_name "GUID
          application_name      = ''
          application_namespace = ''
          username              = ''
          session_id            = ''
          data_name             = data_name "GUID
        changing
          data_value            = istream.
    
    **** deserialize the Class
      if istream is not initial.
        try.
            call transformation id
            source xml istream
            result itab = isflight.
          catch cx_xslt_exception into xslt_err.
        endtry.
      endif.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 31, 2009 at 02:18 PM

    Thank you very much Thomas.

    You are simply Great!!! Awarded full points.

    Rgds

    Vara

    Add comment
    10|10000 characters needed characters exceeded