Quantcast
Channel: SCN : All Content - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 4552

Unable to save values in GENIL for newly created AET fields

$
0
0

Dear Experts,

 

we have requirement where in we have created few AET fields in BTADMINI. now upon saving my order i have written a piece of code in EH_ONSAVE where in i am writting the values for these fields using set_property. I can see the new values in entity but these values are not passed on to genil and i dont see the same when i check in genil_bol_browser. . The attaribute of these field and entity are changebale. your help will be appreciated.below is the code that i have used.

 

data: lr_core type ref to cl_crm_bol_core,
lr_query
type ref to CL_CRM_BOL_QUERY_SERVICE,
LR_RESULT
TYPE REF TO IF_BOL_ENTITY_COL,
LR_ENTITY
TYPE REF TO cl_crm_bol_entity,

LV_TRANSACTION TYPE REF TO if_bol_transaction_context.


DATA:   lt_parameters    TYPE        crmt_name_value_pair_tab,
ls_parameters   
TYPE        crmt_name_value_pair.

* Get the BOL Core instance

lr_core
= cl_Crm_bol_core=>get_instance( ).

* Load the component set
LR_CORE
->LOAD_COMPONENT_SET( 'BT' ).

* Create the query instance by passing the search object name
lr_query
= CL_CRM_BOL_QUERY_SERVICE=>get_instance(
iv_query_name
= 'BTQuery1O' ).

* Add the selection parameters

ls_parameters
-name = 'OBJECT_ID'.
ls_parameters
-value = LV_OBJID.

APPEND ls_parameters TO lt_parameters.

CALL METHOD lr_query->set_query_parameters
EXPORTING
it_parameters
= lt_parameters
iv_convert   
= abap_true.

*Get the result list
LR_RESULT
= LR_QUERY->GET_QUERY_RESULT( ).

* Get the first object(entity) in the result list
LR_ENTITY ?= LR_RESULT
->get_current( ).
LR_ENTITY ?= LR_ENTITY
->get_related_entity( iv_relation_name = 'BTOrderHeader' ).
LR_ENTITY ?= LR_ENTITY
->get_related_entity( iv_relation_name = 'BTHeaderItemsExt').
LR_ENTITY ?= LR_ENTITY
->get_related_entity( iv_relation_name = 'BTOrderItemAll').

* Lock and modify the property
if  LR_ENTITY->lock( ) = if_genil_Boolean=>true.

*Change the fields
LR_ENTITY
->set_property( iv_attr_name = 'ZZFLD00000Y' iv_value = LV_OBJID ).
LR_ENTITY
->set_property( iv_attr_name = 'ZZFLD00000Z' iv_value = LV_OBJID ).

*Core
LR_CORE
->modify( ).
LV_TRANSACTION
= lr_core->get_transaction( ).
*LV_TRANSACTION = LR_ENTITY->get_transaction( ).
LV_TRANSACTION
->save( ).
LV_TRANSACTION
->commit( ).

endif



Thanks & Regards,

Ameet


PS : the same code is working in my own system but in the client system it is not working. Is there any additional setting ?


Viewing all articles
Browse latest Browse all 4552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>