cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new button on SC Item Overview Tool Bar

Former Member
0 Kudos

Hello,

I need to add a new button on shopping cart Item Overview screen next to the u201Cprocess all itemsu201D or u201Cdeleteu201D button and provide metadata( i.e. enable the button only in change mode) and action(I need to change some data on all SC line items when the button is clicked).

Can anyone give me some clue on how to achieve it? Iu2019m on SRM 7.0

Thanks,

Shekar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

1.Enchance the webdynpro component /SAPSRM/WDC_UI_PO_DOTC_IT

And create a button in the view layout V_PO_DOTC_BASIC.

2. IN button properties onaction create on click on that action.

3. IN method on click button code your logic.

DATA : ls_header_po TYPE bbp_pds_po_header_d,

lt_item TYPE bbpt_pd_po_item_d,

ls_pd_item TYPE bbp_pds_po_item_icu,

lt_pd_item TYPE bbpt_pd_po_item_icu,

lo_bom_po TYPE REF TO /sapsrm/if_cll_bom_po,

lo_bom_ctr TYPE REF TO /sapsrm/if_cll_bom_ctr,

lo_bo_po_adv TYPE REF TO /sapsrm/cl_pdo_bo_po_adv,

lo_bo_ctr_adv TYPE REF TO /sapsrm/cl_pdo_bo_ctr_adv,

lo_pdo TYPE REF TO /sapsrm/if_pdo_base,

lo_task_factory TYPE REF TO /sapsrm/if_cll_taskcon_factory,

lo_task_container TYPE REF TO /sapsrm/if_cll_task_container.

DATA : lx_pdo_no_authorization TYPE REF TO /sapsrm/cx_pdo_no_authorizatio,

lx_pdo_wrong_mode TYPE REF TO /sapsrm/cx_pdo_wrong_mode,

lrcl_current_controller TYPE REF TO if_wd_controller,

lrcl_message_manager TYPE REF TO if_wd_message_manager.

  • get single attribute guid

lo_el_header->get_attribute(

EXPORTING

name = `GUID`

IMPORTING

value = lv_guid ).

lv_header_guid = lv_guid.

*Get the PO details

CALL FUNCTION 'BBP_PD_PO_GETDETAIL'

EXPORTING

i_guid = lv_guid

IMPORTING

e_header = ls_header_po

TABLES

e_item = lt_item

e_account = lt_account_update.

LOOP AT lt_item ASSIGNING <fs_item>.

HERE Chnage the according to your requirement and fill into lt_pd_item.

ENDLOOP.

lo_task_factory = /sapsrm/cl_ch_wd_taskcont_fact=>get_instance( ).

IF lo_task_factory IS NOT INITIAL.

lo_task_container = lo_task_factory->get_task_container( ).

IF lo_task_container IS NOT INITIAL.

lo_bom_po = lo_task_container->get_bom_po( ).

lo_pdo = lo_bom_po->/sapsrm/if_cll_bo_mapper~get_pdo( ).

lo_bo_po_adv ?= lo_pdo.

ENDIF.

ENDIF.

CALL METHOD lo_bo_po_adv->/sapsrm/if_pdo_bo_po~update_item

EXPORTING

it_item = lt_pd_item.

CATCH /sapsrm/cx_pdo_no_authorizatio INTO lx_pdo_no_authorization .

RAISE EXCEPTION TYPE /sapsrm/cx_pdo_abort EXPORTING previous = lx_pdo_no_authorization.

CATCH /sapsrm/cx_pdo_wrong_mode INTO lx_pdo_wrong_mode .

RAISE EXCEPTION TYPE /sapsrm/cx_pdo_abort EXPORTING previous = lx_pdo_wrong_mode.

ENDTRY.

" don't forget to submit the changes

lo_pdo->submit_update( ).

Regards,

Neelima

Former Member
0 Kudos

Thanks Neelima, this is exactly what I was looking for. The lo_pdo->submit_update( ) we have at the end does updates the item table; but it appears on the screen only when I move to a different tab. I tried mapper update and refresh but doesn't work. Any idea?

Shekar

Former Member
0 Kudos

Hello Chandra,

We also had a same problem.

But let me know what your changing in item level.(Requirement).

We have given a popup for confirmation from user for saving the line item details.

Thus the screen is getting refresh and we are able to see the screen.

Regards,

Neelima

Former Member
0 Kudos

Neelima,

Thanks for the update. It was Purchasing Group I was trying to update. So, I used /sapsrm/if_pdo_do_orgdata~update_orgdata and /sapsrm/if_pdo_base->submit_update( ) to update the P group for all the lines with the first line's P group. Pop up idea may work for me as well, Can you please share?

Thanks,

Shekar

Former Member
0 Kudos

Hello,

Please you this for POP UP.

1.Enchance the webdynpro component /SAPSRM/WDC_UI_PO_DOTC_IT

And create a button in the view layout V_PO_DOTC_BASIC.

2. IN button properties onaction create on click on that action.

3. IN method on click button code your logic and create new view 'V_FILL'

in enchacement of /SAPSRM/WDC_UI_PO_DOTC_IT .

4. In this View make sure u have a button 'OK' and with message Purchase group is updating in all items

5. ON Ok button action use above to update.

CALL METHOD wd_comp_controller->mo_bom_po->/sapsrm/if_cll_bo_mapper~fire_event_refresh( ).

  • navigation

lo_wd_controller = wd_this->wd_get_api( ).

lo_wd_component = lo_wd_controller->get_component( ).

lo_window_manager = lo_wd_component->get_window_manager( ).

DATA: lv_title TYPE string.

lv_title ='Select Columns'.

CALL METHOD lo_window_manager->create_window

EXPORTING

modal = abap_true

window_name = 'W_FILL'

title = lv_title

close_button = abap_true

message_display_mode = '1'

is_resizable = abap_false

RECEIVING

window = lo_window.

lo_window->open( ).

  • ENDIF.

Answers (0)