Skip to content

Instantly share code, notes, and snippets.

@svict4
Created January 17, 2018 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svict4/fde577f06abba8bd8bcd61f9615c4eaf to your computer and use it in GitHub Desktop.
Save svict4/fde577f06abba8bd8bcd61f9615c4eaf to your computer and use it in GitHub Desktop.
ABAP SAP CRM - Add node to a collection
DATA: lr_entity TYPE REF TO if_bol_bo_property_access,
lr_node TYPE REF TO cl_bsp_wd_value_node,
lr_col TYPE REF TO if_bol_bo_col,
lr_node_struc TYPE REF TO <structure of your node>.
TRY.
lr_col ?= me->typed_context->node->collection_wrapper.
lr_col->clear( ).
CREATE DATA lr_node_struc.
CREATE OBJECT lr_node
EXPORTING
iv_data_ref = lr_node_struc.
lr_col->add( lr_node ).
ENDIF.
CATCH cx_root.
ENDTRY.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment