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: 
Read only

Auto generated selection screen in Modulepool program

Former Member
0 Likes
402

Hi Experts!!

How to develop/Desing auto-generated screen for accepting values from the user as criteria for database selections while running a report.

pls. guide me.

Thanks in advance

2 REPLIES 2
Read only

Former Member
0 Likes
354

Use this - two FMS-

here is the code -

FORM extended_selection.

  DATA : t_dyn    LIKE rsdsfields OCCURS 0 WITH HEADER LINE.

*Work Areas.
  DATA : wa_range  TYPE LINE OF rsds_trange,
         wa_ranget TYPE rsds_frange_t,
         wa_line   TYPE LINE OF rsds_frange_t,
         t_selopt  TYPE rsds_selopt_t.

*Fields to be Put on the dynamic selection screen
  t_dyn-tablename = 'KNA1'.
  t_dyn-fieldname = 'KUNNR'.
  APPEND t_dyn.
  CLEAR  t_dyn.

  t_dyn-tablename = 'CEPC'.
  t_dyn-fieldname = 'PRCTR'.
  APPEND t_dyn.
  CLEAR  t_dyn.

  IF ( ( g_sel IS INITIAL ) OR ( t_ranges[] IS INITIAL ) ).
*Initialize Free Selection Mode.
    CALL FUNCTION 'FREE_SELECTIONS_INIT'
         EXPORTING
              kind                     = 'F'
         IMPORTING
              selection_id             = g_sel
         TABLES
              fields_tab               = t_dyn
         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 NE 0.
      MESSAGE e717(db).
    ENDIF.
  ENDIF.

*Dialog for Selection.
  REFRESH t_ranges.
  CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
       EXPORTING
            selection_id    = g_sel
            title           = 'Extended Selection'(s12)
            as_window       = true
            start_row       = 5
            start_col       = 20
            tree_visible    = space
       IMPORTING
            field_ranges    = t_ranges
       TABLES
            fields_tab      = t_dyn
       EXCEPTIONS
            internal_error  = 1
            no_action       = 2
            selid_not_found = 3
            illegal_status  = 4
            OTHERS          = 5.
  IF sy-subrc NE 0.
    CHECK sy-subrc NE 2.
    MESSAGE e717(db).
  ENDIF.

This will create a dynamic selection screen for you. For more information u can refer to the documentations of those function mdoules.

Hope it solves ur prob.

Read only

0 Likes
354

please check following program, and its attributes and flow logic.

How to design such types of program can u please guide step by step

SAPBC410AAAS_FINAL