cancel
Showing results for 
Search instead for 
Did you mean: 

Get selected items in /SAPSRM/WDC_DO_SOCO_GAF_1 when passing to GAF_2

matteo_montalto
Contributor
0 Kudos

Hi all gurus,

assuming we're quite familiar with the 4-steps process of the "Carry out sourcing" function in SRM 7;

I have to execute some tasks on item positions which have been selected in the step 1 (in webdynpro /SAPSRM/WDC_DO_SOCO_GAF_1) and passed to step 2 (webdynpro /SAPSRM/WDC_DO_SOCO_GAF_2) by means of "Next step" button press.

In order to do so, I enhanced via overwrite the method PROCESS_EVENT in the COMPONENTCONTROLLER of the wd /SAPSRM/WDC_DO_SOCO_GAF_1 in the following way:

IF  io_event->mv_event_id = 'FPM_NEXT_STEP'.
    DATA: soco           TYPE REF TO /sapsrm/cl_ch_wd_ao_soco.
    DATA: gaf1           TYPE REF TO /sapsrm/if_cll_dom_soco_gaf1.
    DATA: itab_item      TYPE table of bbp_guid.

    soco ?= wd_this->ig_componentcontroller~mo_aom_soco.

    CALL METHOD soco->/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: selected_items  TYPE /SAPSRM/T_CLL_WD_SOCO_SEARCH,
          selected_item   TYPE /SAPSRM/S_CLL_WD_SOCO_SEARCH.

    REFRESH: selected_items.

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

where the method ZR7_IF_CLL_DOM_SOCO_GAF1~GET_SELECTED_ITEMS for the object GAF1 is a custom method I made that should extract selected items in the search result table:

method ZR7_IF_CLL_DOM_SOCO_GAF1~GET_SELECTED_ITEMS.                              1
   DATA: resfield_node TYPE REF TO if_wd_context_node,
         wd_context_nodeinfo TYPE REF TO if_wd_context_node_info,
         selected_refs  TYPE WDR_CONTEXT_ELEMENT_SET ,
         single_ref     TYPE REF TO IF_WD_CONTEXT_ELEMENT,
         selected_item  TYPE /SAPSRM/S_CLL_WD_SOCO_SEARCH.

   CALL METHOD mo_wd_context->get_node_info
     receiving
       node_info = wd_context_nodeinfo. .

   CALL METHOD mo_wd_context->get_child_node
     EXPORTING
*       index      = USE_LEAD_SELECTION
       name       = 'RESULT_FIELDS'
     receiving
       child_node = resfield_node.

   CALL METHOD resfield_node->get_selected_elements
*     EXPORTING
*       including_lead_selection = ABAP_FALSE
     receiving
       set                      = selected_refs .

This solution works only in the first step1 -> step2 cycle and i don't understand why.

In example, consider the following sequence:

step1: user searches for a PR and the results table is filled with 3 item positions (because the PR has 3 positions);

step1: user selects the 2nd position and press the "NEXT STEP" button to go to step2;

Here in debug I can see the selected position has been retrieved correctly.

BUT IF:

the user go back to step1 via FPM button "PREVIOUS STEP";

redo the search and select another position;

click on the "NEXT STEP" button;

THEN I can see in debug that the RESULT_FIELDS node doesn't contain any position; it's empty.

My guess there's a sort of refresh I have to trigger in order to get it work. Could anyone please help me on this task?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Matteo,

Facing Similar Problem. Please guide.

Thanks,

Daniel C