2015 Dec 24 7:23 AM
Hi Dear All,
I'm new to CRM develop. May I ask an easy question? How could I get the transaction type in method DO_INIT_CONTEXT? I need to check the transaction type to set the selection mode to single/muliple. Thank you.
BR
Jay
2015 Dec 29 3:34 PM
Hi,
you probably have to get the parent.
Try something like this:
DATA lo_current TYPE REF TO if_bol_bo_property_access.
DATA lo_entity TYPE REF TO cl_crm_bol_entity.
DATA lv_process_type TYPE CRMT_PROCESS_TYPE_DB.
lo_current = collection_wrapper->get_current( ).
lo_entity ?= lo_current. lo_entity = lo_entity->get_parent( ).
lv_process_type = lo_entity->get_property_as_string( 'PROCESS_TYPE' ).
Thx.
2015 Dec 28 7:14 PM
Hi Jay,
Can you elaborate about on which component you are working on.
Mostle you can read it from the collection wrapper of the node in TYPED_CONTEXT of the view.
code can look like as followed -
data : lr_current type ref to if_bol_bo_property_access,
lv_ttype type (Transaction type field domain).
lr_current ?= me->typed_context->(node_name)->collection_wrapper->get_current( ).
call method lr_current->get_property_as_value(
EXPORTING
iv_attr_name = (Transaction type field name in character)
IMPORTING
ev_result = lv_ttype).
Hope this might helps
2015 Dec 29 2:32 AM
Hi Ganguly,
I'm working on component PRD01QR/SearchHelpResult, as you could see it is for F4 help search result and I see that this view is shared by many components, our requirement is to add a button in the ALV toolbar to some special transaction types.
As you mentioned, to use lr_current ?= me->typed_context-(node_name)->collection_wrapper->get_current( ).
When we press F4 on BT116IT_SRVO/GenericItem, node BTADMINI, attribute STRUCT.ORDERED_PROD, we would trigger PRD01QR/SearchHelpResult. So I think here I should write lr_current ?= me->typed_context->btadminh->collection_wrapper->get_current( ). But sap informs me 'btadminh' does not exist.
Could you please give me any hint? Thank you.
BR
Jay
2015 Dec 29 3:34 PM
Hi,
you probably have to get the parent.
Try something like this:
DATA lo_current TYPE REF TO if_bol_bo_property_access.
DATA lo_entity TYPE REF TO cl_crm_bol_entity.
DATA lv_process_type TYPE CRMT_PROCESS_TYPE_DB.
lo_current = collection_wrapper->get_current( ).
lo_entity ?= lo_current. lo_entity = lo_entity->get_parent( ).
lv_process_type = lo_entity->get_property_as_string( 'PROCESS_TYPE' ).
Thx.