cancel
Showing results for 
Search instead for 
Did you mean: 

Assignment block should be disable if employee resposible name is not matched with log in user name

Former Member
0 Kudos

Hi i have a requirement please help me how to do this process?

The parties involved assignment block should be enabled only if the person who is responsible for processing the lead (i.e. Responsible Person) is the opening the lead.

In the below screen shot the user id who has logged in should be same as assigned in the BP given in responsible person...only then the Parties involved assignment block should be enabled. Otherwise that assignment block should be disabled.

PLEASE HELP ME HOW TO RESOLVE THIS REQUIREMENT

SEND ME DETAIL STEP BY STEP PROCUDURE

Accepted Solutions (1)

Accepted Solutions (1)

former_member205429
Contributor
0 Kudos

Anitosh,

in the view/viewset impl class where the edit button is placed , redefine the method SET_VIEW_GROUP_CONTEXT and create an instance

  IF iv_first_time EQ abap_true AND view_group_context IS INITIAL.

    IF iv_parent_context IS INITIAL.

      CREATE OBJECT view_group_context

        TYPE

          cl_bsp_wd_view_group_context.

    ELSE.

      view_group_context ?= iv_parent_context.

    ENDIF.

  ENDIF.

Then in the event handler of the edit button make the view editable

me->view_group_context->set_all_editable( ).

Then in the .htm of the view , in the chtmlb tag ,

displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller )

Try this and let me know if it works !!

Former Member
0 Kudos

i enhance the component and view BTPARTNER

then where i have to write this logic i didnt find VIEW_GROUP_CONTEXT method any where

where i can find out this method?

Former Member
0 Kudos

Hi i did same like as u mentioned

but view.htm page i am given

"<%= controller->view_group_context->is_view_in_display_mode( controller )

for display mode but its getting errors

former_member205429
Contributor
0 Kudos

view/viewset impl class where the edit button is placed , redefine the method SET_VIEW_GROUP_CONTEXT and create an instance

former_member205429
Contributor
0 Kudos

pls share the error screen shot !

Former Member
0 Kudos

in my partner.htm code is below like this please check this code which is in my ideas systems

<%@page language="abap" %>

<%@extension name="chtmlb" prefix="chtmlb" %>

<%@extension name="thtmlb" prefix="thtmlb" %>

<%

   DATA:

   lv_editlist     TYPE string,

   lv_displaymode  TYPE string.

   IF controller->view_group_context->is_view_in_display_mode( controller ) = abap_true.

     lv_editlist    = 'FALSE'.

     lv_displaymode = 'X'.

   ELSE.

     lv_editlist    = 'TRUE'.

     lv_displaymode = ' '.

   ENDIF.

%>

<chtmlb:tableExtension tableId = "ttntable"

                        layout  = "FIXED" >

   <thtmlb:areaFrameSetter toolbarButtons  = "<%= controller->gt_button_ablevel %>"

                           maxButtonNumber = "1"

                           displayMode     = "<%= lv_displaymode %>" />

   <chtmlb:configTable id                    = "Table"

                       navigationMode        = "BYPAGE"

                       onRowSelection        = "select"

                       table                 = "//BTPartner/Table"

                       width                 = "100%"

                       allRowsEditable       = "TRUE"

                       usage                 = "ASSIGNMENTBLOCK"

                       displayMode           = "<%= lv_displaymode %>"

                       headerVisible         = "FALSE"

                       personalizable        = "FALSE"

                       downloadToExcel       = "FALSE"

                       actions               = "<%= controller->gt_button %>"

                       actionsMaxInRow       = "6"

                       hasLeadSelection      = "TRUE"

                       selectionMode         = "<%= BTPartner->selection_mode %>"

                       selectedRowIndex      = "<%= BTPartner->SELECTED_INDEX %>"

                       selectedRowIndexTable = "<%= BTPartner->SELECTION_TAB %>" />

</chtmlb:tableExtension>

in this code where i have to give ur  code?

Former Member
0 Kudos

if i add u rcode in display mode

displayMode           =

"<%= controller->view_group_context->is_view_in_display_mode( controller )

former_member205429
Contributor
0 Kudos

its already there right ..

   DATA:

   lv_editlist     TYPE string,

   lv_displaymode  TYPE string.

   IF controller->view_group_context->is_view_in_display_mode( controller ) = abap_true.

     lv_editlist    = 'FALSE'.

     lv_displaymode = 'X'.

   ELSE.

     lv_editlist    = 'TRUE'.

     lv_displaymode = ' '.

   ENDIF.

%>

<chtmlb:tableExtension tableId = "ttntable"

                        layout  = "FIXED" >

   <thtmlb:areaFrameSetter toolbarButtons  = "<%= controller->gt_button_ablevel %>"

                           maxButtonNumber = "1"

                           displayMode     = "<%= lv_displaymode %>" />

   <chtmlb:configTable id                    = "Table"

                       navigationMode        = "BYPAGE"

                       onRowSelection        = "select"

                       table                 = "//BTPartner/Table"

                       width                 = "100%"

                       allRowsEditable       = "TRUE"

                       usage                 = "ASSIGNMENTBLOCK"

                       displayMode           = "<%= lv_displaymode %>"

Former Member
0 Kudos

you are saying its already there in code part of htm

then how to full fill my requirement?

can u please tellme?its very urgent requirement i need to complete.i am very new to sap crm so i am asking you please help me out how to do this?

former_member205429
Contributor
0 Kudos

anitosh,

as mentioned pls check the SET_VIEW_GROUP_CONTEXT method in IMPL class.

if its not there, pls redefine and write the code i mentioned above,

later we wil check the .htm code

Former Member
0 Kudos

i already place your code in theSET_VIEW_GROUP_CONTEXT method its generated sucussfullly without errors

and i redefine EH_ONEDITLIST event handler and drop your code there also its also sucussfully generated without errors

i am struck with .htm code only i already sent that code part to you which is in my system

in that code part where i have to mention your lines?

former_member205429
Contributor
0 Kudos

ANitosh,

Put a break point in the SET_VIEW_GROUP_CONTEXT method and in the .htm code as highlighted below

<%@page language="abap" %>

<%@extension name="chtmlb" prefix="chtmlb" %>

<%@extension name="thtmlb" prefix="thtmlb" %>

<%

   DATA:

   lv_editlist     TYPE string,

   lv_displaymode  TYPE string.

   IF controller->view_group_context->is_view_in_display_mode( controller ) = abap_true.

     lv_editlist    = 'FALSE'.

     lv_displaymode = 'X'.

   ELSE.

     lv_editlist    = 'TRUE'.

     lv_displaymode = ' '.

   ENDIF.

check whether its working ??

Answers (1)

Answers (1)

former_member205429
Contributor
0 Kudos

Anitosh,

Pls use the 'REATTACH_STATIC_OVW_VIEWS' and 'DETACH_STATIC_OVW_VIEWS'methods, to dynalically hide and change the Assignment blocks ..

insert your logic in these methods ..

Former Member
0 Kudos

Hi thanks for your input

i dont want to hide assignment block i just need to disable based on log in user is matched with employee resposible then only my assingment block willl be enable other wise means

login user is not matched with employee resposible then i want to disbale entire assignment block as disable...

please send me procedure how to do this?

through code part

former_member205429
Contributor
0 Kudos

Anitosh,

What did you mean by Enabling and Disabling an assignment block . is it that only when

log in user is matched with employee responsible,

the Parties Involved Assignment block should expand ?

in all other cases, the assignment block should be in lazy mode ??

Pls confirm ..

Former Member
0 Kudos

hi

i am explain in detail my requirement

in general lead will create and lead id will generate when lead create we wil give employee resposible name and created lead

now my requirement in webui if log in user is match with employee resposible name then only that created lead willl be able to give option to change any modification on assingment block

other wise means if log in user name not match with employee responsible then i dont want to give access to edit or do any modification on that assignment block

i just disbale all properties of assignment block ..

(this is not the case of expand and lazy)

former_member205429
Contributor
0 Kudos

Anitosh,

Can u redefine the VIEW_GROUP_CONTEXT

write the logic as below:

DATA:      lr_entity       TYPE REF TO cl_crm_bol_entity.

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

  CHECK lr_entity IS BOUND.

  if lr_entity->lock( ) = abap_true.

   me->view_group_context->set_view_editable( me ).

  endif.

u can use the below code in .htm as well

If you are using thtmlb:tableView then set the below parameters to make it editable,

                 ajaxDeltaHandling     = "TRUE"

                 allRowsEditable       = "TRUE"

for chtmlb:configTable

                    allRowsEditable       = "TRUE"

Former Member
0 Kudos

Hi thanks for ur help i am very thanks fullto you

but this assignment block is located in the component BTPARTNER

with the view PARTNER and context node table view BTPARTNER

Then where i have to write the code part for this?

please let me know i willl follow u r step