cancel
Showing results for 
Search instead for 
Did you mean: 

Disable ITM_TYPE field at shopping cart item level

Former Member
0 Kudos

Hi,

I have a requirement to disable field ITM_TYPE of shopping cart item for editing and I am doing it through metadata framework.

Have made the following entry in SPRO ->Extension & field control -> Configure field control -> Configure control for fields at item level \

Structure Field Name  ITM_TYPE                         Item Category

Bus. Object Type      BUS2121                          Shopping Cart

Bus. Object Subtype   0                                       Standard Business Object Subtype

Transaction Type      SHC                                  Shopping cart

Item Type             0                                          Standard Item

Item Process Type     0                                     Initial Item Process Type

Field visible   X

Field editable

Dyn. Customer Class   ZCL_ALL_ITM_DYN_STD_FLD                  dynamic class for item std fields

Dyn. Customer Method    /SAPSRM/IF_MDF_ITM_DYN_CONTROL~CHANGE_METADATA

Also added the code in method change_metadata to disable the field:

    IF iv_field_name = 'ITM_TYPE'.

      cs_metadata-enabled  = abap_false.

    ENDIF.         

This is not working and the field ITM_TYPE is still editable. Please advise a solution.

Thanks in advance,

CM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi CM,

Item type which is the product type which appears in the pop up once you add an item to the SC. We have disabled this field , such that the user cannot select Material or Service and by default we made it to material.

In order to do  that we wrote an enhancement to the webdynpro component /SAPSRM/WDC_DODC_SC_I_DES

method : WDDOMODIFYVIEW

wrote an post exit as below

  lo_nd_m_de_describe_item = wd_context->path_get_node( path = `DESCRIBE_ITEM.M_DE_DESCRIBE_ITEM` ).

     lo_el_m_de_describe_item = lo_nd_m_de_describe_item->get_element( ).

     IF lo_el_m_de_describe_item IS INITIAL.

     ENDIF.

     lo_el_m_de_describe_item->set_attribute(

       name `PRODUCT_TYPE`

       value = '' ).

This will make it uneditable in the popup

Regards,

Naveen

Former Member
0 Kudos

Dear all,

We are facing a similar issue with Item Category in a contract document. This field is available for changes in Quality environment, but unavailable in Productive and Development environment.

We would need to check the main root of the differences and where can be checked.


Any idea would be really appreciated!


Kind Regards!


Raúl

Answers (0)