Thursday, August 27, 2015

DO_PREPARE_OUTPUT - CRM Web UI example


Component/View:   BT125H_TASK/TaskDetails
Logic:

typed_context will contain all context nodes in view.


    DATAlr_btstatus        TYPE REF TO cl_crm_bol_entity,
          lr_btadminh        TYPE REF TO cl_crm_bol_entity.
    DATAlv_process_type    TYPE CRMT_PROCESS_TYPE_DB.



    TRY.
    lr_btadminh ?= me->typed_context->btadminh->collection_wrapper->get_current).
    lr_btadminh->get_property_as_value(
                                    EXPORTING iv_attr_name 'PROCESS_TYPE'
                                    IMPORTING ev_result    lv_process_type ).

    lr_btstatus ?= me->typed_context->btstatus->collection_wrapper->get_current).

*   For Attachment tasks (ZATC), set status to 'Completed'
    IF lv_process_type 'ZATC'.
      lr_btstatus->set_property(
        EXPORTING
          iv_attr_name =   'ACT_STATUS'
          iv_value     =    'E0003'
      ).

    ENDIF.
      CATCH cx_root.
   ENDTRY.

No comments:

Post a Comment