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

How to Pass values dynamically to selection screen through SUBMIT program

Former Member
0 Likes
1,677

Hi experts,

How to Pass values dynamically to selection screen (to transaction FAGLL03) through SUBMIT program.

i have tried the below code, but its not working.Please check and let know..if anything i have to add to my code.

kindly give me any suggestions.

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 = 'BSIS'. "'FAGLFLEXA_FS'.

trange_frange_t_line-fieldname = 'PRCTR'.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'EQ'.

trange_frange_t_selopt_t_line-low = l_prctr.

trange_frange_t_selopt_t_line-high = l_prctr.

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 'RS_REFRESH_FROM_SELECTOPTIONS'

EXPORTING

curr_report = l_report

  • IMPORTING

  • SP =

TABLES

selection_table = lt_params

  • EXCEPTIONS

  • NOT_FOUND = 1

  • NO_REPORT = 2

  • OTHERS = 3

CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'

EXPORTING

field_ranges = trange

IMPORTING

expressions = texpr.

ls_params-selname = 'RLDNR'.

ls_params-low = '0L'.

APPEND ls_params TO lt_params.

ls_params-selname = 'X_NORM'.

ls_params-low = 'X'.

APPEND ls_params TO lt_params.

ls_params-selname = 'SD_SAKNR-LOW'.

ls_params-low = l_acct.

APPEND ls_params TO lt_params.

LOOP AT s_bukrs INTO lwa_bukrs.

ls_params-selname = 'SD_BUKRS-LOW'.

ls_params-kind = 'S'.

ls_params-sign = lwa_bukrs-sign.

ls_params-option = lwa_bukrs-option.

ls_params-low = lwa_bukrs-low.

ls_params-high = lwa_bukrs-high.

APPEND ls_params TO lt_params.

ENDLOOP.

IF NOT l_report IS INITIAL AND lt_params[] IS NOT INITIAL.

SUBMIT (l_report) WITH SELECTION-TABLE lt_params

WITH FREE SELECTIONS texpr AND RETURN.

ENDIF.

Regards,

PLP

3 REPLIES 3
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
848

You can refer this link

link:[http://www.sapfans.com/forums/viewtopic.php?f=13&t=175884&start=0&st=0&sk=t&sd=a]

Read only

Former Member
0 Likes
848

Hello PLP Reddy,

You can simply pass values to any transaction provided you know the screen-field names;

1. Run transaction FAGLL03;

for instance you got to pass value to the screen-field G/L account; place the cursor over it->press F1->technical information(harware tools icon)->Parameter ID.

2. Copy the parameter ID;

3. Code in your program;

data:
  w_saknr type sak1-saknr.

w_saknr = 1000.

  set parameter id 'SAK' field w_saknr.
    call transaction 'FAGLL03' and skip first screen.
    commit work.
    wait up to 10 seconds.      " optional

Like-wise you can set as many paramters you want and call your desired transactions provided Parameter-ID should match.

Kind regards,

Zahack

Read only

Former Member
0 Likes
848

Can anybody help me..............