Serializing a Categories Document

Procedure

The serialization (for example, on ATOM server side) is using class CL_APP_CATEGORIES_PROV_PROV with the entry stored in ABAP structure IF_APP_TYPES=>CATEGORIES_S. The following code fragment makes use of a REST response entity.

              data:
        lo_entity type ref to if_rest_entity,
        ls_categories type if_app_types=>categories_s,
        lo_category_prov type ref to cl_app_categories_prov.

* fill categories structure
...
    create object lo_category_prov.
    lo_category_prov->set_categories( ls_categories ).
    lo_category_prov->write_to( lo_entity ).
...