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: 

Submit report with dynamic selections

Former Member
0 Kudos

Hi All,

I am trying to Submit a report with dynamic selections. I am using the option SUBMIT REPORT WITH FREE SELECTIONS.

But the dynamic selections are not getting passed.

Request you to kindly provide some inputs

My code is

DATA: trange TYPE rsds_trange,

trange_line LIKE LINE OF trange,

trange_frange_t_line LIKE LINE OF trange_line-frange_t,

trange_frange_t_selopt_t_line LIKE LINE OF trange_frange_t_line-selopt_t,

texpr TYPE rsds_texpr.

trange_line-tablename = 'PA0002'.

*trange_frange_t_line-tablename = 'PA0002'.

trange_frange_t_line-fieldname = 'GBJHR'.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'EQ'.

trange_frange_t_selopt_t_line-low = '1987'.

trange_frange_t_selopt_t_line-high = '1987'.

APPEND trange_frange_t_selopt_t_line TO trange_frange_t_line-selopt_t.

APPEND trange_frange_t_line TO trange_line-frange_t.

APPEND trange_line TO trange.

CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'

EXPORTING

field_ranges = trange

IMPORTING

expressions = texpr.

submit RPCADVQ0

VIA SELECTION-SCREEN

WITH SELECTION-TABLE rspar_tab

WITH FREE SELECTIONS it_texpr

and returN.

Kindly provide your inputs

Regards

Reshma

2 REPLIES 2

Former Member
0 Kudos

Hi Reshma,

Use the FM - RS_REFRESH_FROM_DYNAMICAL_SEL before FREE_SELECTIONS_RANGE_2_EX.


  data: trange  type rsds_trange,
          g_repid type sy-repid.

g_repid = 'RPCADVQ0'.
  call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
    exporting
      curr_report        = g_repid
      mode_write_or_move = 'M'
    importing
      p_trange           = trange
    exceptions
      not_found          = 1
      wrong_type         = 2
      others             = 3.
  if sy-subrc eq 0.
" Do the changes to the trange

CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
EXPORTING
field_ranges = trange
IMPORTING
expressions = texpr.

submit RPCADVQ0
VIA SELECTION-SCREEN
WITH SELECTION-TABLE rspar_tab
WITH FREE SELECTIONS it_texpr
and returN.
endif.

Cheers,

Kothand

Former Member
0 Kudos

hai,

data: trange type rsds_trange.

call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'

exporting

curr_report = sy-repid

mode_write_or_move = 'M'

importing

p_trange = trange

exceptions

not_found = 1

wrong_type = 2

others = 3.

if sy-subrc eq 0.

shan.