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: 

Regarding using SUBMIT report statement for dynamic selections

Former Member
0 Kudos

Hi experts,

I am using follwing for calling FBL3N transaction and giving input and copying the output to my program.

SUBMIT rfitemgl

WITH sd_saknr IN so_hkont

WITH sd_bukrs = p_bukrs

WITH x_opsel = ''

WITH x_aisel = 'X'

WITH pa_vari = '/Z_TDS'

EXPORTING LIST TO MEMORY

AND RETURN.

The actual thing I want to pass fiscal year value also in this statement other wise the program is going to dump as huge data is fetching more than 20 lacs records.

but fiscal year is in dynamic selection in FBL3N transaction how to achieve it please help me.

Edited by: naveenkumar baikati on Oct 17, 2008 5:11 PM

1 ACCEPTED SOLUTION

former_member585060
Active Contributor
0 Kudos

Hi,

Try this code

Try as below for declaring the RSDS structures.

Add your

p_cpudt,

it_seltab to following code.

or just use my declarations for filling of the Ranges

-


TYPE-POOLS : rsds.

DATA : it_selopt TYPE rsds_selopt_t,

wa_selopt TYPE rsdsselopt.

DATA : it_frange TYPE rsds_frange_t,

wa_frange TYPE rsds_frange.

DATA : it_trange TYPE rsds_trange,

wa_trange TYPE rsds_range.

DATA : it_texpr TYPE rsds_texpr,

wa_texpr TYPE rsds_expr.

wa_trange-tablename = 'BSID'.

wa_frange-fieldname = 'CPUDT'.

wa_selopt-sign = 'I'.

wa_selopt-option = 'LE'.

wa_selopt-low = p_cpudt.

wa_selopt-high = '00000000'.

APPEND wa_selopt TO wa_frange-selopt_t.

APPEND wa_frange TO wa_trange-frange_t.

APPEND wa_trange TO it_trange.

wa_frange-fieldname = 'AUGDT'.

wa_selopt-sign = 'I'.

wa_selopt-option = 'GE'.

wa_selopt-low = p_cpudt.

wa_selopt-high = '00000000'.

APPEND wa_selopt TO wa_frange-selopt_t.

APPEND wa_frange TO wa_trange-frange_t.

APPEND wa_trange TO it_trange.

CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'

EXPORTING

field_ranges = it_trange

IMPORTING

expressions = it_texpr.

SUBMIT rfitemar VIA SELECTION-SCREEN

WITH SELECTION-TABLE it_seltab

WITH FREE SELECTIONS it_texpr

AND RETURN.

-


Reply how this code worked in ur system, with above i got 2 Active on Dynamic Selections . I did not have the values for

P_CPUDT

IT_SELTAB

So i tried with commenting that lines, u try with ur values to above code.

Tcode :- FBL5N "RFITEMAR" - Standard Report name

Regards,

Bala Krishna.

4 REPLIES 4

ThomasZloch
Active Contributor
0 Kudos

Not sure, but if you fill range SO_BUDAT with the first and last posting date of that year, you might have the same effect.

Thomas

raymond_giuseppi
Active Contributor
0 Kudos

Look at [Filling the Selection Screen of a Called Program|http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm]

So you may use a [WITH FREE SELECTION|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=withFREESELECTION&adv=false] clause (with data built from [FREE_SELECTIONS_INIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=free_selections_init&adv=false&sortby=cm_rnd_rankvalue] and [FREE_SELECTIONS_DIALOG|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=free_selections_dialog&adv=false&sortby=cm_rnd_rankvalue]) or a [WITH SELECTION-TABLE|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=withSELECTION-TABLE&adv=false&sortby=cm_rnd_rankvalue] clause.

Hint: if the dynamic criteria are select-options of a calling program you may use something like

* get report dynamic selections:
  CALL FUNCTION 'RS_REFRESH_FROM_DYNAMICAL_SEL'
       EXPORTING
            curr_report        = g_repid
            mode_write_or_move = 'M'
       IMPORTING
            p_trange           = rt_dyn_trange
       EXCEPTIONS
            not_found          = 1
            wrong_type         = 2
            OTHERS             = 3.
  IF sy-subrc NE 0.
    EXIT.
  ENDIF.
  DELETE rt_dyn_trange WHERE tablename NE 'BSID'.
  CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
       EXPORTING
            field_ranges = rt_dyn_trange
       IMPORTING
            expressions  = it_dyn_texpr[].

you could also bypass the problem by selecting the Posting date (SO_BUDAT)

Regards

BGarcia
Active Contributor
0 Kudos

Hi there,

If you're willing to try, before you call the submit statement, can you try to set the corresponding ID with your fiscal year value?

Something like this:


SET PARAMETER ID 'GJR' FIELD '2005'.
SUBMIT rfitemgl
WITH sd_saknr IN so_hkont
WITH sd_bukrs = p_bukrs
WITH x_opsel = ''
WITH x_aisel = 'X'
WITH pa_vari = '/Z_TDS'
EXPORTING LIST TO MEMORY
AND RETURN.

If it works properly, in this example, this would give the values corresponding to your selection criteria, for 2005 fiscal year.

Kind regards,

Bruno

Edited by: Bruno Garcia on Oct 17, 2008 11:58 AM

former_member585060
Active Contributor
0 Kudos

Hi,

Try this code

Try as below for declaring the RSDS structures.

Add your

p_cpudt,

it_seltab to following code.

or just use my declarations for filling of the Ranges

-


TYPE-POOLS : rsds.

DATA : it_selopt TYPE rsds_selopt_t,

wa_selopt TYPE rsdsselopt.

DATA : it_frange TYPE rsds_frange_t,

wa_frange TYPE rsds_frange.

DATA : it_trange TYPE rsds_trange,

wa_trange TYPE rsds_range.

DATA : it_texpr TYPE rsds_texpr,

wa_texpr TYPE rsds_expr.

wa_trange-tablename = 'BSID'.

wa_frange-fieldname = 'CPUDT'.

wa_selopt-sign = 'I'.

wa_selopt-option = 'LE'.

wa_selopt-low = p_cpudt.

wa_selopt-high = '00000000'.

APPEND wa_selopt TO wa_frange-selopt_t.

APPEND wa_frange TO wa_trange-frange_t.

APPEND wa_trange TO it_trange.

wa_frange-fieldname = 'AUGDT'.

wa_selopt-sign = 'I'.

wa_selopt-option = 'GE'.

wa_selopt-low = p_cpudt.

wa_selopt-high = '00000000'.

APPEND wa_selopt TO wa_frange-selopt_t.

APPEND wa_frange TO wa_trange-frange_t.

APPEND wa_trange TO it_trange.

CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'

EXPORTING

field_ranges = it_trange

IMPORTING

expressions = it_texpr.

SUBMIT rfitemar VIA SELECTION-SCREEN

WITH SELECTION-TABLE it_seltab

WITH FREE SELECTIONS it_texpr

AND RETURN.

-


Reply how this code worked in ur system, with above i got 2 Active on Dynamic Selections . I did not have the values for

P_CPUDT

IT_SELTAB

So i tried with commenting that lines, u try with ur values to above code.

Tcode :- FBL5N "RFITEMAR" - Standard Report name

Regards,

Bala Krishna.