If Genil Appl Intlay Modify Objects

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

METHOD if_genil_appl_intlay~modify_objects.

DATA : lv_cust_attr TYPE zattr_cust,


lv_root TYPE REF TO if_genil_container_object,
lv_changed_objects TYPE crmt_genil_obj_instance,
lv_props TYPE REF TO if_genil_obj_attr_properties,
lt_changed_attr TYPE crmt_attr_name_tab,
lv_cust_key TYPE zattr_cust_key,
lv_success TYPE abap_bool.

DATA : lv_change TYPE crmt_genil_attr_property.

CHECK iv_root_list IS BOUND.

* Get the first object from Container.

lv_root = iv_root_list->get_first( ).

IF lv_root->get_delta_flag( ) IS NOT INITIAL.

* Get name of the object.

CASE lv_root->get_name( ).

WHEN �Customer�.

* Returns an Property Object for Object Attributes.

lv_props = lv_root->get_attr_props_obj( ).

* Returns a Table of All Names with Specified Property.

CALL METHOD lv_props->get_name_tab_4_property


EXPORTING
iv_property = if_genil_obj_attr_properties=>modified
IMPORTING
et_names = lt_changed_attr.

lv_root->get_key( IMPORTING es_key = lv_cust_key ).


lv_root->get_attributes( IMPORTING es_attributes = lv_cust_attr ).

MOVE-CORRESPONDING lv_cust_key TO lv_cust_attr.

CALL METHOD zcl_customer_api=>change_customer


EXPORTING
is_cust_attr = lv_cust_attr
it_names = lt_changed_attr
IMPORTING
rv_success = lv_success.

IF lv_success IS NOT INITIAL.

lv_changed_objects�object_name = �Customer�.
lv_changed_objects�object_id =
cl_crm_genil_container_tools=>build_object_id( lv_cust_key ).

* Add into Object Table with Object Type and ID.

APPEND lv_changed_objects TO et_changed_objects.


ENDIF.

WHEN OTHERS.
ENDCASE.
ENDIF.

ENDMETHOD.

You might also like