cancel
Showing results for 
Search instead for 
Did you mean: 

Service request id as URL parameter ,if user clicks on URL direct Service request id search and result page will be opened with result service request id details?

former_member198180
Active Participant
0 Kudos

Hi Team,

My requirement is i want to provide URL to third party systems ,Service request id as parameter.if user clicks on URL link direct service request search id page will be opened including result of service request id details.So how to do it.Could you please help.

Thanks & regards

Kalpana

Accepted Solutions (1)

Accepted Solutions (1)

former_member198180
Active Participant
0 Kudos

Hi Team,

i have created URl  like as below.

https://ltnewcrm.lt.com/sap(bD1lbiZjPTI0MiZkPW1pbg==)/bc/bsp/sap/crm_ui_start/default.htm?

saprole=ZltSRVPRO&crm-object-keyname=OBJECT_ID&crm-object-value= 20000920&crm-object-action=A

&crm-object-type=CRM_SRQM_INCIDENT&sap-system-login-basic_auth=X&crm-ext-integration=true

view- SRQM_INCIDENT_S/IncidentSR

And i have redefined the method -  DO_INIT_CONTEXT and added below logic.but i am getting.i have commented entire logic also and deleted the method DO_INIT_CONTEXT also but its gettign dump.after view deleted enhancement then only no dump.could you please help here.

DATA: lr_qs               TYPE REF TO cl_crm_bol_query_service,

*

*             result              TYPE REF TO if_bol_entity_col,

*

*             bo_col              TYPE REF TO if_bol_bo_col,

*

*             lt_ivr_url_param  TYPE        tihttpnvp,

*             lr_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,

*

*             ls_ivr_url_param  TYPE        ihttpnvp,

*

*             lr_searchcustomer TYPE REF TO if_bol_bo_property_access,

*

*             ls_searchcustomer TYPE        crmt_bupa_il_header_search.

*

*

*  CALL METHOD cl_crm_ui_session_manager=>get_initial_form_fields

*    CHANGING

*      cv_fields = lt_ivr_url_param.

*

*  READ TABLE lt_ivr_url_param INTO ls_ivr_url_param WITH KEY name = 'crm-object-keyname'.

*

*  IF sy-subrc EQ 0.

*

*    lr_wrapper = typed_context->SEARCH->get_collection_wrapper( ).

*

*    lr_qs = cl_crm_bol_query_service=>get_instance( 'BTQSrvReq' ). " SEARCH Base Entity BTQSrvReq ' ).

*

*    lr_qs->set_property( iv_attr_name = 'OBJECT_ID' iv_value = ls_ivr_url_param-value ).

*

*    result = lr_qs->get_query_result( ).

*

*    typed_context->SEARCHRESULT->collection_wrapper->set_collection( iv_collection = result ).

*

*  ENDIF.

Thanks & regards

kalpana

former_member198180
Active Participant
0 Kudos

Hi Team,

Could you please help here.

Thanks & Regards

Kalpana

dharmakasi
Active Contributor
0 Kudos

Hi,

Try changing below 2 parameters in url.

&crm-object-action=A :remove this parameter as u want to open just search view.

&crm-object-type=CRM_SRQM_INCIDENT to  SRQM_INCIDENT_S.

Regards,

Dharmakasi.

former_member198180
Active Participant
0 Kudos

Hi Kasi,

Thanks For your reply.

i have changed for your above mentioned &crm-object-action=A :&crm-object-type=CRM_SRQM_INCIDENT to  SRQM_INCIDENT_S, now this time only service serquest id component page is opening.

if i put &crm-object-type=CRM_SRQM_INCIDENT then it is directly reflected to service request search and result.

Now i have changed URL is like as below.

http://ltnewcrm.lt.com/sap(bD1lbiZjPTI0MiZkPW1pbg==)/bc/bsp/sap/crm_ui_start/default.htm?

saprole=ZltSRVPRO&crm-object-keyname=OBJECT_ID&crm-object-value= 20000920&crm-object-action=A

&crm-object-type=CRM_SRQM_INCIDENT&sap-system-login-basic_auth=X&crm-ext-integration=true

In code line result = lr_qs->get_query_result( ).here i am getting dump

ERROR:Entry Parameter IV_QUERY_NAME of method CL_CRM_GENERIC_IL_NEW->GET_QUERY_RESULT Contains Value,which is not allowed..

Please find the below code.

  CALL METHOD cl_crm_ui_session_manager=>get_initial_form_fields

    CHANGING

      cv_fields = lt_ivr_url_param.

  READ TABLE lt_ivr_url_param INTO ls_ivr_url_param WITH KEY name = 'crm-object-value'.

  IF sy-subrc EQ 0.

    lr_wrapper = typed_context->search->get_collection_wrapper( ).

    lr_qs = cl_crm_bol_query_service=>get_instance( 'BTQSrvReq' ). " SEARCH Base Entity BTQSrvReq ' ).SEARCHRESULT Base Entity BTQRSrvReq

    lr_qs->set_property( iv_attr_name = 'OBJECT_ID' iv_value = ls_ivr_url_param-value ).

    result = lr_qs->get_query_result( ).

    typed_context->searchresult->collection_wrapper->set_collection( iv_collection = result ).

  ENDIF.

former_member198180
Active Participant
0 Kudos

Hi Team,

Still i am facing the issue  at below line i am getting Dump.Could you please help here.

  result = lr_qs->get_query_result( ).

500 SAP Internal Server Error

ERROR: Entry parameter IV_QUERY_NAME of method CL_CRM_GENERIC_IL_NEW->GET_QUERY_RESULT contains value , which is not allowed (termination: RABAX_STATE)

Thanks & regards

Kalpana

former_member198180
Active Participant
0 Kudos

Hi kasi,

i have changed the code like as below but still it doesn't work.could you please help here.

METHOD do_init_context.

*CALL METHOD SUPER->DO_INIT_CONTEXT

*    .

  .

  DATA: lr_qs               TYPE REF TO cl_crm_bol_query_service,

           result              TYPE REF TO if_bol_entity_col,

           bo_col              TYPE REF TO if_bol_bo_col,

           lt_ivr_url_param  TYPE        tihttpnvp,

           lr_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,

           ls_ivr_url_param  TYPE        ihttpnvp,

           lr_searchcustomer TYPE REF TO if_bol_bo_property_access,

           ls_searchcustomer TYPE        crmt_bupa_il_header_search.

  CALL METHOD cl_crm_ui_session_manager=>get_initial_form_fields

    CHANGING

      cv_fields = lt_ivr_url_param.

  READ TABLE lt_ivr_url_param INTO ls_ivr_url_param WITH KEY name = 'crm-object-value'.

  IF sy-subrc EQ 0.

    lr_wrapper = typed_context->SEARCH->get_collection_wrapper( ).

*    lr_qs = cl_crm_bol_query_service=>get_instance( 'BTQSrvReq' ).

*    lr_qs->set_property( iv_attr_name = 'OBJECT_ID' iv_value = ls_ivr_url_param-value ).

*     result = lr_qs->get_query_result( ).

    typed_context->SEARCHRESULT->collection_wrapper->set_collection( iv_collection = result ).

  ENDIF.

ENDMETHOD.

Thanks & regards

Kalpana

dharmakasi
Active Contributor
0 Kudos

Hi,

DATA: lr_qs               TYPE REF TO cl_crm_bol_dquery_service, "should be dynamic query reference.

           result              TYPE REF TO if_bol_entity_col,

           bo_col              TYPE REF TO if_bol_bo_col,

           lt_ivr_url_param  TYPE        tihttpnvp,

           lr_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,

           ls_ivr_url_param  TYPE        ihttpnvp,

           lr_searchcustomer TYPE REF TO if_bol_bo_property_access,

           ls_searchcustomer TYPE        crmt_bupa_il_header_search.

  CALL METHOD cl_crm_ui_session_manager=>get_initial_form_fields

    CHANGING

      cv_fields = lt_ivr_url_param.

  READ TABLE lt_ivr_url_param INTO ls_ivr_url_param WITH KEY name = 'crm-object-value'.

  IF sy-subrc EQ 0.

lr_qs ?= me->typed_context->search->collection_wrapper->get_current( ).

lr_qs->add_selection_param( iv_attr_name = 'OBJECT_ID'

                                          iv_option    = 'EQ'

                                          iv_sign      = 'I'

                                          iv_low       = ''). "pass object id value

eh_onsearch( )."call search event so that system will execute the result.

endif.

Use the above instead of all your code.

Best Regards,

Dharmakasi.

former_member198180
Active Participant
0 Kudos

HI kasi,

I have added the logic ,but it is asking EH_NORMALSEARCH is unknown.

dharmakasi
Active Contributor
0 Kudos

Hi,

I have given the method name in general way, you need to check in your corresponding component. i think this is the event name  perform_search( ) used in incident search component.

So instead of calling eh_onsearch call perform_search method so that u will get results.

If issue resolved mark it as answered.

Regards,

Dharmakasi.

former_member198180
Active Participant
0 Kudos

Hi Kasi,

Great its working fine.Thanks a lot kasi.

Thanks & regards

Kalpana

Answers (0)