on 02-26-2013 3:10 PM
Hi experts,
I am using the BAdi "CRM_IC_INBOX_BADI", method "XABLE_BUTTONS_FOR_SELECTION" to disable certain buttons depending on the main catagory of the row selected from the IC inbox.
The problem I have is I don't know how to use the appropriate classes / methods to obtain what I need. I should also point out were only interested in single selected rows as multiple rows are excluded.
If I place a breakpoint in the method and then select a row in the IC inbox the BAdi is triggered. The BAdi has an import parameter "I_SELECTED_INBOX_ITEMS" which is of type "CL_CRM_BOL_ENTITY_COOL" and when I click on this I can see all the attributes. The attribute I'm interested in here is "ENTITY_LIST" and If I click on ENTITY_LIST another BO reference is shown "->{0:4800*\CLASS=CL_CRM_AUI_ONEORDER} which has the attribute "GV_MAINCATEGORY" which I would like to read in. Can anyone help or offer some sample code?
Thanks in advance,
Chris
Hello, Chris.
Try something like this:
DATA: lr_item TYPE REF TO cl_crm_aui_oneorder,
lv_maincategory TYPE CRMT_AUI_MAINCAT.
try.
lr_item ?= i_selected_inbox_items->get_first( ).
lv_maincategory = lr_item->gv_maincategory. //as far as it is a public attribute
catch cx_root.
endtry.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrei and thanks that worked great.. The only thing I needed to add was the name of the interface when calling the get_first method, see below.
DATA: lr_item TYPE REF TO cl_crm_aui_oneorder,
lv_maincategory TYPE crmt_aui_maincat.
TRY.
lr_item ?= i_selected_inbox_items->if_bol_entity_col~get_first( ).
lv_maincategory = lr_item->gv_maincategory. "//as far as it is a public attribute
CATCH cx_root.
ENDTRY.
Hi,
I've been testing this and came accross an issue I need help with.
From the Agents inbox, if I search for a selection of Employee requests or interaction records and then select either of these from the resulting list the BAdi is triggered and the main catagory is retrieved. However, when I select an email I don't get a main catagory returned. When following in debug I noticed the exception CX_SY_MOVE_CAST_ERROR occurs on the code line
lr_item ?= i_selected_inbox_items->if_bol_entity_col~get_first( ).
Any help or advice would be very much appreciated,
Thanks
Chris
Hi Sigrid,
Thank you for your response. I've now added the following:
data: lr_wrkitm type ref to cl_crm_aui_entity.
lr_wrkitm ?= i_selected_inbox_items->if_bol_col_entity~get_first.
lv_maincategory = lr_wrkitm->gv_maincategory.
When I follow this in debug there is no casting error now but there isn't any value in the GV_MAINCATEGORY field like there is when processing a ONEORDER type. Have I missed something? Or is there anything else I can do?
Thanks,
Chris
Hi Sigrid,
I now understand I can't read the main category for a work item.
What I've done is to read in the item type for any work items that are selected.
data: lr_wrkitm type ref to cl_crm_aui_entity,
lv_item_type type crmt_aui_item_type.
lr_wrkitm ?= i_selected_inbox_items->if_bol_col_entity~get_first.
lv_item_type = lr_wrkitm->get_property_as_string( iv_attr_name = 'ITEM_TYPE' ).
Thanks and regards,
Chris
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.