‎2009 Feb 10 11:16 AM
hi experts,
can any one suggest me how to provide select options in module pool screen.
thank you,
regards
vijay
‎2009 Feb 10 11:19 AM
‎2009 Feb 10 11:22 AM
Hi,
We can give it directly.
But we can do like this.
Get two inputfields in the screen and give name like name1-low and name1-high.
Get the values from dbtable into internal table using this name1-low and name1-high.
then use this internal table for your requirements.
Did u get it??
Hope this helps u.
Thanks.
‎2009 Feb 10 11:23 AM
hi
u can do like this
Create a selection-screen in module pool using SE38 editor
syntax
selection-screen begin of screen <screen no>.
selection-screen begin of block <block no >.
parameter : p_bukrs like ysch_des-bukrs default 'ITD', " Company Code
<any no of parameters like that >
select-options : s_schn for ysch_des-schn no intervals.
pls follow :
‎2009 Feb 10 11:24 AM
‎2009 Feb 10 11:32 AM
Hi,
Take two fields on screen first for low value and other for high value (say vbeln_low and vbeln_high) also design a button next to the high textbox for select-option button used to display popup.
Using these two input fields append a range (say r_vbeln for vbap-vbeln) for the field to be used (either in query or anywhere).
ranges : r_vbeln for vbap-vbeln.
IF NOT vbeln_high IS INITIAL.
IF NOT vbeln_low LE vbeln_high.
MESSAGE e899 WITH text-007. "high value is smaller than low value
ENDIF.
ENDIF.
r_vbeln-sign = 'I'.
r_vbeln-low = vbeln_low.
IF vbeln_high IS INITIAL.
r_vbeln-option = 'EQ'. "if user takes only a singlr value
ELSE.
r_vbeln-option = 'BT'. "if user takes both low & high value
r_vbeln-high = vbeln_high.
ENDIF.
APPEND r_vbeln. "append range
CLEAR r_vbeln.
On the button click call this FM to call a popup for select-options.
DATA : tab TYPE rstabfield.
tab-tablename = 'VBAP'.
tab-fieldname = 'VBELN'.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
title = text-002
text = ' '
signed = 'X'
* lower_case = ' '
* no_interval_check = ' '
* just_display = ' '
* just_incl = ' '
* excluded_options =
* description =
* help_field =
* search_help =
tab_and_field = tab
TABLES
range = r_vbeln
EXCEPTIONS
no_range_tab = 1
cancelled = 2
internal_error = 3
invalid_fieldname = 4
OTHERS = 5.
IF sy-subrc EQ 2.
MESSAGE s899 WITH text-003. "no value selected
ELSEIF sy-subrc <> 0 AND sy-subrc <> 2.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
This whole code will append your range r_vbeln to be used in program.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
‎2009 Feb 11 4:49 AM
Hi Tarun,
i worked the same way as you said. Im getting select-option range. But when i select the value in the button created next to high range input field it is not getting selected. Can you please accomplish my problem.
thank you
vijay
‎2009 Feb 10 11:43 AM
Hi Vijay,
In the main program, use the following code..
SELECTION-SCREEN BEGIN OF SCREEN 201 AS SUBSCREEN.
SELECT-OPTIONS : s_opt1 FOR xyz-abc,
s_opt2 FOR xyz-def.
SELECTION-SCREEN END OF SCREEN 201.
this will create a selection screen 201. call this screen in the subscreen area of the dialog screen.
if you want to display in seperate window use AS WINDOW instead of AS SUBSCREEN
Regards,
Goutham