cancel
Showing results for 
Search instead for 
Did you mean: 

make bol browser fields changeable

Former Member
0 Kudos

Hi,

i want make fields changeable mode, after i retrieve the data from data base by using  search query...in transaction code GENIL_BOL_BROWSER.

After i get fields as change mode, i want to modify them...which should be save in database.

i have created custom component set and Z class by copying 'MP' standard component set and its standard class 'CL_CRM_MPIL' and here i have taken super class 'CL_CRM_GENIL_ABSTR_COMPONENT',.

Here I am able to retrieve the data for advanced search and search query objects. by using methods 'GET_OBJECT_PROPS', 'GET_MODEL',  'GET_DYNAMIC_QUERY_RESULT' and 'GET_OBJECTS'.

But here i do not know which method to use for make the fields changeable, which are fetched from data base.

please anybody help me that....how to make the fields as editable and how to save them in database..

Thanks,

Reshma.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

if you are working on entity .....

lr_entity->switch_t0_change_mode( ) makes that entity to changebale

if you want to make whole view editable then

set_view_editable(me).

will make view into editable.

then  after hcanges you can use lr_core->modify( ).

lr-Txn->save( ).

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

there is a method IF_GENIL_APPL_INTLAY~LOCK_OBJECTS

for making modifiable root object this method should return abap_true

then only that field will be modifiable.

Inside of this method we check database lock if lock successful

we return

abap_true otherwise abap_false.

Former Member
0 Kudos

Hi Reshma,

U have to create a method in your class to change the fields editable and non editable in genil level.

Generally in genil the developers will give name for the method as SET_ATTR_PROPERTIES to do this.

So create a method with the name with fallowing parameters.

IV_ROOTImportingType Ref ToIF_GENIL_CONTAINER_OBJECT
IS_HEADERImportingTypeSTR_HEADER(entity Structure)
LV_CHImportingTypeI

example code in method.

   DATA: lr_attr_props TYPE REF TO if_genil_obj_attr_properties.

   lr_attr_props = iv_root->get_attr_props_obj( ).

**********************To make all fields in entity structure read_only********************************

   lr_attr_props->set_all_properties( if_genil_obj_attr_properties=>read_only ).

******************To make fields entity structure editable by field by field****************************

   lr_attr_props->set_property_by_name( iv_name  = '<table_field_name>'

                                            iv_value = if_genil_obj_attr_properties=>changeable ).

   lr_attr_props->set_property_by_name( iv_name  = '<table_field_name>'

                                            iv_value = if_genil_obj_attr_properties=>changeable ).

So by using this coding u can make fields editable ans read_only k.

When ever u want to change properties then call dis method by exporting the object in genil..

Hope this will help u.

Former Member
0 Kudos

Hi Ravi,

Thanks for your response .......

as you explained i got some idea, if i create method  SET_ATTR_PROPERTIES in genil class, but how that method will be triggered ??

After i modify the data i want to save them in data base tables, how this will be possible??

plsease help me in this.

Thanks and Regards,

Reshma.

0 Kudos

Hi Reshma,

You have to call this method from the READ method of your Genil class.

Best Regards,

Leon

Former Member
0 Kudos

Hi Reshma,

The concept here is very simple wen ur creating a new entity for a bol object some fields may b not need 2 fill by the user so,such fields we will make it as read only by using methods as i said earlier.

So wen u create a entity in genil if it was root den call SET_ATTR_PROPERTIES method in IF_GENIL_APPL_INTLAY~CREATE_OBJECTS like as fallows.

DATA ls_serparam  LIKE LINE OF <obj_name>.

DATA lr_object TYPE REF TO if_genil_cont_root_object.

       lr_object = iv_root_list->add_object( iv_object_name = 'PROD_HEAD' "#EC NOTEXT

                                  is_object_key  = lv_guid ).

       lr_object->set_attributes( ls_serparam ).

You have to call this method from IF_GENIL_APPL_INTLAY~GET_OBJECTS method to apply field props for all ur collection.

To save the data just write the code related to save the data in ur genil class method IF_GENIL_APPL_ALTERNATIVE_DSIL~SAVE_OBJECTS.

Hope this will help to u.

Former Member
0 Kudos

Hi Ravi,

Thanks for reply....

It is clear so far ....but bit confusion about  to call SET_ATTR_PROPERTIES method in  IF_GENIL_APPL_INTLAY~GET_OBJECTS method.

please can you describe bit more here for me???

Thanks,

Reshma.

Former Member
0 Kudos

Hi reshma,

If u have 10 entities for a  object den u have set the properties for all entries before u will return the collection to bol from genil.Then only does field properties will change.For that reason only i said that to call the set_attrib_props methos in get_object Method.

Hope this will help to u.

Former Member
0 Kudos

Hi Reshma,

IF_GENIL_APPL_INTLAY~LOCK_OBJECTS

-Database locks('ENQUEUE_*) for root objects.

IF_GENIL_APPL_INTLAY~MODIFY_OBJECTS,

Please check this methods, in the Z class..

Make sure the that object must be unlocked and they should be modifable..

Regards,

magana

Former Member
0 Kudos

Hi,

Please Help me with correct answer?????

Thanks,

Reshma.

0 Kudos

Hi Reshma,

Could you please tell what have you done and what is the current status.

Best Regards,

Leon

Former Member
0 Kudos

Hi Leon,

There is no method with name SET_ATTR_PROPERTIES in genil zclass, where i have taken super class as  'CL_CRM_GENIL_ABSTR_COMPONENT',.

i have copied 'MP' standard component set and its standard class 'CL_CRM_MPIL'  super class is 'CL_CRM_GENIL_ABSTR_COMPONENT'.

Thats why i have taken 'CL_CRM_GENIL_ABSTR_COMPONENT' as super class for my zclass.

so in that zclass there no method with name SET_ATTR_PROPERTIES.

Thanks,

Reshma.

0 Kudos

Hi Reshma,

You have to implement the method SET_ATTR_PROPERTIES in the corresponding Genil class of your component in order to make your fields changeable.

Best Regards,

Leon