Skip to Content
0

HELP - attribute CHANGEABLE if_bol_bo_property_access .

Apr 19 at 11:15 AM

45

avatar image

lo_entity->set_properties( is_attributes = ls_crmst_vis_bol_str ). no me guarda la estructura nueva porque la propiedad CHANGEABLE y no puedo cambiarlo no encuentro el metodo para hacer el cambio. ayuda

---------------------------------------

lo_entity-> set_properties (is_attributes = ls_crmst_vis_bol_str). I do not save the new structure because the CHANGEABLE property and I can not change it I can not find the method to make the change. help

METHOD get_cells_name.
  TYPES:
    BEGIN OF ty_namefull,
      name_last  TYPE bu_namep_l,
      name_first TYPE bu_namep_f,
    END OF ty_namefull.




  DATA:
    lr_typed_context     TYPE REF TO cl_bsp_wd_context,
    lr_node              TYPE REF TO cl_bsp_wd_context_node,
    lo_result            TYPE REF TO if_bol_bo_col,
    lv_size              TYPE string,
    lo_iterator          TYPE REF TO if_bol_bo_col_iterator,
    lo_entity            TYPE REF TO if_bol_bo_property_access,
    ls_crmst_vis_bol_str TYPE crmst_query_r_act_btil,
    lv_index             TYPE i,
    ls_name              TYPE ty_namefull
    .




*Movemos a puntero auxiliar
  lo_result     ?= lr_result.
*Obtenemos el maximo del Do
  lv_size        = lo_result->size( ).
*inicializamos el index.
  CLEAR lv_index.
*Recorremos todos los elementos para su modificacion.
  lo_iterator   ?= lo_result->get_iterator( ).
*  Recuperamos la linea seleccionada de la vista Resultado
  DO lv_size TIMES.
    IF lv_index IS INITIAL.
      lv_index = 1.
    ELSE.
      lv_index = lv_index + 1.
    ENDIF.
    lo_entity      = lo_iterator->get_by_index( iv_index = lv_index ).




    lo_entity->get_properties(
                        IMPORTING
                          es_attributes = ls_crmst_vis_bol_str
                              ).


    SELECT SINGLE name_last
                  name_first
                    FROM but000
                      INTO ls_name
                        WHERE partner = ls_crmst_vis_bol_str-activity_partner
                          .


    IF sy-subrc = 0.




      ls_crmst_vis_bol_str-zznombre    = ls_name-name_first.
      ls_crmst_vis_bol_str-zzapellidos = ls_name-name_last.




      lo_entity->set_properties( is_attributes = ls_crmst_vis_bol_str ).


    ENDIF.
  ENDDO.
* Volvemos los valores modificados
  lr_result     ?= lo_result.
ENDMETHOD.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Bruno Garcia Apr 19 at 11:35 AM
1

Hi Tare,

You can try to convert your variable LO_ENTITY to class CL_CRM_BOL_ENTITY and then use the method SWITCH_TO_CHANGE_MODE to make the entity changeable. However, there are attributes that are only meant to be only in display mode, so there's no guarantees that it will work.

Kind regards,
Garcia

Show 4 Share
10 |10000 characters needed characters left characters exceeded

does not change the attribute so it does not allow the change.

    Data:
    lo_edit              TYPE REF TO cl_crm_bol_entity,
    lo_entity            TYPE REF TO if_bol_bo_property_access,
    .

      lo_edit ?= lo_entity .

      lo_edit->switch_to_change_mode( )..

      lo_entity->set_properties(
                        is_attributes = ls_crmst_vis_bol_str
                                ).
0

Hi Tare,

Then most probably that entity type is not meant to be changed. Are you trying to change something inside a WebUI view? If so, you can redefine the GET_* method of desired attributes and do the calculations there.

Kind regards,
Garcia

1

thank you end up choosing to do it in the get, and without any problems that the client tries to order by the two columns he does not order them. I understand that the ordering is done with the existing data and the get does not exist or something like that. aora ando fighting to be able to proceed to order and followed several tutorials but without results. I need to sort the name and surname fields.

0

Hi again :)

If you know how to work with GENIL_BOL_BROWSER tcode, you can simulate your actions there.

Just select your query entity (BTQACT?), perform a search by filling selection criteria and hit the 'find' button, select an entity from result list (double click), and check which attribute property do you get for desired attributes.

You can also simulate the 'lock' action or 'change mode' to see if you're allowed. If not, you can always try to debug and find why.

Kind regards,
Garcia

1