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

FM FREE_SELECTIONS_DIALOG

Former Member
0 Kudos
3,219

I would like the screen that is produced by the FM FREE_SELECTIONS_DIALOG integrated on my selection screen as a subscreen below the input parameters. AS_SUBSCREEN parameter of this FM doesn't work as I expect it. AS_WINDOW parameter of FM covers-up original sel. scn, even when setting start_row/start_col. Any suggestion?

Your help is greatly appreciated.

Kind Regards,

Jason

Message was edited by:

Jason DeLuca

6 REPLIES 6

Former Member
0 Kudos
1,030
chk this 


*     Init free selection dialog
      call function 'FREE_SELECTIONS_INIT'
           exporting
                expressions  = it_expr
           importing
                selection_id = w_selid
                expressions  = it_expr
           tables
                tables_tab   = it_tables
           exceptions
                others       = 1.
    endif.

*   Display free selection dialog
    call function 'FREE_SELECTIONS_DIALOG'
         exporting
              selection_id            = w_selid
              title                   = 'Selection'
              status                  = 1
              as_window               = 'X'
         importing
              expressions             = it_expr
              field_ranges            = it_ranges
              number_of_active_fields = w_active
         tables
              fields_tab              = it_fields
         exceptions
              others                  = 1.

Former Member
0 Kudos
1,030

also check the documentation of this FM , its very good

Former Member
0 Kudos
1,030

Check <b>RSDBSPDS </b> RSDBRUNT help: Dynamic Seelctions Program..

Regards,

Santosh

former_member184158
Active Contributor
0 Kudos
1,030

Hello bhawit kumar

I have tried many times without success, I can build a dynamic selection screen but the problem I can not get the values, and if I get them , I get them not correctly, some missing, some not converted like Popup.

In SAP Doc,  Dialog for entering dynamic selections as subscreen is not implemented.

any suggest?

Regards.

Ibrahim

0 Kudos
1,030

Hi Ibrahim,

I have used the following code to extract the values from the dynamic selection screen implemented as the subscreen and convert it into a where clause and it works totally fine.

Please find below the sample code. Kindly let me know if you need any more inputs.

CALL FUNCTION 'FREE_SELECTIONS_INIT'
  EXPORTING
    kind                 = 'T'
  IMPORTING
    selection_id         = v_selid
  TABLES
    tables_tab           = i_tables
  EXCEPTIONS
    fields_incomplete    = 1
    fields_no_join       = 2
    field_not_found      = 3
    no_tables            = 4
    table_not_found      = 5
    expression_not_supported = 6
    incorrect_expression = 7
    illegal_kind         = 8
    area_not_found       = 9
    inconsistent_area    = 10
    kind_f_no_fields_left= 11
    kind_f_no_fields     = 12
    too_many_fields      = 13
    dup_field            = 14
    field_no_type        = 15
    field_ill_type       = 16
    dup_event_field      = 17
    node_not_in_ldb      = 18
    area_no_field        = 19
    OTHERS               = 20.

IF sy-subrc <> 0.

  MESSAGE e000 WITH 'Error in dynamic selection for table:'(019) p_tab.

ENDIF.

  CALL FUNCTION 'FREE_SELECTIONS_DIALOG'

    EXPORTING

      selection_id    = v_selid

      title           = 'Select WHERE criteria'(020)

      as_window       = ' '

*     start_row       = 7

*     start_col       = 10

*     tree_visible    = space

*     no_intervals    = 'X'

      as_subscreen    = 'X'

*no_frame        = 'X'

    IMPORTING

      field_ranges    = i_ranges

    TABLES

      fields_tab      = i_fields

    EXCEPTIONS

      internal_error  = 1

      no_action       = 2

      selid_not_found = 3

      illegal_status  = 4

      OTHERS          = 5.

  IF sy-subrc NE 0.

* Do nothing

  ENDIF.

* prepare the where clause

  CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_WHERE'

    EXPORTING

      field_ranges  = i_ranges

    IMPORTING

      where_clauses = i_where.

  READ TABLE i_where ASSIGNING <fs_where> INDEX 1.

  IF sy-subrc = 0.

    LOOP AT <fs_where>-where_tab ASSIGNING <fs_where_line>.

      CONCATENATE v_where_clause <fs_where_line>-line INTO v_where_clause

      SEPARATED BY space.

    ENDLOOP.

  ENDIF.

former_member184158
Active Contributor
0 Kudos
1,030

Hi bhawit kumar,

thank you for reply, but I have tried many times without success, for example, Matnr , when you enter 'test' ,it will not be converted  to upper case, or when you enter 123, the conversion exit wont work.

look to this FM please

FREE_SELECTIONS_DIALOG

FORM GET_VALUES CHANGING P_SUBRC LIKE SY-SUBRC.

data l_fill like sy-tfill.

 
describe table current_info-field_sel lines l_fill.

 
clear gl-screens_init.
 
PERFORM DYNS_SET_STATUS(RSDBRUNT) USING 'X' 'SAPLSSEL'.

 
SYSTEM-CALL SSCR_HELP_INDEX 999999999.

 
IF GL-KIND = SPACE and as_sub eq space.* Fullscreen.
    
perform call_fullscreen using gl-no_intervals
                            
changing p_subrc.
 
ELSEIF GL-KIND ne space and as_sub eq space.* Popup
    
perform call_popup using gl-no_intervals g_flag_alv p_subrc.
 
endif.*  P_SUBRC = SY-SUBRC.
 
SYSTEM-CALL SSCR_HELP_INDEX 0.

 
PERFORM DYNS_SET_STATUS(RSDBRUNT) USING SPACE SPACE.

 
IF P_SUBRC = 0 .
   
PERFORM FILL_FIELD_SEL_FROM_SELOPTS
           
CHANGING CURRENT_INFO-FIELD_SEL
                     CURRENT_INFO
-ACTNUM.
 
ENDIF.
ENDFORM.


It means, it is not supported for subscreen.


so if it works with you, could you pleaes send me just an Example as screenshot, just Material in Textfield und enter , when press enter, it should be converted (Conv_EXIT) from SAP.


Regards

Ibrahim