cancel
Showing results for 
Search instead for 
Did you mean: 

Custom assignment block not editable in Change Document (SM_CRM)

robynhosby
Active Participant
0 Kudos

Hello Experts!

I created a custom assignment block in the ChaRM change request (ZMCR) and another one in the change document (ZMMJ).  The one I created in ZMCR works fine. The fields are editable and save/auto-fill as expected.   However, the field in the change document's assignment block does not.  When the charm document is edit mode, the field stays in display mode.   I created the field the same as I did in the Change Request.

Here are the field properties...

Any thoughts on why the field isn't editable in the change document?

Thanks! Hoping to award points!!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Robyn,

did you forward the BTAdminH from the change document ui component to your ui component?

That would be in the ui component AIC_CMCD_H in the component controller the method WD_USAGE_INITIALIZE.

The code should look like this, where the usage_name is the name of your component usage:

  CALL METHOD super->wd_usage_initialize

    EXPORTING

      iv_usage = iv_usage.



  CASE iv_usage->usage_name.



    WHEN 'ZSM_TICK_SYSTMS'. "Your component usage
      iv_usage->bind_context_node( iv_controller_type  = cl_bsp_wd_controller=>co_type_component

                                   iv_target_node_name = 'BTADMINH'

                                   iv_node_2_bind      = 'PARENT' ).

  ENDCASE.

Best Regards,

Christoph

robynhosby
Active Participant
0 Kudos

Hi Christoph,

Thank you!   I think that fixed it.  I had tried last week adding binding in AIC_CMCD_H in that method, but I couldn't get it to work. I must not have tried exactly your suggestion, because your code appears to have worked in our sandbox.  I'm going to apply in the dev system now.

robynhosby
Active Participant
0 Kudos

Thank you Christoph! You rock! It works great in the dev system!

Answers (2)

Answers (2)

robynhosby
Active Participant
0 Kudos

Hi Experts,

Any thoughts on how to make new AET fields save after the setter/getter methods have been generated?

0 Kudos

Hi Robyn,

Put the break point in Getter and setter, check whether collection wrapper=>get current gives you any value, if its is a dropdown field, appending zero's may be missing.

If that is a case, use consersion exit alpha and add zero and then pass to variable "value" in getter method.

Thanks & Regards,

Akshay Ruia

robynhosby
Active Participant
0 Kudos

Hi Akshay,

The collection wrapper isn't bound. In my Z component for the custom assignment block...

I enter a value in the custom assignment block's field...

Then, Save.....

CURRENT = COLLECTION_WRAPPER->get_current ( )    results in Initial.

fields are....

It's not bound to the entity.

I have tried to bind it to it's parent. I have tried binding it to BTAdminH. Nothing worked. I have those reverted those changes since they did not work.  I know I'm missing binding. I'm just not sure how to bind the field or what to bind it to.

Any thoughts?

0 Kudos

Hi Robyn,

Check if this documents helps you.

Passing Data across Components through Component Controller between Two Value Nodes.pdf.

Document describes how to assign assignment block of one component to another manually without using any tool.

Thanks & Regards,

Akshay Ruia

Former Member
0 Kudos

Hi Robyn,

you can check the GET_I_[Your Attribute Name] method for your attribute in the component workbench.

Try to delete the generated code and enter the following:

rv_disabled = 'FALSE'.

Best Regards,

Christoph

robynhosby
Active Participant
0 Kudos

Thank you Christoph!   My new field in the custom AB is now editable.   However, now the entered values are not saved.  Since I generated the SETTER and GETTER methods, the iterator and collection_wrapper are not bound. Strange how the CR AET processes this automatically but the CD AET does not.   Any thoughts about the how to save entered values after generating those methods?

Former Member
0 Kudos

Hi Robyn,

please check the method ON_NEW_FOCUS in your context node class (ends for example with *_CN00).

The bol objects and collection_wrapper are usually bound there, for example in standard for BTCustomerH:

  DATA: lv_collection TYPE REF TO if_bol_bo_col,
        entity        TYPE REF TO cl_crm_bol_entity.

* get collection of dependent nodes
  entity ?= focus_bo.
  TRY.
      lv_collection = entity->get_related_entities( iv_relation_name = 'BTHeaderCustExt' ).

      IF lv_collection IS NOT BOUND OR lv_collection->size( ) = 0.
        IF entity->is_changeable( ) = abap_true.
          TRY.
              entity = entity->create_related_entity( iv_relation_name = 'BTHeaderCustExt' ).
            CATCH cx_crm_genil_model_error cx_crm_genil_duplicate_rel.
*             should never happen
          ENDTRY.
          IF entity IS BOUND.
            CREATE OBJECT lv_collection
              TYPE
              cl_crm_bol_bo_col.
            lv_collection->add( entity ).
          ENDIF.
        ENDIF.
      ENDIF.

    CATCH cx_crm_genil_model_error.
*     should never happen
      EXIT.
    CATCH cx_sy_ref_is_initial.
  ENDTRY.
  me->set_collection( lv_collection ).

Best Regards,

Christoph

robynhosby
Active Participant
0 Kudos

Hum.   My on_new_focus looks different. Mine is implemented in CL_AXT_BASE_CTXN_TAB_EXT.

Here is my method by default...

  METHOD on_new_focus.

    DATA: lo_collection     TYPE REF TO if_bol_bo_col,
          lo_entity         TYPE REF TO cl_crm_bol_entity,
          lv_parent_name    TYPE crmt_ext_obj_name,
          ls_model_il       TYPE axt_model_il.

    IF focus_bo IS INITIAL.
      me->collection_wrapper->clear( ).
      RETURN.
    ENDIF.

*   get collection of dependent nodes
    lo_entity ?= focus_bo .

    "Determine which relation from the parent is suitable in the runtime
    lv_parent_name = lo_entity->get_name( ).
    READ TABLE mt_model_il INTO ls_model_il WITH KEY object_a = lv_parent_name.
    CHECK sy-subrc = 0.

    mv_relation_name = ls_model_il-relation_name.

    "Determine the base_entity_name by its parent
    set_base_entity( ls_model_il-object_b ).

    lo_collection = cl_axt_ui_services=>get_rel_entity_collection( io_parent_entity    = lo_entity
                                                                   iv_relation_name    = mv_relation_name
                                                                   iv_is_create_needed = abap_true ).

    me->collection_wrapper->set_collection( lo_collection ).


  ENDMETHOD.                    "ON_NEW_FOCUS


I did set a breakpoint. It does not get executed.  Thoughts?

robynhosby
Active Participant
0 Kudos

I also tried binding my new field to the parent. No change in results though.

robynhosby
Active Participant
0 Kudos

Hi experts,

Any thoughts on how to make my new AET field save after the setter/getters have been generated?