Application Development 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: 

Interval in the module pool selection screen

Former Member
0 Kudos

Hi Experts,

I am creating selection screen in module pool program. I know how to set search help for each field.

But if I have select-options like fields, how can I have "Interval button". Is there any fuction module for that? should I use ranges?

Thanks and regards,

Venkat

1 ACCEPTED SOLUTION

I355602
Advisor
Advisor
0 Kudos

Hi,

Follow these steps:-

To implement select-options in module pool, first design two input/output fields (textboxes) for the low and high value of the field and name it as <field_name>-low and <field_name>-high.

Create a button next the high value textbox and keep its sutaible function code.

Now, to call the pop-up on this button click, we have to call the same pop-up as in standard select-options. For this we have to use the function module COMPLEX_SELECTIONS_DIALOG.

For this FM we have to pass the table name, field name and the range for the field whose range needs to fill when using the popup screen.

To pass the table name and field name details into the FM, we have to declare as:


DATA : tab TYPE rstabfield.

This structure comprises of table name and field name.

Pass these details in program as:-

u2003
*-- clear table and field details
  CLEAR tab.

*-- append for range depending on the button clicked
*   either for sales order or line item
  CASE sy-ucomm.
    WHEN 'VBELN'.
      tab-tablename = 'VBAP'.
      tab-fieldname = 'VBELN'.

*--To call the popup screen for the field use code:-
  CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
    EXPORTING
      title             = text-002  u201Ctitle text
      text              = ' '
      signed            = 'X'
      search_help       = v_shelp u201Csearch help if required
      tab_and_field     = tab u201Ctable and field name details
    TABLES
      range             = r_vbeln u201Crange for the associated field
    EXCEPTIONS
      no_range_tab      = 1
      cancelled         = 2
      internal_error    = 3
      invalid_fieldname = 4
      OTHERS            = 5.

Hope this helps you.

Regards,

Tarun

2 REPLIES 2

I355602
Advisor
Advisor
0 Kudos

Hi,

Follow these steps:-

To implement select-options in module pool, first design two input/output fields (textboxes) for the low and high value of the field and name it as <field_name>-low and <field_name>-high.

Create a button next the high value textbox and keep its sutaible function code.

Now, to call the pop-up on this button click, we have to call the same pop-up as in standard select-options. For this we have to use the function module COMPLEX_SELECTIONS_DIALOG.

For this FM we have to pass the table name, field name and the range for the field whose range needs to fill when using the popup screen.

To pass the table name and field name details into the FM, we have to declare as:


DATA : tab TYPE rstabfield.

This structure comprises of table name and field name.

Pass these details in program as:-

u2003
*-- clear table and field details
  CLEAR tab.

*-- append for range depending on the button clicked
*   either for sales order or line item
  CASE sy-ucomm.
    WHEN 'VBELN'.
      tab-tablename = 'VBAP'.
      tab-fieldname = 'VBELN'.

*--To call the popup screen for the field use code:-
  CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
    EXPORTING
      title             = text-002  u201Ctitle text
      text              = ' '
      signed            = 'X'
      search_help       = v_shelp u201Csearch help if required
      tab_and_field     = tab u201Ctable and field name details
    TABLES
      range             = r_vbeln u201Crange for the associated field
    EXCEPTIONS
      no_range_tab      = 1
      cancelled         = 2
      internal_error    = 3
      invalid_fieldname = 4
      OTHERS            = 5.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

simplify it

REPORT  z_subscreen.
TABLES t001.
SELECTION-SCREEN BEGIN OF SCREEN 9001 AS SUBSCREEN.
SELECT-OPTIONS s_bukrs FOR t001-bukrs.
SELECTION-SCREEN END OF SCREEN 9001.

START-OF-SELECTION.
  CALL SCREEN 9000.

*&---------------------------------------------------------------------*
*&      Module  status_9000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_9000 OUTPUT.
  SET PF-STATUS 'PF_9000'.
ENDMODULE.                 " status_9000  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  exit  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE exit INPUT.
  LEAVE PROGRAM.
ENDMODULE.                 " exit  INPUT

PBO

PROCESS BEFORE OUTPUT.

MODULE status_9000.

CALL SUBSCREEN sub INCLUDING sy-repid '9001'.

PAI

PROCESS AFTER INPUT.

CALL SUBSCREEN sub.

MODULE exit AT EXIT-COMMAND.

MODULE user_command_9000.