Application Development and Automation 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: 
Read only

Serialize ABAP type

Former Member
0 Likes
603

Is there any way to serialize an ABAP type not defined in the ABAP dictionary dictionary (local type) and restore it later? I need to save it in the XML along with the data to be able to restore them later. Thank you.

3 REPLIES 3
Read only

larshp
Active Contributor
0 Likes
562

Following should work on version 702 and above:

  METHOD from_xml.

    CALL TRANSFORMATION id

      SOURCE XML iv_xml

      RESULT 'DATA' = rs_something.

  ENDMETHOD.

  METHOD to_xml.

    CALL TRANSFORMATION id

      SOURCE 'DATA' = is_something

      RESULT XML rv_xml.

  ENDMETHOD.

Read only

Former Member
0 Likes
562

The main problem that I do not know the xml data structure, that is why I am going to serialize also a type. In your example 'rs_something' should have specific type.

Read only

larshp
Active Contributor
0 Likes
562

yes, it depends on your overall setup. If rs_something is a CHANGING parameter it can have a generic type, so the caller can decide the type. Guess you know a bit about the type either from the code calling the serialization routines, or via filename or something else?