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

Parameter ID

Former Member
0 Likes
2,239

I am attempting to launch a transaction programmtically from within

an AVL report using the following code:

SET PARAMETER ID 'ACC' FIELD <salv_item_cost_element>.

SET PARAMETER ID 'BUK' FIELD <salv_item_company_code>.

SET PARAMETER ID 'PRC' FIELD <salv_item_profit_center>.

SET PARAMETER ID 'GJR' FIELD me->fiscal_year.

CALL TRANSACTION 'FAGLB03' AND SKIP FIRST SCREEN.

The transaction output reflects all the Parameter IDs except the Profit Center.

This Parameter ID is a free selection, which requires a user to navigate to

the dynamic selections menu and set it.

How do I set the Profit Center parameter id in my code?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,676

Here a section of my code in which I try to set the parameter id

Profit Center, which is a dynamic selection. The report is successfully

launched, but it does not reflect the Profit Center parameter.

DATA: text(10) TYPE c,

rspar_tab TYPE TABLE OF rsparams,

rspar_line LIKE LINE OF rspar_tab,

range_tab LIKE RANGE OF text,

range_line LIKE LINE OF range_tab.

rspar_line-selname = 'RACCT'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = <salv_item_cost_element>.

APPEND rspar_line TO rspar_tab.

rspar_line-selname = 'RBUKRS'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = <salv_item_company_code>.

APPEND rspar_line TO rspar_tab.

rspar_line-selname = 'RYEAR'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = me->fiscal_year.

APPEND rspar_line TO rspar_tab.

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 = 'FAGLTEXT'.

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 = <salv_item_profit_center>.

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 fagl_account_balance USING SELECTION-SCREEN '1000'

WITH SELECTION-TABLE rspar_tab

with FREE SELECTIONS texpr

AND RETURN.

11 REPLIES 11
Read only

Former Member
0 Likes
1,676

Hi

If the parameters are of a free selection, it means trx FAGLB03 runs a report, so u should use a SUBMIT statament instead of CALL TRANSACTION

Max

Read only

Former Member
0 Likes
1,676

Hi Gregory,

It looks like a report program and hence i doubt if you can use call transaction statement to navigate to the second screen.

Instead you should try SUBMIT statement for the program: FAGL_ACCOUNT_BALANCE

Regards,

Ravi

Read only

Former Member
0 Likes
1,676

Parameter ID is there for Profit center

Read only

Former Member
0 Likes
1,676

try with <b>PRB</b> instead of PRC

Read only

Former Member
0 Likes
1,676

Instead of using Call transaction u can use Submit ...... for that

Reward points if helpful

Regards

Shreya

Read only

Former Member
0 Likes
1,677

Here a section of my code in which I try to set the parameter id

Profit Center, which is a dynamic selection. The report is successfully

launched, but it does not reflect the Profit Center parameter.

DATA: text(10) TYPE c,

rspar_tab TYPE TABLE OF rsparams,

rspar_line LIKE LINE OF rspar_tab,

range_tab LIKE RANGE OF text,

range_line LIKE LINE OF range_tab.

rspar_line-selname = 'RACCT'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = <salv_item_cost_element>.

APPEND rspar_line TO rspar_tab.

rspar_line-selname = 'RBUKRS'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = <salv_item_company_code>.

APPEND rspar_line TO rspar_tab.

rspar_line-selname = 'RYEAR'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = me->fiscal_year.

APPEND rspar_line TO rspar_tab.

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 = 'FAGLTEXT'.

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 = <salv_item_profit_center>.

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 fagl_account_balance USING SELECTION-SCREEN '1000'

WITH SELECTION-TABLE rspar_tab

with FREE SELECTIONS texpr

AND RETURN.

Read only

0 Likes
1,676

Hi Greg,

You can simply use Free selections and submit report. See, here is the sample code I have written for your sake, but for a different transaction i.e., FBL3N.

REPORT YYH198_TEST_SUBMIT_FREESEL.

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.

trange_line-tablename = 'SKA1'.

trange_frange_t_line-fieldname = 'SAKNR'.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'EQ'.

trange_frange_t_selopt_t_line-low = '1200'.

*trange_frange_t_selopt_t_line-high = '0800'.

APPEND trange_frange_t_selopt_t_line

TO trange_frange_t_line-selopt_t.

trange_line-tablename = 'SKB1'.

trange_frange_t_line-fieldname = 'BUKRS'.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'EQ'.

trange_frange_t_selopt_t_line-low = '2300'.

APPEND trange_frange_t_selopt_t_line

TO trange_frange_t_line-selopt_t.

trange_line-tablename = 'BSIS'.

trange_frange_t_line-fieldname = 'BLART'.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'EQ'.

trange_frange_t_selopt_t_line-low = 'WL'.

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 rfitemgl VIA SELECTION-SCREEN

WITH FREE SELECTIONS texpr.

Try out the program in this fashion and check out once.

Note: If the solution is helpful, dont forget to reward points

Thanks,

Adithya K

SAP Practise

"askSAP@googlegroups.com - Another way to get your ABAP problems resolved"

Read only

Former Member
0 Likes
1,676

Thanks for your response, but this code does not work for

my case -- FAGLB03.

Read only

Former Member
0 Likes
1,676

I was mistaken. The code you provided does work

in my case too.

Thanks

Read only

Former Member
0 Likes
1,676

Dear Gregory Carlson,

i was also struck up with the same T.code FAGLB03

i want to pass the value for cost center which is in the dynamic selection.

please check my program

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 = 'FAGLFLEXT'.

TRANGE_FRANGE_T_LINE-FIELDNAME = 'RCNTR'.

TRANGE_FRANGE_T_SELOPT_T_LINE-SIGN = 'I'.

TRANGE_FRANGE_T_SELOPT_T_LINE-OPTION = 'EQ'.

TRANGE_FRANGE_T_SELOPT_T_LINE-LOW = 'AA00'.

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 FAGL_ACCOUNT_BALANCE VIA SELECTION-SCREEN

WITH FREE SELECTIONS TEXPR.

the dynamic selection is not active and receiving the value for cost center..

please help me

thanks in advance.

Read only

Former Member
0 Likes
1,676

Hi

You will try below code for change ur requirement.

SUBMIT (p_prog)

WITH p_rbukrs EQ t_email_add-bukrs

WITH p_budat EQ s_budat-low

WITH s_tpsif2-low EQ t_email_add-zztpsif2

WITH s_conso IN s_conso

WITH s_altkt IN s_rzza

TO SAP-SPOOL

SPOOL PARAMETERS s_pri_params

WITHOUT SPOOL DYNPRO

AND RETURN.

Thanks

Regards

I.Muthukumar.