Hello!
I need help with my code. I need check user selection for Project. I need check whether user to select business step for selected project.
Program code I wrote in method DO_FINISH_INPUT for component AIC_CM_PRJ_CTXT. If subnode is exists, then pass, error else message. In code I pass parameter for method EH_ONSAVE in Change Request overview. But I don't get entities for relation BTAICProjContextNode. What I do wrong?
DATA
: lr_cn TYPE REF TO cl_bsp_wd_context_node
, lr_iterator TYPE REF TO if_bol_bo_col_iterator
, lr_entity TYPE REF TO cl_crm_bol_entity
, lr_coll TYPE REF TO if_bol_entity_col
.
lr_iterator = me->typed_context->btprojctxt->collection_wrapper->get_iterator( ).
lr_entity ?= lr_iterator->get_first( ). IF lr_entity IS BOUND.
lr_coll = lr_entity->get_related_entities( iv_relation_name = 'BTAICProjContextNode' ).
IF lr_coll IS BOUND.
lr_iterator ?= lr_coll->get_iterator( ).
IF lr_iterator IS BOUND.
lr_entity ?= lr_iterator->get_first( ).
IF lr_entity IS NOT BOUND.
zcl_aic_utilites=>set_fl_projects( iv_fl_project = abap_false ).
ELSE. zcl_aic_utilites=>set_fl_projects( iv_fl_project = abap_true ).
ENDIF.
ENDIF.
ENDIF.
ENDIF
lr_entity is allways initial. Even after a user has selected business step.
Thank you for any help.