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: 

about select-option

Former Member
0 Kudos

hi, eveybody.

I want to create a input box has the function like select-option in dynpro screen. How I can do it?

As the SAP automatically offer many code for select-optons. How can I realize the same function in the screen.

Hope you can give me any suggestion, or sample.

Thanks a lot

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Thanks to Poornanand Mandalika.

But I had try this way, but it looks like the select-option screen can be include as a subscreen. So the system throw a error to me.

Durairaj Athavan Raja, as you mentioned the function COMPLEX_SELECTIONS_DIALOG. Can you give me a more detail explain on it, and how to use it? Thanks a lot

9 REPLIES 9

Former Member
0 Kudos

Hi zhenglin gu ,

Pl go thro' the SAP demo program, <u><b>demo_dynpro_module</b></u>. It will help to solve your problem.

Regards

Elini.P

Former Member
0 Kudos

Thanks for you reply.

But in the Demo, it just a search help, not a select-options.

What I want is the mutiple select and sign select like select-option offer.

How can I do it?

Maybe I can define a select-option screen, and call subscreen in the main screen, will it sucessful?

0 Kudos

You can use the following function module.

COMPLEX_SELECTIONS_DIALOG

If you want to know how to use this function do let us know.

Regards

Raja

0 Kudos

Hello Zhengln,

I would recommend using the subscreen area and calling a user-defined selection-screen in that subscreen. I think that's the best approach.

Regards,

Anand Mandalika.

Former Member
0 Kudos

Thanks to Poornanand Mandalika.

But I had try this way, but it looks like the select-option screen can be include as a subscreen. So the system throw a error to me.

Durairaj Athavan Raja, as you mentioned the function COMPLEX_SELECTIONS_DIALOG. Can you give me a more detail explain on it, and how to use it? Thanks a lot

0 Kudos

Hi Zhenglin,

I did not undertsand what error you're getting when you include the selection screen as the subscreen. could you please elaborate what exactly you're trying to do?

The function Module in question has got a very detailed documentation. Did you read that ?

Regards,

Anand Mandalika.

0 Kudos

As Anand had said the FM has a detailed documentation.

<b><u>How to use it:</u></b>

Lets say you have a field(e.g cost center) in the screen and you just want to have multiple selection for the field.

place an input field in the screen and place an icon next to it. on clicking the icon call this FM like below.

 
data: wf_tab_field like rstabfield occurs 0 with header line ,
      wf_exl_opt like rsoptions .
ranges: r_kostl for csks-kostl .
move: 'KOSTL' to wf_tab_field-fieldname ,
          'CSKS' to wf_tab_field-tablename .
    append wf_tab_field .
    clear wf_tab_field .
   
move: 'X' to wf_exl_opt-bt ,
          'X' to wf_exl_opt-cp ,
          'X' to wf_exl_opt-ge ,
          'X' to wf_exl_opt-gt ,
          'X' to wf_exl_opt-le ,
          'X' to wf_exl_opt-lt ,
          'X' to wf_exl_opt-nb ,
          'X' to wf_exl_opt-np .

 call function 'COMPLEX_SELECTIONS_DIALOG'
     exporting
       title                   = 'Select Cost Centers'
       text                    = 'Cost Center'
*         SIGNED                  = 'X'
*         LOWER_CASE              = ' '
*         NO_INTERVAL_CHECK       = ' '
*         JUST_DISPLAY            = ' '
*         JUST_INCL               = ' '
        excluded_options        = wf_exl_opt
*         DESCRIPTION             =
        help_field              = 'CSKS-KOSTL'
*          SEARCH_HELP             = 'KOST'
        tab_and_field           = wf_tab_field
      tables
        range                   = r_kostl
     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.

Entered values will be returned in r_kostl.

Hope this is clear.

Regards

Raja

Former Member
0 Kudos

I defined a select-option screen like following:

SELECTION-SCREEN BEGIN OF SCREEN 0123 AS WINDOW TITLE TEXT-456.

SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-BL1 NO INTERVALS.

SELECT-OPTIONS S_BUKRS2 FOR T001-BUKRS.

SELECTION-SCREEN END OF BLOCK BL2.

SELECTION-SCREEN END OF SCREEN 0123.

and draw a subscreen control named 'AREA1' in the main screen, and

CALL SUBSCREEN: AREA1 INCLUDING SY-REPID '0123'.

in the PBO

But system throw me a errormessage.

And about the COMPLEX_SELECTIONS_DIALOG, where I can find the detail document about how to call it?

Thanks to all response.

0 Kudos

Hi,

I think I get what your problem is. Your selection screen is not defined as a subscreen. Consider the following declaration.

SELECTION-SCREEN BEGIN OF SCREEN 0123 AS SUBSCREEN.
  SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME 
                                      TITLE TEXT-BL1 NO INTERVALS.
    SELECT-OPTIONS S_BUKRS2 FOR T001-BUKRS.
  SELECTION-SCREEN END OF BLOCK BL2.
SELECTION-SCREEN END OF SCREEN 0123.

Regards,

Anand Mandalika.