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

Error while passing Free selections to standard program

Former Member
0 Likes
1,013

I am submitting a standard program fagl_account_items_gl and trying to pass the free selections of the LDB . However it does not seem to work for the program fagl_account_items_gl.

Listed below is the code i am using. Need help on this one.

REPORT ZTEST MESSAGE-ID ab

LINE-SIZE 180

LINE-COUNT 80(1)

NO STANDARD PAGE HEADING.

START-OF-SELECTION.

TYPE-POOLS rsds.

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.

DATA trsparams TYPE TABLE OF rsparams.

DATA r_bukrs TYPE RANGE OF t001-bukrs.

DATA rsparams LIKE LINE OF r_bukrs.

trange_line-tablename = 'SKB1_FS'.

trange_frange_t_line-fieldname = 'MITKZ'.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'EQ'.

trange_frange_t_selopt_t_line-low = 'D'.

APPEND trange_frange_t_selopt_t_line TO trange_frange_t_line-selopt_t.

trange_frange_t_line-fieldname = 'MITKZ'.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'EQ'.

trange_frange_t_selopt_t_line-low = 'K'.

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.

rsparams-sign = 'I'.

rsparams-option = 'EQ'.

rsparams-low = 'CH99'.

APPEND rsparams TO r_bukrs.

SUBMIT fagl_account_items_gl

VIA SELECTION-SCREEN

WITH FREE SELECTIONS texpr

WITH sd_bukrs IN r_bukrs

WITH rldnr EQ 'ST'

AND RETURN.

4 REPLIES 4
Read only

JozsefSzikszai
Active Contributor
0 Likes
698

hi Gerson,

this is quite tricky... the SUBMIT has to look like:

SUBMIT fagl_account_items_gl

WITH sd_bukrs IN lr_bukrs[]

WITH sd_saknr IN lr_saknr[]

WITH so_budat BETWEEN lv_datvon AND

lv_datbis

WITH x_opsel EQ ' '

WITH x_clsel EQ ' '

WITH x_aisel EQ 'X'

WITH pa_vari EQ p_vari1

WITH so_waers IN lr_waers[]

WITH fs_dyns EQ lw_dyns

WITH fs_num EQ lv_num

WITH fs_field EQ lt_field

AND RETURN.

important is the bold part. These parameters are not visible on the selection screen, but you'll find them in the program, you have to assign values acc. to their structure (I can insert here the related coding, if necessary.)

hope this helps

ec

Read only

0 Likes
698

Hi Eric,

I have got the same issue when I tried to use Free selection. Could you please let me know the code which you have developed for using free selection with fs_dyns?

Thanks,

Kumaran

Edited by: Kumaran Rajendran on Mar 26, 2008 5:32 PM

Read only

0 Likes
698

Hi Erik,

I have got the same issue when I tried to use Free selection. Could you please let me know the code which you have developed for using free selection with fs_dyns?

Thanks,

Kumaran

Read only

Former Member
0 Likes
698

After days of fighting this I finally have it working

I did not need the fields table sent.

SUBMIT fagl_account_items_gl

WITH SELECTION-TABLE lt_select

WITH fs_dyns EQ le_dyns

WITH fs_num EQ '2'

AND RETURN.

I always have 2 fields so I just hard coded the number 2

  • Fill ranges for dynamic selections

le_ranges-tablename = 'BSIS_FS'.

le_frange-fieldname = 'PROJK'.

le_selopt-sign = 'I'.

le_selopt-option = 'EQ'.

  • Convert to internal number

CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'

EXPORTING

input = le_alv-posid

IMPORTING

output = lv_pspnr.

le_selopt-low = lv_pspnr.

APPEND le_selopt TO le_frange-selopt_t.

APPEND le_frange TO le_ranges-frange_t.

APPEND le_ranges TO le_dyns-trange.

REFRESH: le_frange-selopt_t,

le_ranges-frange_t.

le_ranges-tablename = 'FAGLFLEXA_FS'.

le_frange-fieldname = 'RFAREA'.

le_selopt-sign = 'I'.

le_selopt-option = 'EQ'.

le_selopt-low = le_alv-fkber.

APPEND le_selopt TO le_frange-selopt_t.

APPEND le_frange TO le_ranges-frange_t.

APPEND le_ranges TO le_dyns-trange.

  • Fill dynamic selections table

CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'

EXPORTING

field_ranges = le_dyns-trange

IMPORTING

expressions = le_dyns-texpr

EXCEPTIONS

OTHERS = 0.

  • Set Clauses for select

le_where-tablename = 'BSIS_FS'.

CONCATENATE '(' 'PROJK' 'EQ' '''' lv_pspnr '''' ')'

INTO le_wherecls

SEPARATED BY space.

APPEND le_wherecls TO le_where-where_tab.

APPEND le_where TO lt_where.

le_where-tablename = 'FAGLFLEXA_FS'.

CONCATENATE '(' 'RFAREA' 'EQ' '''' le_alv-fkber '''' ')'

INTO le_wherecls

SEPARATED BY space.

APPEND le_wherecls TO le_where-where_tab.

APPEND le_where TO lt_where.

APPEND LINES OF lt_where TO le_dyns-clauses.

I hope this helps.

I did not include the code for building the SELECTION-TABLE that was the easy part.