cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Preferred Supplier and Supplier fields in Shopping cart

Former Member
0 Likes
634

Hi,

My requirement is to disable "Supplier" input field and "Assign Supplier" Button when the logged in user is a requestor.

Meatdata customization is not possible for this field.As one of my friend in sdn suggested to enhance the wddomodifyview method.I have placed the below code in my postexit.

  • DATA :wd_por_en TYPE REF TO cl_wd_input_field.

  • wd_por_en ?= view->get_element('FIXED_SUPPLIER').

  • CALL METHOD wd_por_en->set_enabled

  • EXPORTING

  • value = abap_false.

But what is happening is Both Supplier and Preferred Supplier fields are getting disbled since both enabled property is bound to the same attribute in the layout.What can we do to resolve this issue?

If we can achieve using authorization object,What are the steps to be followed for this?

Also using Auth obj whether it can be made disabled or only making the field invisible is possible.

Any help would be appreciated.

Thanks and Regards,

Rohini

View Entire Topic
Former Member
0 Likes

are you changing the property value of context element SUPPLIER any where in the WD enhancement?

only making the set_enabled for fixed_supplier wont disable Preferred Supplier for sure.

Former Member
0 Likes

No .Even after disabling the fixed supplier field,if I try to enable the "Preferred supplier" by coding(setting its enabled property to true),it is making both the fields as enabled

Former Member
0 Likes

is there any other enhancement involved.

this is my enhancement and it works perfectly..

1. no configurator change.

2. no meta data change

3. no role level addition

4. Only below code in the post exit of WDDOMODIFYVIEW of V_DODC_SC_I_SOS.

DATA :wd_por_en TYPE REF TO cl_wd_input_field.
  wd_por_en ?= view->get_element('FIXED_SUPPLIER').
  CALL METHOD wd_por_en->set_enabled
    EXPORTING
      value = abap_false.

DATA: wd_button type ref to CL_WD_BUTTON.
wd_button ?= view->get_element('ASSIGN_FIXED_SUPPL').
  CALL METHOD wd_button->set_enabled
    EXPORTING
      value = abap_false.

Former Member
0 Likes

Hi Soumya,

Could you please check once whether the enabled property of "Fixed Supplier" and "Preferred supplier" are bound to the same attribute(LOCAL_UI_CONTROL->Supplier)in the SRM version which you are using

Former Member
0 Likes

yes, they are bound to the same property...

can you check if your configurator has been changed?

/SAPSRM/WDCC_FPM_DODC_SC_I_SOS_W

what is the changed by name? is it SAP

Former Member
0 Likes

I checked the Component configuration.It is lastly changed by SAP only

Former Member
0 Likes

Rohani,

I still suggest you to go with the BAdi which I suggested you last time, though you can still have WDDOMODIFYVIEW method enhanced. Keeping in mind next upgrade, would you not prefer to avoid SPAU in next upgrade.

Check the following.

1. Authorization of Requestor/User- As suggested.

2. below code snippet in the BAdi

DATA: lr_view_info TYPE REF TO if_wd_rr_view.

DATA: lr_component TYPE REF TO if_wd_component.

DATA: lr_component_info TYPE REF TO if_wd_rr_component.

lr_view_info = view->if_wd_view_controller~get_view_info( ).

lv_viewname = lr_view_info->get_name( ).

lr_component = view->if_wd_controller~get_component( ).

lr_component_info = lr_comp->get_component_info( ).

lv_compname = lr_comp_info->get_name( ).

lr_uielement ?= view->get_element( 'FIXED_SUPLLIER' ).

lv_enable = ' '.

IF ( lr_uielement IS BOUND ).

TRY.

lr_uielement->set_enabled( lv_enable ).

CATCH cx_wd_context.

ENDTRY.

TRY.

lr_uielement->bind_visible( '' ).

IF ( lv_enabled = 'X' ).

lr_uielement->set_visible( '02' ).

ELSE.

lr_uielement->set_visible( '01' ).

lr_uielement->set_enabled( 'X' ).

ENDIF.

CATCH cx_wd_context.

ENDTRY.

Give us your code snippet, we will check if it has some problems

Edited by: Surender Yadav on Feb 1, 2012 5:36 PM