on 11-26-2010 11:50 AM
Hi ,
please guide me how to insert row in to table view. i added one insert button but when i am clicking it's not adding new row, please guide me some example.
divya.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dviya,
If you are trying to create a blank root entity in table node, follow this approach
DATA : lr_core TYPE REF TO cl_crm_bol_core,
lr_fac TYPE REF TO cl_crm_bol_entity_factory,
lt_params TYPE crmt_name_value_pair_tab,
ls_params TYPE crmt_name_value_pair,
lr_ent TYPE REF TO cl_crm_bol_entity.
lr_core = cl_crm_bol_core=>get_instance( ).
lr_fac = lr_core->get_entity_factory( 'Give your root object name like btadmini etc.' ).
lt_params = lr_fac->get_parameter_table( ).
TRY.
lr_ent = lr_fac->create( lt_params ).
IF lr_ent IS BOUND.
CHECK lr_ent->lock( ) = abap_true.
me->typed_context->(specify table context node)->collection_wrapper->add( iv_entity = lr_ent ).
me->typed_context->(specify table context node)->visible_first_row_index = me->typed_context->(specify table context node)->collection_wrapper->size( ).
ENDIF.
CATCH cx_crm_genil_model_error.
EXIT.
CATCH cx_sy_ref_is_initial.
ENDTRY.
Hope this helps..
Cheers,
Sumit Mittal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If the node is a value node, you have to use the same logic of the code in INIT method of the context node.
Create a blank line and turn it in a object and add to context node.
Hope this helps!
Best regards,
Caíque Escaler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi divya,
If table view entity is dependent entity then you can write the following code..
DATA : lr_entity TYPE REF TO cl_crm_bol_entity.
lr_entity ?= me->typed_context->btadminh->collection_wrapper->get_current( ). " Get the parent entity
if lr_entity->is_changeable( ) = abap_true.
TRY.
lr_entity ?= lr_entity->get_related_entity(
iv_relation_name = 'give the relation name to access the child entities' ).
* should never happen
ENDTRY.
TRY.
if lr_entity is BOUND.
lr_entity ?= lr_entity->create_related_entity(
iv_relation_name = 'Above relation name' ).
endif.
CATCH cx_crm_genil_model_error cx_crm_genil_duplicate_rel.
ENDTRY.
IF lr_entity IS BOUND.
me->typed_context->Context_node->collection_wrapper->add( lr_entity ). "Replace context node with your table context node
Endif.
ENDIF.
Hope this helps..
Cheers,
Sumit Mittal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
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.