Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

getting select options in module pool screen

Former Member
0 Likes
2,292

hi experts,

can any one suggest me how to provide select options in module pool screen.

thank you,

regards

vijay

7 REPLIES 7
Read only

Former Member
0 Likes
1,433

Hi,

Check these Links..

Read only

Former Member
0 Likes
1,433

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.

Read only

Former Member
0 Likes
1,433

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 :

Read only

faisalatsap
Active Contributor
0 Likes
1,433

HI,

Please Have a look at the following Threads hope will solve out your problem,

[Select-options in module pool|;

[Select-options in a module pool screen|http://help-sap.blogspot.com/2008/11/select-options-in-module-pool-screen.html]

Kind Regards,

Faisal

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,433

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

Read only

Former Member
0 Likes
1,433

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

Read only

Former Member
0 Likes
1,433

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