on 2014 Jun 16 2:46 PM
Hi All,
I tried to create a custom Genil object and followed by creating a bsp component. There I created a form view which will allow me create and save the data in the custom table referred in genil object.
I used the following scn document as a guide to create it.
The problem:
1) I have added the code what u mentioned in eh_oncreate in Do_init_context method as well as in event eh_oncreate.
when i run the application first time, everything works fine, i am able to enter the values in the field and clicking on save button, saves the data in the table zmast_cust.
but the new data that is saved is now displayed on form view in greyed out mode. clicking on create button, doesnt initialize the fields,..the fields still remains greyed out.
please help.
Hi bubai,
I think the problem is when you create a form view at last wizard will ask config/display mode check box have you checked that box.
if you checked that box fallow this procedure otherwise get_i_xxx problam.
!) go to min window
there is a method SET_VIEW_GROUP_CONTEXT redefine that and write this logic..
if me->view_group_context is NOT BOUND and
iv_first_time = abap_true.
if iv_parent_context is INITIAL.
CREATE OBJECT view_group_context
type cl_bsp_wd_view_group_context.
ENDIF.
ENDIF.
2) go to form view in do_prepare_output.
me->view_group_context->set_all_editable( ).
apart from this there is one single step that is go to form view .htm
there is one tag.
displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ) %>"
you have to comment this then it will work fine..
if you didn't tick that check box.
go to each and every attribute in get_i_xx method there is a returning parameter that is always true so
you have to change that to false.
rv_disabled = 'FALSE'.
then it will work as a normal it will not go for gray mode.
Thanks & Regards,
Srinivask
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sirnivas,
i am facing one issue on Z component form view,i have added two context nodes BTADMINH and BTCUSTOMERH, if i written the logic on BTADMINH - attributes field set method i ihave implemented the logic but here i am not getting data on current entity...if i enter any value on webui that value is not getting determined and it is cleared automatically.could you please help here.
Thanks &Regards
Kalpana
Hi,
Try to debug EH_ONCREATE event and check if the 'lr_ent' have the values that you have saved in the first run . If it have the values then clear them.
And for greyed out fields try to lock the entity as
CHECK lr_ent->lock( ) = abap_true.
lr_ent->switch_to_change_mode( ) .
Thanks
Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
This is my code in the event On create.
I added switch to change mode but it didn't work.
Also how do I clear the particular record within lr_ent.
If I use clear lr_ent, it gives a dump.
method EH_ONCREATE.
DATA : lr_entity TYPE REF TO cl_crm_bol_entity,
lv_collection TYPE REF TO if_bol_bo_col.
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.
TRY.
* Try to Get the instance of Root Object Customer
lr_core = cl_crm_bol_core=>get_instance( ).
lr_core->start_up( 'ZCUST' ).
CATCH cx_crm_genil_general_error.
EXIT.
ENDTRY.
* Get Entity factory of Customer
lr_fac = lr_core->get_entity_factory( 'Customer' ).
lt_params = lr_fac->get_parameter_table( ).
TRY.
* Create table structure
lr_ent = lr_fac->create( lt_params ).
IF lr_ent IS BOUND.
* Add Parameters
me->typed_context->customer->collection_wrapper->add( iv_entity = lr_ent ).
CHECK lr_ent->lock( ) = abap_true.
ENDIF.
CATCH cx_crm_genil_model_error.
EXIT.
CATCH cx_sy_ref_is_initial.
ENDTRY.
endmethod.
Hello Bubai,
In EH_ONCREATE event handler, call
me->typed_context->customer->collection_wrapper->clear( ) if lr_ent will have value. since, after clicking on create entity should not have any value.
And, also check
if lr_ent->lock( ) = abap_true.
me->view_group_context->set_view_editable( me ).
endif.
Thanks,
Amit Singh
User | Count |
---|---|
27 | |
3 | |
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.