Ani Getrelation

You might also like

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

FORM get_dependent .

TRY.
CALL METHOD lr_entity->get_related_entities
EXPORTING
iv_relation_name = 'rel_cr_cat'
iv_mode = cl_crm_bol_entity=>bypassing_buffer
RECEIVING
rv_result = lob_result_relcat.
CATCH cx_crm_genil_model_error .
" MESSAGE lcx_ob TYPE 'E'.
ENDTRY.
"lob_newentity = lr_entity->create_related_entity('rel_cr_cat').
CHECK lob_result_relcat IS BOUND.
lob_iterator_relcat = lob_result_relcat->get_iterator( ).
CHECK lob_iterator_relcat IS BOUND.
lob_entity_relcat = lob_iterator_relcat->get_first( ).
WHILE lob_entity_relcat IS BOUND.
TRY.
CALL METHOD lob_entity_relcat->get_related_entities
EXPORTING
iv_relation_name = 'SUB_CAT'
RECEIVING
rv_result = lob_result_relsubcat.
CATCH cx_crm_genil_model_error .
" MESSAGE lcx_ob TYPE 'E'.
ENDTRY.
CHECK lob_result_relsubcat IS BOUND.
lob_iterator_relsubcat = lob_result_relsubcat->get_iterator( ).
CHECK lob_iterator_relsubcat IS BOUND.
lob_entity_relsubcat = lob_iterator_relsubcat->get_first( ).
WHILE lob_entity_relsubcat IS BOUND.
CALL METHOD lob_entity_relsubcat->if_bol_bo_property_access~get_properties
" CALL METHOD lob_res->if_bol_bo_property_access~get_properties
IMPORTING
es_attributes = ls_relsubcat.
lob_entity_relsubcat = lob_iterator_relsubcat->get_next( ).
ENDWHILE.
lob_entity_relcat = lob_iterator_relcat->get_next( ).
ENDWHILE.
ENDFORM.

You might also like