on 08-29-2015 2:24 PM
Hi All,
We have added a custom button in WDC: /SAPSRM/WDC_UI_SC_DOTC_BD view: V_SC_DOTC_BASIC at item level next to Delete button.
Now problem is this custom field is always enabled. We need to disable the custom button when the shopping cart is opened in display mode.
How to get the mode (Display / change) while adding code to disable the button in WDDOMODIFYVIEW method?
I know the code to disable the button which is given below But I need to call this code only if the cart is opened using display mode.
DATA: lo_button TYPE REF TO cl_wd_toolbar_button.
lo_button ?= view->get_element( 'COPY' ).
lo_button->set_visible( '01' ).
lo_button ?= view->get_element( 'PASTE' ).
lo_button->set_visible( '01' ).
Regards, Sasi
I got the solution myself. Here is the code to get the transaction mode (Display/ create / edit) from view method.
DATA lo_tsk_container TYPE REF TO /sapsrm/if_cll_task_container.
DATA lv_sub_mode TYPE /sapsrm/pdo_inst_mode.
DATA lv_pdo_mode TYPE /sapsrm/pdo_inst_mode.
* Get the Transaction Mode
lo_tsk_container = wd_comp_controller->mo_task_container.
CALL METHOD lo_tsk_container->get_transaction_mode
IMPORTING ev_sub_trans_mode = lv_sub_mode
ev_pdo_trans_mode = lv_pdo_mode.
Lv_PDO_mode & lv_sub_mode will give the actual mode. Based on this, we can perform our validation.
Regards,
Sasi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shyam , I tried with metadata and it did not worked for us. Hence I did it through WDA enhancement. Can we use, meta data for custom fields too? Are you using it in your project? Also have you disabled the Paste button at item level? do you have the PDO action for PASTE button? Regards, Sasi
Hi Sasi,
Yes, we can use metadata for custom fields/actions also.
Please see if you are using correct path to maintain metadata for fields/actions - there are different nodes in SPRO for fields and actions.
Please refer below for details on Metadata handling of custom fields.
http://scn.sap.com/docs/DOC-25692
http://scn.sap.com/thread/3473863
Regarding PASTE button in SC line item, there will be action associated with it which can be configured in Metadata. You need to check in Standard Metadata for SC at item level. Currently I do not have system, so cannot provide exact name of that action.
Warm Regards,
Shyam Agrawal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.