on 08-17-2015 12:22 PM
Hi,
We are using SRM 7.0. we need to add dropdown field for company code under the shopping cart item tab ( Only for Limit Items). In the dropdown, values needs to be filled dynamically based on the instead of fixed domain values.
What are steps needs to be done ? Please explain in details.
Useful answers will be rewarded with points..
Regards,
Arunkumar B.
Hi Arunkumar,
I have implemented a similar enhancement.
Web Dynpro Component is /SAPSRM/WDC_UI_DO_LIMIT. You Need to go into enhancement mode.
Now you can:
1. Add Field BE_CO_CODE to Contect Node LIMIT_ITEM (using the Wizzard to add attributes from components of structure).
2. Add the field to the View (I have chosen a normal Input field) - if you really need it as a drop down add it as drop down by value. Make sure a (new) Action is assigned to the OnSelect Event and create it (empty for now).
3. Still in enhancement mode add a post-Exit to method WDDOMODIFYVIEW. In this post-Exit add some code that sets the value list of the drop down:
DATA: lt_co_codes TYPE wdr_context_attr_value_list,
node_limit_item TYPE REF TO if_wd_context_node,
node_info TYPE REF TO if_wd_context_node_info,
elem_limit_item TYPE REF TO if_wd_context_element,
lv_read_only TYPE xfeld.
...
node_limit_item = wd_context->get_child_node( name = wd_this->wdctx_limit_item ).
elem_limit_item = node_limit_item->get_element( ).
...
< Your logic to populate lt_co_codes >
...
node_info = node_limit_item->get_node_info( ).
node_info->set_attribute_value_set(
name = 'BE_CO_CODE'
value_set = lt_co_codes ).
< Your logic to populate LV_READ_ONLY >
elem_limit_item->set_attribute_property(
EXPORTING
attribute_name = 'BE_CO_CODE'
property = if_wd_context_element=>e_property-read_only
value = lv_read_only ).
4. Write some code that reacts on the Change of the Company code into the Action you have assigned to the OnSelect Event of the Drop Down for the Company Code. You will have to check if the Limit Item was assigned to a plant which becomes invalid if you you just change the Company code of an item. So the Plant Needs to be changed as well. What needs to be in that routine is definitely:
DATA: lv_updated.
* --- Handle Enter Event
wd_this->mo_dodm_limit->/sapsrm/if_cll_do_mapper~handle_on_enter( ).
wd_this->mo_dodm_limit->/sapsrm/if_cll_mapper~update( IMPORTING ev_update_performed = lv_updated ).
That's it
Regards
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arunkumar,
If you select a new Company Code for an item there are other fields on the same item which become invalid by asssigning the new Company code. The Plant/Location is definitely a field that needs to be changed. A Plant can only be valid for exactly one Company Code so if you Change that Company code you will have to update the plant as well, e.g. to the first Plant assigned to the new Company Code. I'm using table BBP_LOCMAP to find the new Plant.
In Addition to that you Need to tell SRM that something was changed. This can be done by
DATA: lv_updated.
* --- Handle Enter Event
wd_this->mo_dodm_limit->/sapsrm/if_cll_do_mapper~handle_on_enter( ).
wd_this->mo_dodm_limit->/sapsrm/if_cll_mapper~update( IMPORTING ev_update_performed = lv_updated ).
Regards
Oliver
Hello Arun,
first, read this wiki:
Limit Shopping Cart - Some fields or tabs are not displayed
As a consequence, you need to manage dynamic metadata for field BE_CO_CODE (check BE_CO_CODE method from /SAPSRM/CL_PDO_DYN_MDF_IT_SC class).
Regards.
Laurent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
There are three parts in your questions:
Part# 1: we need to add dropdown field for company code under the shopping cart item tab
- If multiple values are assigned in the SRM Org. Structure for any user ID under the attribute "company codes", they would appear in the SC during creation as a drop-down.
So, no additional development would be required for this task.
Part# 2: Restrict the drop-down only for Limit Items
- Take help of your ABAPer and check if any of the two BADIs help you achieve your requirement:
BBP_SC_MODIFY_UI
WD_BADI_DOMODIFYVIEW
Part# 3: In the dropdown, values needs to be filled dynamically based on the instead of fixed domain values.
- How should the values be dynamically populated ?? Let me know if the part# 1 answers this questions.
Br,
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.