Skip to Content
avatar image
Former Member

Submit report with dynamic selections

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 24, 2008 at 11:01 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 24, 2008 at 11:08 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded