on 03-25-2015 4:57 AM
Hi Gurus,
I have created two AET fields on the screen (marked below) and that should store values in table CRMD_CUSTOMER_H. When I create a new service request and enter the values and save, AET field values are not saved. Again, when I edit the same service request and enter the values and save , AET field values are saved on the database.
While debugging I found that, relationship BTHeaderCustExt does not exist for the first time and second time onward its appearing. Due to this, data is not being saved at first time (Line no 27 : current is empty).
When tried to create realtionship using create_related_entity , it throwing exception cx_crm_genil_model_error.
Please advice me the soution for the same.
Regards,
Anand
there should be a context node at your view level. Please check ON NEW FOCUS method is implemented or not.
If not, you can implement that method with below code.
DATA: lv_collection TYPE REF TO if_bol_bo_col,
entity TYPE REF TO cl_crm_bol_entity.
* get collection of dependent nodes
entity ?= focus_bo.
TRY.
lv_collection = entity->get_related_entities(
iv_relation_name = 'BTHeaderCustExt' ).
IF lv_collection IS NOT BOUND or lv_collection->size( ) = 0.
IF entity->is_changeable( ) = ABAP_TRUE.
TRY.
entity = entity->create_related_entity(
iv_relation_name = 'BTHeaderCustExt' ).
CATCH cx_crm_genil_model_error cx_crm_genil_duplicate_rel.
* should never happen
ENDTRY.
IF entity IS BOUND.
CREATE OBJECT lv_collection TYPE cl_crm_bol_bo_col.
lv_collection->add( entity ).
ENDIF.
ENDIF.
ENDIF.
CATCH cx_crm_genil_model_error.
* should never happen
EXIT.
CATCH cx_sy_ref_is_initial.
ENDTRY.
me->set_collection( lv_collection ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Praveen for your input.
When I right click on method 'on_new_focus', redefine option is not present. While clicking it prompts a message 'ZL_SRQM_H_BTADMINH_CN ON_NEW_FOCUS does not exist'.
I created a method 'on_new_focus' on CN class and put above code but its not triggering while debug.
I think its not generated properly (showing diamond icon).It should be of method type event handler and need to trigger automatically.
Regards,
Anand
Hi All,
There is another thread on this topic.
AET Field Value is not being saved at first time and second time onward it's saving on the database
I am closing this thread.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.