I want to write an OIF FPM WDA with initial screen as selection screen using WDR_SELECT_OPTIONS but I do not know how to correctly retrieve and pass the selected value entered in the initial screen in order to process.
In my application, I have a view V_INITIAL with usage component WDR_SELECT_OPTIONS) and V_MAIN with 2 tabs for data retrieved from selection screen in V_INITIAL. I am using OIF component.
On initial screen, I have selection input fields sales area, document type and soldto customer range. I was able to set the default value on the initial screen in the WDDOINIT of the V_INITIAL view. But after user enter value, in which method should I code so that I can get the value user entered ?
I was trying to put code in method WDDOBEFOREACTION to get the value and store in global attributes declared from component controller (See below code) but I have issue when user change default value and click button continue in initial screen without hit enter key, the value I get is still as the default value. If after user change value and hit enter key
Is it possible to use inital screen in FPM with select options? I search but could not find a similar scenario.
Here is my code:
method wddobeforeaction. "In V_INITIAL view
field-symbols:
<fval> type any,
<ls_field> type LINE OF if_wd_select_options=>tt_selection_screen_item
data: lr_helper TYPE REF TO if_wd_select_options.
data lt_fields type if_wd_select_options=>tt_selection_screen_item
lr_helper->get_selection_screen_items( IMPORTING
et_selection_screen_items = lt_fields ).
Loop at lt_fields ASSIGNING <ls_field>.
case <ls_field>-m_id.
when 'SPART'.
ASSIGN <ls_field>-m_value->* to <fval>.
wd_comp_controller->gv_sel_spart = <fval>.
when 'KUNNR'.
ASSIGN <ls_field>-mt_range_table->* to <lt_range_table>.
wd_comp_controller->gt_sel_soldto = <lt_range_table>.
when others.
endcase.
.. Later on, in process_event mehod of component controller, I check if the event is leaving initial screen, I will extract data from the input selection fields user entered.
Can someone advise is this a correct approach or should I just use a regular view for user input selection and create action to capture input value?
Please advise.
Thanks