cancel
Showing results for 
Search instead for 
Did you mean: 

How to save changes in a Table?

Former Member
0 Kudos

Hi Experts,

I have included my own component into an SAP component as an assigment block. My component shows a table (Table Context Node). I have made some columns editable. However, when I try to make changes in this table, after pushing the Enter Button, the chaged values is being replaced by the old value.

I have set

rv_disabled = 'FALSE'.

in my GET_I_<attribute name> method. I guess there are other things to do..?

How can I make and save changes in my table?

Thanks, Johannes

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Johannes,

As mentioned by Steve the method SET_ <xxxx> persist the data into the database. Now one more thing I want you to verify is the GET_ <xxxx> method.... just put the break point at this method and check the parameter value.

Thanks,

Vikash.

Former Member
0 Kudos

Hi,

thanks for the advices!

The problem remains unsolved, though..

I have checked the SET_<xxxx> Method. The value is being properly set. But after this, the GET_<xxxx> Method is called again and resets the value back to the old value...

How can I avoid this?

Thanks, Johannes

Former Member
0 Kudos

Hi,

I just saw that in Method IF_BOL_BO_PROPERTY_ACCESS~SET_PROPERTY , the condition:

if ME->IS_CHANGEABLE( ) = ABAP_TRUE and
           LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY.

is skipped (coding in IF statement is skipped)..

I think the IS_CHANGEABLE( ) thing is "true", but

IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY

is set..

Where/ how can I set/ reset this? I have had a look around and did not find anything..

Thanks, Johannes

former_member202474
Contributor
0 Kudos

Hi ,

As you are trying to edit the fields check whether the entity is locked or not . That means if you want to edit the AB for eg based on an Edit button , the the code will go like this .

DATA: lr_entity TYPE REF TO cl_crm_bol_entity.

  • Get the current entity.

lr_entity ?= me->typed_context->context_node->collection_wrapper->get_current( ).

IF lr_entity IS BOUND.

IF lr_entity->is_locked( ) EQ abap_false.

lr_entity->lock( ).

ENDIF.

IF lr_entity->is_locked( ) EQ abap_true.

me->view_group_context->set_view_editable( me ).

ENDIF.

ENDIF.

Entity must be locked.

Hope this helps.

Regards,

Ruby.

stevejonathan_tirtha
Active Participant
0 Kudos

Hi,

I assumed your Z component has value context node.

So the generated context node has GETTER and SETTER.

First of all GET_I_ <xxxx> makes the field into editmode or displaymode.

It has nothing to do, whether the value you enter set or not.

please set a break point in SET_ <xxxx>. There you will see, why the value is not set.

Regards,

Steve