cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve the Process type selected in Service Order

fernando_caceres
Explorer
0 Kudos

Hi all,

I have to set a different configuration based on the Process type of Service Order.

When the user selects Create a Service Order, a pop up shows up (configurated by customizing) where it shows differents kind of Process type. Based on the option choosen, I need to to set up differents configuration (DO_CONFIG_DETERMINATION) but I don´t know how to retrieve the data selected.

Could you help me with this please?

Thanks in advance.

Fernando.-

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fernando,

You dont need to do any coding in Do config determination. Just create a new configuration of the over view page with object type as the Process type.

When u will select the process type from the options given in the popup , the system will search for the matching object type in the available configurations and shows that on the UI. If none is available it shows the configuration with the object type as <DEFAULT>.

Hope this helps.

Regards

Vishal

Answers (2)

Answers (2)

Former Member
0 Kudos

Hii,

U can use the following code to set the your customer configuration.

Data : lr_entity        TYPE REF TO cl_crm_bol_entity,
           lv_proc_type type string.


lr_entity ?= me->typed_context->btadminh->collection_wrapper->get_current( ).
 CHECK lr_entity is BOUND.

CALL METHOD lr_entity ->get_property_as_string
      EXPORTING
        iv_attr_name = 'PROCESS_TYPE'
      RECEIVING
        rv_result    = lv_proc_type.

if lv_proc_type eq 'ZXXX' .     " Service Order Process Type 
 me->set_config_keys( iv_object_type = 'BT116H_SRVO'   " Specify your object Type
   iv_object_sub_type = 'ZXXX'
   iv_propagate_2_children = abap_true ).

endif.

Regards,

Nithish

0 Kudos

Hi Fernando

You can retrieve the process type you have selection from the popup by putting the following lines of code

in the DO_CONFIG_DETERMINATION.

DATA: lv_wrapper   TYPE REF TO cl_bsp_wd_collection_wrapper,
              lv_proc_type TYPE string,
              lv_bo_access TYPE REF TO if_bol_bo_property_access.
  CALL METHOD me->typed_context->btadminh->get_collection_wrapper
    RECEIVING
      rv_result = lv_wrapper.

  CHECK lv_wrapper IS BOUND.
  lv_bo_access ?= lv_wrapper->get_current( ).

  IF lv_bo_access IS NOT INITIAL.
    CALL METHOD lv_bo_access->get_property_as_string
      EXPORTING
        iv_attr_name = 'PROCESS_TYPE'
      RECEIVING
        rv_result    = lv_proc_type.

The variable lv_proc_type holds the process type.

Regards

Leon