cancel
Showing results for 
Search instead for 
Did you mean: 

SRM 7 SOCO enhancement - from step1 to step2, how to get selected items?

matteo_montalto
Contributor
0 Kudos

Hi all gurus,

I'm enhancing the WD /SAPSRM/WDC_DO_SOCO_GAF_1, specifically my requirement is to block FPM navigation if certain conditions based on the selection are met.

Example:

An user searches for some PR in sourcing cockpit's step 1, select just a subset from the search result (say, he selects item 1 and item 3, leaving item 2 unselected).

Then press the NEXT STEP button (which is, as far as I understood, an element managed by the COMPONENTCONTROLLER)..

Let's suppose the condition we talked about is that each position of a specific PR should be selected; the example above does not meet that condition (only positions 1 and 3 are selected).

What I'd like to implement is as follows:

- if the user presses the NEXT_STEP, navigation to the newt WD is cancelled (user remains in STEP 1) and an explicative error message is raised in the message area (e.g. "all positions must be selected").

Looking for the best, effective way to do this... In particular, I have to:

-1- identify which positions have been selected when the NEXT_STEP button is pressed;

-2- implement the check based on positions (that's the easy job);

-3- raise a message into the messagearea (easy one) and STOP the process so that the user still remains into STEP 1 view (obviously, until his selection meets the specifics).

I actually overwrote via enhancement the standard PROCESS_EVENT method in the COMPONENTCONTROLLER of that Webdynpro (/SAPSRM/WDC_DO_SOCO_GAF_1), and I'm trying to get the selected lines.

IF  io_event->mv_event_id = 'FPM_NEXT_STEP'.
    DATA: test           TYPE REF TO /sapsrm/cl_ch_wd_ao_soco.
    DATA: gaf1           TYPE REF TO /sapsrm/if_cll_dom_soco_gaf1.
    DATA: selected_items TYPE WDR_CONTEXT_ELEMENT_SET. 
    DATA: selected_item  TYPE /sapsrm/s_cll_wd_soco_workarea.

    test ?= wd_this->ig_componentcontroller~mo_aom_soco.

    CALL METHOD test->/sapsrm/if_cll_ao_soco~get_dom_soco_gaf1
*  EXPORTING
*    ion_wd_set                 =
*    io_wd_view_controller      =
*    io_wd_component_controller =
      RECEIVING
        ro_dom_soco_gaf1           = gaf1.
    .
    DATA: tabselected  TYPE /SAPSRM/T_CLL_WD_SOCO_SEARCH.

    CALL METHOD gaf1->ZR7_IF_CLL_DOM_SOCO_GAF1~GET_SELECTED_ITEMS
      IMPORTING
        SELECTED_ITEMS = tabselected.

where ZR7_IF_CLL_DOM_SOCO_GAF1~GET_SELECTED_ITEMS returns the SEARCH_RESULT node of the view GAF1. This however returns the SEARCH_RESULTS table which contains ALL the positions in the Search table and not just the selected ones... I basically have to modify the get_selected_items, in order to get the selected lines, but actually don't know how and if it's possible; as far as I've seen in debug, there's no way to get the selection ... maybe it has already been cleared at this point?

Any help provided on these 3 task is highly appreciated and welcome

Accepted Solutions (0)

Answers (1)

Answers (1)

matteo_montalto
Contributor
0 Kudos

Solved! Quite a tricky solution, but it works.

Former Member
0 Kudos

Hi Matteo,

May i know what you did to refresh the fpm to fetch newly selected items after error message?

Thanks,

Daniel C