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: 

FREE_SELECTIONS_DIALOG in subscreen

former_member216100
Participant
0 Kudos

how I can show it in a subscreen. I saw the flag as_subscreen but it is not working and no doku !!

I need to show on 1 screen 2 times the FREE_SELECTIONS_DIALOG once with the key fields and one with the others

what do I need to do ?

where do I write the FREE_SELECTIONS_DIALOG into PAI or PBO from the subscreen ?

thanks for help (if possible with a small demo coding ??)

3 REPLIES 3

Former Member
0 Kudos

Did you try searching in WHERE USED list? For example, it is used in a subscree in include program RVBBINCO_F0C (parent RVBBINCO).

former_member216100
Participant
0 Kudos

I used

CALL FUNCTION 'FREE_SELECTIONS_INIT'

and

CALL FUNCTION 'FREE_SELECTIONS_DIALOG'

0 Kudos

Hi, it is an old post, but maybe it is helpful for others,

1. so in PBO

PROCESS BEFORE OUTPUT.

call SUBSCREEN sub1 INCLUDING 'SAPLSSEL' '1105'.


module create_dyn_sel.

PROCESS AFTER INPUT.

call SUBSCREEN sub1.

Note: if you will wirte in PBO this following, you will get problem, when you enter, the data will be lost.

module create dyn_sel

call subscreen... ...

so,. first, call and then your module.

2. in PAI.

call SUBSCREEN sub1



3.. your module now   ( module create_dyn_sel. )  any name as you wish


perform  free_selection_screen.



4. in your program, create a form ,


TYPE-POOLS:

  rsds.

DATA:

  ok_code TYPE sy-ucomm.

DATA:

  BEGIN OF gs_sel

    ,selid TYPE rsdynsel-selid

,END OF gs_sel.

START-OF-SELECTION.

  CALL SCREEN 0100.

FORM free_selection_screen.

  DATA:

    ls_pfkey TYPE rsdspfkey

   ,lt_fld   TYPE rsdsfields_t            WITH HEADER LINE

   ,lt_fldt  TYPE wcb_rsdstexts_tab  WITH HEADER LINE

   ,lt_rng   TYPE rsds_trange          WITH HEADER LINE.

* field list

  CLEAR lt_fld.

  lt_fld-tablename = 'T001W'.

  lt_fld-fieldname = 'WERKS'.

  APPEND lt_fld TO lt_fld.

  lt_fld-tablename = 'MARA'.

  lt_fld-fieldname = 'MATNR'.

  APPEND lt_fld TO lt_fld.

  lt_fld-tablename = 'BKPF'.

  lt_fld-fieldname = 'BLDAT'.

  APPEND lt_fld TO lt_fld.

* custom field names for select-options

  CLEAR lt_fldt.

  lt_fldt-tablename = 'BKPF'.

  lt_fldt-fieldname = 'BLDAT'.

  lt_fldt-text      = 'Validity Period'.

  APPEND lt_fldt TO lt_fldt.

  ls_pfkey-program = sy-repid.

  IF gs_sel-selid IS INITIAL.

    CALL FUNCTION 'FREE_SELECTIONS_INIT'

      EXPORTING

        kind                           = 'F'

*       EXPRESSIONS                    =

*       FIELD_RANGES_INT               =

*       FIELD_GROUPS_KEY               =

*       RESTRICTION                    =

*       ALV                            =

*       CURR_QUAN_PROG                 = SY-CPROG

*       CURR_QUAN_RELATION             =

      IMPORTING

        selection_id                   = gs_sel-selid

*       WHERE_CLAUSES                  =

*       EXPRESSIONS                    =

*       FIELD_RANGES                   =

*       NUMBER_OF_ACTIVE_FIELDS        =

      TABLES

*       TABLES_TAB                     =

*       TABFIELDS_NOT_DISPLAY          =

        fields_tab                     = lt_fld[]

*       FIELD_DESC                     =

        FIELD_TEXTS                    = lt_fldt[]

*       EVENTS                         =

*       EVENT_FIELDS                   =

*       FIELDS_NOT_SELECTED            =

*       NO_INT_CHECK                   =

*       ALV_QINFO                      =

      EXCEPTIONS

        fields_incomplete              = 01

        fields_no_join                 = 02

        field_not_found                = 03

        no_tables                      = 04

        table_not_found                = 05

        expression_not_supported       = 06

        incorrect_expression           = 07

        illegal_kind                   = 08

        area_not_found                 = 09

        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.

  ENDIF.

  CHECK NOT gs_sel-selid IS INITIAL.

  CALL FUNCTION 'FREE_SELECTIONS_DIALOG'

    EXPORTING

      selection_id                  = gs_sel-selid

*     title                         =

*     frame_text                    =

*     status                        = 1

*     AS_WINDOW                     = ' '

*     START_ROW                     = 2

*     START_COL                     = 2

*     NO_INTERVALS                  = ' '

*     JUST_DISPLAY                  = ' '

*     pfkey                         =

*     ALV                           = ' '

      tree_visible                  = space

*     DIAG_TEXT_1                   =

*     DIAG_TEXT_2                   =

*     WARNING_TITLE                 =

      AS_SUBSCREEN                  = 'X'

      NO_FRAME                      = 'X'

    IMPORTING

*     WHERE_CLAUSES                 =

*     EXPRESSIONS                   =

      field_ranges                  = lt_rng[]

*     NUMBER_OF_ACTIVE_FIELDS       =

    TABLES

      fields_tab                    = lt_fld[]

*     FCODE_TAB                     =

*     FIELDS_NOT_SELECTED           =

    EXCEPTIONS

      internal_error                = 1

      no_action                     = 2

      selid_not_found               = 3

      illegal_status                = 4

      OTHERS                        = 5.

ENDFORM.

*&---------------------------------------------------------------------*

*&      Module  STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE status_0100 OUTPUT.

   SET PF-STATUS '0100'.

   PERFORM free_selection_screen.

ENDMODULE.                 " STATUS_0100  OUTPUT

good luck