cancel
Showing results for 
Search instead for 
Did you mean: 

in objects result ,if user select any object and if i click the custom button on result directly open to service request creation page in sap crm ?

former_member198180
Active Participant
0 Kudos

Hi Team,

My requirement is if user select any value in objects result page,and click zbutton on result page directly it will be opened to service request page with copy object id and partner id ? how to achieve this requirement.

when ever user click the  button directly open to service request creation page? how to do it?

and one more thing in object result view could not able to select the line in result view..there is no select field column in result view also..

Component - PRDIOQR

View - result view

Thanks in advance

Thanks & Regards

kalpana

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member198180
Active Participant
0 Kudos

Hi Team,

Still i am looking help here,Please give me any inputs ?

Thanks & Regards

kalpana

former_member198180
Active Participant
0 Kudos

Hi Team,

Stil i am looking help here,Could you please share any information to solve this issue.

Thanks & Regards

Kalpana

Former Member
0 Kudos

Hi Kalpana,

Your requirement is not clear. Can you re-phrase your question for better understanding?

You want a Create Page when you click on the button?

Thanks,

Pratheek

former_member198180
Active Participant
0 Kudos

Hi pratheek,

Thanks for your reply...My requirement is ,Objects Search and result page

1)Objects Search and result page,if user search any object ,result will come.

2) In result screen they want to create one button ,button name-Service request.

3)If we select any object in result view,if user clicks on service request button ,it will directly navigate to service request page and object_id ,partner id copy to service request creation screen,

.

For this i could not able to create button on object result page, and after creating button for navigating service request creation how to navigate while click on button.so could you please help here.

Thanks & Regards

Kalpana

former_member198180
Active Participant
0 Kudos

Hi Team,

Still i am looking help here..

I have created  Zbutton in Objects result page and if user select any line item , and user clicks that button it directly  navigate to service request creation page ..and ID partner ID copied to service request page.

For this i have created button event handler method,in zevent handler method i have written the logic.

but its not working and i could not able to navigate, service request header page...??please help?

DATA:     lr_desc_object         TYPE REF TO if_bol_bo_property_access,

                  lr_data_collection  TYPE REF TO if_bol_bo_col,

                  lr_nav                       TYPE REF TO if_crm_ui_navigation_service,

                  lr_entity                    TYPE REF TO cl_crm_bol_entity,

                  lr_core                     TYPE REF TO cl_crm_bol_core,

                  lv_guid                     TYPE crm_mktgs_guid.

*     Get the BOL Core Instance

      lr_core ?= cl_crm_bol_core=>get_instance( ).

*     Get the Root entity

      lr_entity ?= lr_core->get_root_entity( iv_object_name =  'Product'

                                                                        iv_object_guid = lv_guid  ).

      CHECK lr_entity IS BOUND.

*    Create UI based Entity

      CALL METHOD cl_crm_ui_descriptor_obj_srv=>CREATE_entity_BASED

        EXPORTING

          ir_entity           = lr_entity

          iv_ui_object_type   = 'CRM_SRQM_INCIDENT'

          iv_ui_object_action = 'D'            "display

        RECEIVING

          rr_result           = lr_desc_object.

*      Create a BOL collection to be passed to the inbound plug of

*      the Called component

      CREATE OBJECT lr_data_collection

        TYPE

          cl_crm_bol_bo_col.

*    Add the UI Descriptor the BOL Collection

      lr_data_collection->add( lr_desc_object ).

*    Get Instance of Navigation Service

      lr_nav = cl_crm_ui_navigation_service=>get_instance( ).

*    Navigate to Target Component

      IF lr_nav->is_dynamic_nav_supported( lr_desc_object ) = abap_true.

        lr_nav->navigate_dynamically( lr_data_collection ).

      ENDIF.

Thanks & Regards

Kalpana

former_member198180
Active Participant
0 Kudos

Hi Team,

Still i am looking help here,could you please provide me any solution here.

Thanks &Regards

kalpana

former_member210661
Active Contributor
0 Kudos

Hello Kalpana,

In you code how did you get lv_guid ? you just get the core class instance and empty guid you passing over there. i will not go service screen.

just go through this link in this they have mentioned how to navigate and get the selected result field guid.

****************************************

* Preparation steps

****************************************

*

* Let's get current row info

CALL METHOD cl_thtmlb_util=>get_event_info

   EXPORTING

     iv_event = htmlb_event_ex

   IMPORTING

     ev_index = lv_index.

*

CHECK lv_index IS NOT INITIAL.

* Get entity for the current row

CLEAR: lv_guid.

me->typed_context->contacts->collection_wrapper->find( iv_index = lv_index ).

TRY.

     lr_entity ?= typed_context->contacts->collection_wrapper->get_current( ).

*

*     Retrieve GUID for current activity

     IF lr_entity IS BOUND.

       lv_guid = lr_entity->get_property_as_string( iv_attr_name = 'GUID' ).

     ENDIF.

last doc see navigation using work area component repository.

and ensure you search/result view attached to business role (ex : sales pro, service pro). then only dynamic navigation will happen.

Regards,

Srinivask.

former_member198180
Active Participant
0 Kudos

HI Srinivas,

Thanks for your reply,

here problem is  ihave written the logic in Zbutton event handler like as below code,now if i click button then it is navigating to service request creation page.now this below code is navigating to service request creation page.

but problem is i want to select objects result line and if i click button then it should navigate to service request page(SRQM_INCIDENT_H) and REUSLT view page of objectid copied to service request header level BTrefobjmain attribute (-OBJECT_ID). for this how to fetch BTADMINH fields and Relations.

This objects result component is

Compoenent - PRDIOQR

Result view context node - RESULT.

so how to fetch navigated service request header page in result view. and one more problem if i select line in result table its giving dump EH_ONSELECT line number  36,

op_header (lv_event ->row_index ).

DATA:     lr_desc_object         TYPE REF TO if_bol_bo_property_access,

                  lr_data_collection  TYPE REF TO if_bol_bo_col,

                  lr_nav                       TYPE REF TO if_crm_ui_navigation_service,

                  lr_entity                    TYPE REF TO cl_crm_bol_entity,

                  lr_core                     TYPE REF TO cl_crm_bol_core,

                  lv_guid                     TYPE crm_mktgs_guid.

lr_entity ?= me_typed_context->RESULT->collection_wrapper->get_current( ).

check lr_entity is bound.

*****

*****

*******

      CALL METHOD cl_crm_ui_descriptor_obj_srv=>CREATE_entity_BASED

        EXPORTING

          ir_entity           = lr_partnernode

          iv_ui_object_type   = 'CRM_SRQM_INCIDENT'

          iv_ui_object_action = 'D'           

        RECEIVING

          rr_result           = lr_desc_object.

      CREATE OBJECT lr_data_collection  TYPE  cl_crm_bol_bo_col.

      lr_data_collection->add( lr_desc_object ).

      lr_nav = cl_crm_ui_navigation_service=>get_instance( ).

      IF lr_nav->is_dynamic_nav_supported( lr_desc_object ) = abap_true.

        lr_nav->navigate_dynamically( lr_data_collection ).

      ENDIF.

Please proivide me the solution how to do it?

Thanks & Regards

Kalpana

sumeet_gehlot
Contributor
0 Kudos

Hi Kalpana,

Use this below code.


DATA : lr_entity           TYPE REF TO cl_crm_bol_entity.

     DATA : lr_iobject          TYPE REF TO cl_crm_bol_entity.

     DATA : lv_map_srv          TYPE REF TO cl_crm_ui_object_mapping_srv.

     DATA : lr_nav_descr        TYPE REF TO if_bol_bo_property_access.

     DATA : lr_nav              TYPE REF TO if_crm_ui_navigation_service.

     DATA : lr_data_collection  TYPE REF TO if_bol_bo_col.

     DATA : lv_ui_type          TYPE bsp_dlc_object_type.

     DATA : lr_core             TYPE REF TO cl_crm_bol_core.

     DATAlv_guid             TYPE crmt_object_guid.


lr_entity ?= me_typed_context->RESULT->collection_wrapper->get_current( ).

check lr_entity is bound.

*  Get Service Request Guid

     CALL METHOD lr_entity->if_bol_bo_property_access~get_property_as_value

       EXPORTING

         iv_attr_name = 'GUID'

       IMPORTING

         ev_result    = lv_guid.

     lr_core = cl_crm_bol_core=>get_instance( ).

* Get Root entity of Service Request

     lr_entity = lr_core->get_root_entity( iv_object_name = 'BTOrder' iv_object_guid = lv_guid ).

     IF lr_entity IS BOUND.

*  Get BOR object data

       lv_map_srv = cl_crm_ui_object_mapping_srv=>get_instance( ).

       CHECK lv_map_srv IS BOUND.

       lv_ui_type = lv_map_srv->determine_ui_object_of_entity( lr_entity ).

*  Create UI based Entity

       CALL METHOD cl_crm_ui_descriptor_obj_srv=>create_entity_based

         EXPORTING

           ir_entity           = lr_entity

           iv_ui_object_type   = lv_ui_type

           iv_ui_object_action = 'B'            "display

         RECEIVING

           rr_result           = lr_nav_descr.

       CREATE OBJECT lr_data_collection

         TYPE cl_crm_bol_bo_col.

*  Add the UI Descriptor the BOL Collection

       lr_data_collection->add( lr_nav_descr ).

       lr_data_collection->insert( iv_bo = lr_entity

                                   iv_index = 2 ).

*   Get Instance of Navigation Service

       lr_nav = cl_crm_ui_navigation_service=>get_instance( me ).

*   Navigate to Target Component

       IF lr_nav->is_dynamic_nav_supported( lr_nav_descr ) = abap_true.

         lr_nav->navigate_dynamically( lr_data_collection ).

       ENDIF.

ENDIF.


Regards,

S

former_member198180
Active Participant
0 Kudos

HI Sumeet,

Thanks for your reply..in above sam code i have used in Result view page , button event hanlder,.

but problem is in object result page only Product_guid is coming in result context node, and we are not able to fetch GUID and.what ever value selected in Result view Objectid copied to service request creation page of Header level BTREFPBJMAIN -field -Objectid here we need to set that result value of objectid .

So how to set that from Object result view objectid ,partner to service request headerpage object id and sold to party?

Thanks &Regards,

kalpana

sumeet_gehlot
Contributor
0 Kudos

Hi,

I think you can get Service request from Productid


DATA :   lv_productid               TYPE comt_product_id.

   DATA :   lr_query_service      TYPE REF TO cl_crm_bol_dquery_service,

            lr_result                        TYPE REF TO if_bol_entity_col,

   lr_query_service = cl_crm_bol_dquery_service=>get_instance( 'BTQSrvReq' ). "#EC NOTEXT

*   Provide search parameters for the query

     lr_query_service->add_selection_param( iv_attr_name = 'REFOBJ_IOBJECT_ID'

                                            iv_option    = 'EQ'

                                            iv_sign      = 'I'

                                            iv_low       = lv_product_id ).

     lr_query_service->add_selection_param( iv_attr_name = 'OBJECT_TYPE'

                                            iv_option    = 'EQ'

                                            iv_sign      = 'I'

                                            iv_low       = ' BUS2000223' ).

*   Fire the query and get the result

     lr_result = lr_query_service->get_query_result( ).


lr_result will contain service request structure  CRMST_QUERY_R_SRV_REQ_BTIL using guid you can write logic to navigate .

Regards,

Sumeet

former_member198180
Active Participant
0 Kudos

Hi Sumeeth,

i have copied  above code into my event handler method, now proble

  1. lr_query_service = cl_crm_bol_dquery_service=>get_instance( 'BTQSrvReq' ). "#EC NOTEXT 
  2. *   Provide search parameters for the query 
  3.      lr_query_service->add_selection_param( iv_attr_name = 'REFOBJ_IOBJECT_ID' 
  4.                                             iv_option    = 'EQ' 
  5.                                             iv_sign      = 'I' 
  6.                                             iv_low       = lv_product_id ). 
  7.      lr_query_service->add_selection_param( iv_attr_name = 'OBJECT_TYPE' 
  8.                                             iv_option    = 'EQ' 
  9.                                             iv_sign      = 'I' 
  10.                                             iv_low       = ' BUS2000223' ). 
  11. *   Fire the query and get the result 
  12.      lr_result = lr_query_service->get_query_result( ). 
  13. lr_entity ?= lr_result->get_first( ).
  14. while lr_entity is bound.
  15. call method lr_entity->if_bol_bo_property_access~get_proeprty_as_value
  16. exporting
  17. iv_attr_name = 'PROCESS_TYPE
  18. importing
  19. ev_result = ;v_process.
  20. if lv_process = 'ZSRS'.
  21. call method lr_entity->if_bol_bo_property_access~get_proeprty_as_value
  22. exporting
  23. iv_attr_name = 'REF_PRODUCT_ID
  24. importing
  25. ev_result = ;v_product .
  26. endif.
  27. lr_entity ?= lr_result->get_next( ).
  28. endwhile.

Navigation ui path - CRM_SRQM_INCIDENT maintained.

but here problem is iam getting dump class cl_crm_bol_entity is not compaitable ,for the purpose of assignment ,with target type \class_cl_bsp_wd_value_node. .

and one more thing here the line,

lr_result = lr_query_service->get_query_result( ).

i am getting all service requests entities,with data is coming..here my requirement is ,Result view-result list -if user select any result value ,and click on zbutton(it is added on result view) what ever u selected object same obect is going to sit in service request creation page of place header level of objectid(product id)..here it is set automatically, then user enter other details manually and he will save the service request .thats it...

Navigation ui path - CRM_SRQM_INCIDENT

iv_ui_object_action - D is for create page of service request.


could you please provide me any comments here.


Thanks & Regards

Kalpana

former_member198180
Active Participant
0 Kudos

Hi Sumeeth,

Still i am looking help here ,could you please help here..

i am getting service request search and result whole data..but i want service request header page data and i need to set the set property in object value of result view value in service  request creation page of objectid.

provide me any inputs here.

Thanks & Regards

Kalpana

former_member198180
Active Participant
0 Kudos

Hi Team,

Issue solved..

Thanks sumeeth.