Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9218

Re: Restrict Access to Checklist Steps in a Service Request

$
0
0

Anyway, I was able to do something by redefining the V-Getter method for the status field by adding the following code:

 

 

   DATA:   LT_PARTNER         TYPE  CRMT_PARTNER_EXTERNAL_WRKT,

           LS_PARTNER         TYPE  CRMT_PARTNER_EXTERNAL_WRK,

           lt_req_obj         TYPE crmt_object_name_tab,

           lc_action_execute  TYPE REF TO cl_action_execute,

           lt_item_guids      TYPE crmt_object_guid_tab,

           lt_requested_objects  TYPE crmt_object_name_tab,

           lv_emp_guid        type BU_PARTNER_GUID,

           lv_user            type SYUNAME.

 

   INCLUDE crm_object_names_con.

   INSERT gc_object_name-partner INTO TABLE lt_requested_objects.

 

 

   if lv_object_guid is not initial.

     INSERT lv_object_guid INTO TABLE lt_item_guids.

     CALL FUNCTION 'CRM_ORDER_READ'

       EXPORTING

         it_item_guid         = lt_item_guids

         it_requested_objects = lt_requested_objects

       IMPORTING

         ET_PARTNER           = LT_PARTNER

       EXCEPTIONS

         document_not_found   = 1

         error_occurred       = 2

         document_locked      = 3

         no_change_authority  = 4

         no_display_authority = 5

         OTHERS               = 6.

 

     loop at lt_partner into ls_partner.

       if ls_partner-PARTNER_FCT eq '00000014'.

         lv_emp_guid = ls_partner-BP_PARTNER_GUID.

       endif.

     endloop.

     if lv_emp_guid is not initial.

       CALL FUNCTION 'BP_CENTRALPERSON_GET'

         EXPORTING

           IV_BU_PARTNER_GUID  = lv_emp_guid   " GUID of a Business Partner Address

         IMPORTING

           EV_USERNAME         = lv_user  " SAP System, User Logon Name

         EXCEPTIONS

           NO_CENTRAL_PERSON   = 1

           NO_BUSINESS_PARTNER = 2

           NO_ID               = 3

           OTHERS              = 4.

       if sy-subrc <> 0.

*   message id sy-msgid type sy-msgty number sy-msgno

*              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

       endif.

 

     endif.

   endif.

   if sy-UNAME eq lv_user.

     gr_step_status_ddlb->set_selection_table( it_selection_table = lt_ddlb ).

   else.

     read table lt_ddlb into ls_ddlb index 1.

     if sy-subrc = 0.

       append ls_ddlb to lt_ddlb_tmp.

     endif.

     gr_step_status_ddlb->set_selection_table( it_selection_table = lt_ddlb_tmp ).

   endif.


Assuming that the partner function assigned to the checkpoint is Employee responsible.


Thanks,

Yordan


Viewing all articles
Browse latest Browse all 9218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>