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: 

Dialog programing

Former Member
0 Kudos

Hi

How to create a multiple selection field and assign 5 values to it in a dilog programming.

example.

in dialog progrming first screen i want to set default for storage location as 0001,0002,0003,0004,0005.

thanks,

Madhu

3 REPLIES 3

gopi_narendra
Active Contributor
0 Kudos

Use the FM : COMPLEX_SELECTIONS_DIALOG

see the usage below


data: begin of RAN_SP occurs 0,
        SIGN   type C length 1,
        OPTION type C length 2,
        LOW    type KUNAG,
        HIGH   type KUNAG,
      end of RAN_SP.

  call function 'COMPLEX_SELECTIONS_DIALOG'
   exporting
     TITLE                   = 'Multiple Selection for Sold-to-Party'
*   TEXT                    =
*   SIGNED                  = 'X'
     LOWER_CASE              = 'X'
*   NO_INTERVAL_CHECK       = ' '
*   JUST_DISPLAY            = ' '
*   JUST_INCL               = ' '
*   EXCLUDED_OPTIONS        =
*   DESCRIPTION             =
*   HELP_FIELD              =
*   SEARCH_HELP             =
*   TAB_AND_FIELD           =
    tables
      RANGE                   = RAN_SP
   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.

Regards

Gopi

0 Kudos

Hi

If you use programming of dynpros and you want a selection button so multriple for one of your fields (and as it happens making “SELECT-OPTION: p_field FOR table-field” in report standard), you can use this trick.




- First it creates a button in a screen and llámalo FCODE_RANGE. Pon the attribute like “Departure airfield”. Also asegurate that the visible length is of 17

- Your button Declares a global variable with he himself name that:

DATA: fcode_range (20).

- Also we needed to declare a rank to pass them detos.

   RANGES: FOR werks_ran komg-werks.
- Finally we created the routine that executes function COMPLEXE_SELECTIONS_DIALOG.


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 2 EXCEPTIONS no_range_tab = 1 cancelled = internal_error = 3 invalid_fieldname = 4 OTHERS = 5. IF sy-subrc <> 0. * MESSAGE YOU GO SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. ENDFORM. “CALL_FUNC_MULTIPLE_SELECT

Reward all helpfull answers

Regards

Pavan

Former Member
0 Kudos

hi,

u can use select-options and intialize those five values.

make use of below example

ex:

select-options : s_lifnr for lfa1-lifnr.

initialization.

*---Initializing sales organization

S_lifnr-LOW = 'R100'.

S_lifnr-OPTION = 'EQ'.

S_lifnr-SIGN = 'I'.

S_lifnr-HIGH = ' '.

APPEND S_lifnr.

S_lifnr-LOW = 'R200'.

S_lifnr-OPTION = 'EQ' .

S_lifnr-SIGN ='I'.

S_lifnr-HIGH = ' '.

APPEND S_lifnr.

S_lifnr-LOW = 'R300'.

S_lifnr-OPTION = 'EQ' .

S_lifnr-SIGN ='I'.

S_lifnr-HIGH = ' '.

APPEND S_lifnr

S_lifnr-LOW = 'R400'.

S_lifnr-OPTION = 'EQ' .

S_lifnr-SIGN ='I'.

S_lifnr-HIGH = ' '.

APPEND S_lifnr

S_lifnr-LOW = 'R500'.

S_lifnr-OPTION = 'EQ' .

S_lifnr-SIGN ='I'.

S_lifnr-HIGH = ' '.

APPEND S_lifnr