Problem solve Get help with specific problems with your technologies, process and projects.

Multiple selections for screen fields

Here's a tip if you use dialog programming and you want to use a multiple selection button for one of your screen field.

If you use dialog programming and want to use a multiple selection button for one of your screen field (just like...

if you where doing a "SELECT-OPTION: p_field FOR table-field" in a standard report), this tip is for you. The code was written in 4.6C and should work in earlier versions where this function exists.


- First crate a pushbutton in your screen and call it FCODE_RANGE. Set his attribute as "Output field". Also make sure it as a "Visible Length" of 17 (don't worry it will be automatically shorten during the process).

- Then we need to declare a GLOBAL variable of the same name of your pushbutton: DATA: fcode_range(20).

- We also need to declare a range to pass the data in the multiple selection screens (in this example a range for plants).
RANGES: werks_ran FOR komg-werks.

- Finally we create a form that will execute the COMPLEXE_SELECTIONS_DIALOG function.
FORM call_func_multiple_select.

  DATA: struc_tab_and_field TYPE rstabfield.

  struc_tab_and_field-fieldname = 'WERKS'.
  struc_tab_and_field-tablename = 'KOMG'.
  CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
    EXPORTING
*     TITLE                   = ' '
      text                    = 'Plans'
*     SIGNED                  = 'X'
*     LOWER_CASE              = ' '
*     NO_INTERVAL_CHECK       = ' '
*     JUST_DISPLAY            = ' '
*     JUST_INCL               = ' '
*     EXCLUDED_OPTIONS        =
*     DESCRIPTION             =
*     HELP_FIELD              =
*     SEARCH_HELP             =
      tab_and_field           = struc_tab_and_field
    TABLES
      range                   = werks_ran
    EXCEPTIONS
      no_range_tab            = 1
      cancelled               = 2
      internal_error          = 3
      invalid_fieldname       = 4
      OTHERS                  = 5.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " CALL_FUNC_MULTIPLE_SELECT

This was last published in March 2003

Dig Deeper on SAPscript and Smart Forms

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchHRSoftware

Close