‎2008 Jul 01 3:36 PM
Hello Experts,
I have a drop down list in my selection screen that is a optional parameter of the selection screen
now my requirement is if the blank is selected in drop down list than my program should run for all the values in the drop down list.it is working fine for the single value selected from the drop down.
all the values in the list should be processed in this particual case when blank is selected from the drop down list.
Please suggest as early as possible.
helpful answers would be rewarded.
Thanks,
Naveen
‎2008 Jul 01 3:43 PM
PARAMETERS:p_ftype AS LISTBOX VISIBLE LENGTH 20
DEFAULT 'F'
OBLIGATORY
USER-COMMAND type.
Initialization.
‎2008 Jul 01 3:43 PM
PARAMETERS:p_ftype AS LISTBOX VISIBLE LENGTH 20
DEFAULT 'F'
OBLIGATORY
USER-COMMAND type.
Initialization.
‎2008 Jul 01 3:45 PM
PARAMETERS:p_ftype AS LISTBOX VISIBLE LENGTH 20
DEFAULT 'F'
OBLIGATORY
USER-COMMAND type.
Initialization.
PERFORM f4_value_for_filetype.
FORM f4_value_for_filetype .
DATA: l_name TYPE vrm_id,
l_list TYPE vrm_values,
l_value LIKE LINE OF l_list.
l_value-key = c_l.
l_value-text = text-010.
APPEND l_value TO l_list.
CLEAR l_value.
l_value-key = c_f.
l_value-text = text-012.
APPEND l_value TO l_list.
CLEAR l_value.
l_name = 'P_FTYPE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_name
values = l_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
IF sy-batch = c_x.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO g_msg.
WRITE / g_msg.
STOP.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. " f4_value_for_filetype
Regards,
Rajasekhar Reddy.
‎2008 Jul 01 3:46 PM
You select query should be slightly modifed for this.
Do like this.
ranges r_range for <table-field>.
if not p_listbx is initial.
r_range-low = p_listbx.
r_range-sign = 'I'.
r_range0option = 'EQ'.
append r_range.
clear r_range.
endif.
select *
from <Table>
into table <INternal Table>
where <field1> in r_range "Instead of selection based on your list box value.
Regards,
Ravi
‎2008 Jul 01 3:48 PM
You have to design your code to handle the scenario.What I can suggest is that you populate a range table depending upon your selection screen values.
data:
r_val type range of char2,
wa_r_val like line of r_val.
wa_r_val-sign = 'I'.
wa_r_val-option = 'EQ'.
if p_param = '01'.
wa_r_val-low = '01'.
append wa-r_val to r_val.
elseif p_param = '02'.
wa_r_val-low = '02'.
append wa-r_val to r_val.
elseif p_param = space.
wa_r_val-sign = 'I'.
wa_r_val-option = 'EQ'.
wa_r_val-low = '02'.
append wa-r_val to r_val.
endif.
start-of-selection.
select * from table
into table i_tab
where field1 in r_var.
if sy-subrc = 0.
endif.