cancel
Showing results for 
Search instead for 
Did you mean: 

Attribute is a READ ONLY from BOL. Need to make it Editable.

Former Member
0 Kudos

Hello

I am facing a very different issue here.

We are using the component : BT130I_OPPT for item details of an opportunity.

Here we have the field for product id which should always be editable by a user.

The issue I am facing is ; incase of most of the opportunities, this product id field is ediatble and changeable by the user.

However, for a few opportunities it is not.

I checked in debugging and found that the attribute is read-only.

Also, the attribute is a READ ONLY from BOL itself. However this is teh case only for these few opportunities.

In genil_bol_browser, I can edit the product id for other opportunities. However, for these few opportunities, they are not changeable.

Any idea as to why we get a different behaviors for these few specific opportunities?

I need this field editable for the opportunities. Is there any way I can make the field editable once agian?

Please help.

Regards,

Miselta

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

The issue has been solved.

The two opportunitis mentioned were follow up documents.As a result, the items for these opportunities were locked.

The entries for these opportunties have been removed from table : CRMD_BINREL as they are no more required to be mainatined as follow ups.

Thanks for all the help.

Regards,

Miselta

Former Member
0 Kudos

Is there a difference in the STATUS of the opportunities which are editable and which are readonly ?

Former Member
0 Kudos

Hi Miselta,

I believe you are taking about field ORDERED_PROD of BTADMINI context node of the view.

This context nodes corresponding genil class is : CL_CRM_ADMINI_RUN_BTIL

In this class, in the method: IF_CRM_RUNTIME_BTIL~READ_ATTRIBUTES, there is a piece of code as below:

CALL FUNCTION 'CRM_ORDPRP_I_READ_OW'
        EXPORTING
          iv_ordprp_i_guid = iv_ref_guid
        IMPORTING
          es_ordprp_i      = ls_ordprp_i
        EXCEPTIONS
          OTHERS           = 1.

      IF ls_ordprp_i IS NOT INITIAL.
        lr_attr_props = ir_cont_obj->get_attr_props_obj( ).
*     Product not changable if PRP or Category was entered in ORDPRP_I
        IF ls_ordprp_i-master_prp_id IS NOT INITIAL OR
           ls_ordprp_i-category_id IS NOT INITIAL.
          lr_attr_props->set_property_by_name( iv_name  = 'ORDERED_PROD'
                                               iv_value = if_genil_obj_attr_properties=>read_only ).

I am sure this is the code which is making the field read only if the condition satisfies. Either master_prp_id or category_id is coming as initial and making the field read-only in the genil.

If you don't want this - you need to replace the genil with Z-class and change this piece of code (but I think this should not be done as by logic product id should not be editable if above condition is fulfilled).

I hope it resolves the query.

Thanks,

Rohit

Former Member
0 Kudos

@ Rohit

Yes, the field I was talking about was ORDERED_PROD in BTADMINI .

I put a breakpoint in the class: CL_CRM_ADMINI_RUN_BTIL to check if the product was read only because of the condition in this class. However, it wasn't the case .

@Alwyn,

The status of both the opportunities are the same.

The product and the Business partners are also the same.

Regards,

Miselta

Edited by: Miselta on May 12, 2011 10:08 AM

Former Member
0 Kudos

Hi,

Can you try putting breakpoint in GET_I method on the line:

IF current->is_property_readonly(
                    'ORDERED_PROD' ) = abap_false.          "#EC NOTEXT
        rv_disabled = 'FALSE'.
      ENDIF.

if this gives abap_true that means it is coming from genil as read only - please go inside above code and check. I am sure you would find the place (most probably in btadminI class only if not at the place i mentioned).

Also, if you want to make it editable - at the end of genil class method - you can call the code to make it editable irrespective of how it is becoming read only in the code before that.

I hope that helps.

Thanks,

Rohit

Former Member
0 Kudos

Hi Rohit,

Thank you for taking the time to help me with this issue.I really appreciate it.

However, the issue is not yet solved .

Like I mentioned earlier, I did put a breakpoint in the get_i method for the atrribute - ORDERED_PROD.

The value that it got was rv_disabled = true. Now this value, I believe it gets from the genil as read only.

In debugging mode, I made the field editable by changing rv_disabled = false. I tried changing the product in WEB UI and saving.

However, it somehow always resets the value of the field to the same old product id value.

Somehow it looks like this value is locked for the opportunity.

The fields that are read only in bol_genil_browser are the product id and the product guid.

I also put breakpoints for the class: CL_CRM_ADMINI_RUN_BTIL method :IF_CRM_RUNTIME_BTIL~READ_ATTRIBUTES,

but it doesnt go to the part you mentioned in the code. So there is no read-only done here.

This issue is only with two opportunities in the system.

For the others, everything works fine and the field ORDERED_PROD is editable in every item status.

So changing the code in the genil class wouldn't make sense , because ideally it should work without any changes like in case of other opportunties.

Could there be somthing that is locking this product for the opportuntiy?

Regards,

Miselta

Edited by: Miselta on May 16, 2011 9:33 AM

Former Member
0 Kudos

Hi,

I am not sure what is making it read only. But debugging is the only way if your functional person is not able to suggest anything. Put a breakpoint at the end of GET_I method for both the opportunities and in BTIL class's read_attribute method and compare what is different.

Do both the opportunities exit at the same point in the BTIL class method or there is a difference - that should give you an idea about what is different in these two.

Thanks,

Rohit

rb
Active Participant
0 Kudos

Hi,

maybe you should look out for implementations of the field check badi CRM_ORDER_FIELDCHECK.

SE18 -> CRM_ORDER_FIELDCHECK

Bye

former_member214667
Contributor
0 Kudos

Hi Miselta,

Any attribute of a BOL object is made read-only in the GenIL layer. There would be some scenario in which PRODUCT_ID is being set to read-only. You need to figure out what that scenario is by maybe debugging into the GenIL implementation class and the subsequent classes. If the attribute is set to read-only from GenIL itself, then you can fix it only from GenIL layer.

Regards,

Shiromani