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: 

Short-dump in FM 'COMPLEX_SELECTIONS_DIALOG'.

Former Member
0 Kudos

Hi,

I have a requirement of creating a selection-screen using module-pool programming.I'm using 'COMPLEX_SELECTIONS_DIALOG' (*ECC 6) to provide the option of multiple selection,but due to some reason i am getting a SHORT-DUMP when the user cancels the selection dialog pop-up.Below is the code used:

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'

TABLES

range = r_proj_sel.

Can anyone suggest me the best way to resolve this problem?

Thanks in advance.

Thanks

Dinesh behera

3 REPLIES 3

peter_ruiz2
Active Contributor
0 Kudos

Hi Dinesh,

When the cancel button is clicked, the FM raises an exception. You need to add an exception to avoid the dump like this.

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'

TABLES

range = r_proj_sel

EXCEPTIONS

NO_RANGE_TAB = 1

CANCELLED = 2

INTERNAL_ERROR = 3

INVALID_FIELDNAME = 4.

Regards,

Peter

0 Kudos

Hi Peter,

Thanks a lot.

It worked.

Thanks & regards

Dinesh

I355602
Advisor
Advisor
0 Kudos

Hi,

When you click the cancel button on the popup, sy-subrc is 2

So you have to hanlde when subrc is 2, include a code as per your requirement.

Refer code:-


  CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
    EXPORTING
      title             = text-002
      text              = ' '
      signed            = 'X'
      search_help       = v_shelp
      tab_and_field     = tab
    TABLES
      range             = r_range
    EXCEPTIONS
      no_range_tab      = 1
      cancelled         = 2
      internal_error    = 3
      invalid_fieldname = 4
      OTHERS            = 5.

  IF sy-subrc EQ 0.
    "your code 
  ELSEIF sy-subrc EQ 2.
    MESSAGE s899 WITH text-003. "user cancelled
  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.

Hope this helps you.

Regards,

Tarun

Edited by: Tarun Gambhir on Mar 13, 2009 11:08 AM