cancel
Showing results for 
Search instead for 
Did you mean: 

change button in sales quotation.

0 Kudos
169

Dear all,

I want to add new change button on sales Quotation and on click of that i want only few selected fields must be editable and other field must be greyed out .

Hre PO date,no.valid date i want editable. Pls suggest how to achieve this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kartik,

You can accomplish the task by following these steps:

> Add a change button/edit button to the gt_buttons table after redefining DO_PREPARE_OUTPUT method and adding this code:

     ls_button-on_click = 'edit'.

     ls_button-tooltip  = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT/EDIT' ).

     ls_button-type = cl_thtmlb_util=>gc_icon_edit_text.

     ls_button-enabled = me->view_group_context->is_view_in_display_mode( me ).

     APPEND ls_button TO gt_button.

> Create an event handler for it (You can check the standard event handler EH_ONEDIT) and add the following code to set the view as editable.

DATA:

       lo_ent  TYPE REF TO cl_crm_bol_entity,

       lo_vgc  TYPE REF TO if_bsp_wd_view_group_context,

       lo_coco TYPE REF TO cl_crm_icm__bspwdcompone7_impl.

     lo_coco ?= me->comp_controller.

     IF lo_coco IS BOUND.

       lo_ent  ?= lo_coco->typed_context->btadminh->collection_wrapper->get_current( ).

       IF lo_ent IS BOUND.

         IF lo_ent->lock( ) = abap_true.

*         Set view editable

           me->view_group_context->set_all_editable( ).

         ENDIF.

       ENDIF.

     ENDIF.

> Redefine the GET_I methods for the fields which you want to be disabled and set the rv_disabled to 'TRUE' for these fields.

Let me know if you need any further information.

Please award points if useful.

Thanks!

Viksit

0 Kudos

Thank u viksit for your reply,

i already maintain this code,

But as i have lots of fields and only few i want in edit mode so i am using,

me->view_group_context-> set_all_display_only( ).


and maintaining  FALSE in get_i of respective filed .


But display only putting all in display none is editable.


Please suggest something.




0 Kudos

Code In event is.

me->view_group_context->set_all_display_only( ).

     lr_vgc ?= view_group_context->get_dependant_vg_context( ).

     lr_vgc->set_all_display_only( ).

but when i am using like this it is not  triggering get_i method.

But,

me->view_group_context->set_all_editable( ).

     lr_vgc ?= view_group_context->get_dependant_vg_context( ).

     lr_vgc->set_all_editable( ).


but on this it is triggering.

please suggest any way to solve this one

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kartik,

Create new view configuration. Set some fields display only (as per requirement).

Set some variable in event handler of new change button. Implement DO_CONFIG_DETERMINATION in view implementation class and determine new configuration when this variable is set.