cancel
Showing results for 
Search instead for 
Did you mean: 

WebUI CRM Favorites per ABAP

0 Kudos

Hello Experts,

I am currently working on a UI5 App and want to display the WebUI ticket favorites of the User in my App.I already found the WCF_FAV_* tables with the favorites text and user but what I need is the link to the ticket (i.e. the ticket guid with which I can select the ticket data in the table CRMD_ORDERADM_H).

I hope you can help me with this.


Thanks,

Matthias

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Matthias,

thanks for the information about the WCF_FAV_* tables.

I did a little research, the favorite is stored in table WCF_ML_OBJECT as an BOL object.

You can use the following code to get a collection which contains the BTOrder entity for a favorite:

DATA: lr_bol          TYPE REF TO cl_crm_bol_core,

      ls_instances    TYPE crmt_genil_obj_instance,

      lt_instances    TYPE crmt_genil_obj_instance_tab,

      lr_col          TYPE REF TO if_bol_bo_col,

      ls_object       TYPE wcf_ml_object.



TRY.

    lr_bol = cl_crm_bol_core=>get_instance( ).

    lr_bol->start_up( 'BT' ).

  CATCH cx_root.

    RETURN.

ENDTRY.



SELECT SINGLE * FROM wcf_ml_object INTO ls_object. "here select with the ID from the WCF_FAV_* tables


CLEAR lt_instances.

ls_instances-object_name  = ls_object-name.

ls_instances-object_id    = ls_object-genil_id.


INSERT ls_instances INTO TABLE lt_instances.



lr_col  = lr_bol->get_access_entities( it_instances = lt_instances ).

IF lr_col IS BOUND.

ENDIF.

0 Kudos

Hi Christoph,

thank you for that. But I am don't know how I can get the Guid from the BOL object (I haven't worked with BOL objects before). If you could elaborate further.

Thanks,
Matthias

Former Member
0 Kudos


Hi Matthias,

no problem, here is the complete code:

DATA: lr_bol          TYPE REF TO cl_crm_bol_core,
      ls_instances    TYPE crmt_genil_obj_instance,
      lt_instances    TYPE crmt_genil_obj_instance_tab,
      lr_col          TYPE REF TO if_bol_bo_col,
      lv_genil_id     TYPE string,
      ls_object       TYPE wcf_ml_object,
      lr_entity       TYPE REF TO cl_crm_bol_entity,
      lv_guid         TYPE crmt_object_guid.

TRY.

    lr_bol = cl_crm_bol_core=>get_instance( ).
    lr_bol->start_up( 'BT' ).
  CATCH cx_root.
    RETURN.
ENDTRY.

SELECT SINGLE * FROM wcf_ml_object INTO ls_object. "here select with the ID from the WCF_FAV_* tables

CLEAR lt_instances.
ls_instances-object_name  = ls_object-name. "'BTOrder'.
ls_instances-object_id    = ls_object-genil_id. "lv_genil_id.

INSERT ls_instances INTO TABLE lt_instances.

lr_col  = lr_bol->get_access_entities( it_instances = lt_instances ).

IF lr_col IS BOUND.

  lr_entity ?= lr_col->get_first( ).

  IF lr_entity IS BOUND.
    lv_guid = lr_entity->get_property_as_string( iv_attr_name = 'CRM_GUID' ).
  ENDIF.
ENDIF.

Best Regards,

Christoph

0 Kudos

Hi Christoph,

thanks a lot. Now I can display the favorite tickets of my users.

Regards,

Matthias

Answers (0)