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: 

Submit program for FBL1N with Dynamic selection

sri6666
Active Participant
0 Kudos
1,961

HI Abap Experts,

I am writing submit program for get Net due date from FBL1N . i am passing Vendors and Company code for open items. like below . but i want to pass Document number which is in dynamic selection. i tried to pass screen field name = document number. but it returns all documents. dynamic selection not working. can some one give the code for pass the dynamic section in submit program ?

SUBMIT rfitemap WITH SELECTION-TABLE lt_selscreen

WITH kd_lifnr-low = i_bsik-lifnr

WITH kd_bukrs-low = i_bsik-bukrs
WITH x_opsel = abap_true
WITH pa_stida = sy-datum "f110v-laufd
WITH x_norm = abap_true AND RETURN EXPORTING LIST TO MEMORY.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
1,611

Use the WITH FREE SELECTIONS texpr option of SUBMIT statement.

(Read documentation to use FM FREE_SELECTIONS_RANGE_2_EX to fill this parameter)

6 REPLIES 6

raymond_giuseppi
Active Contributor
1,612

Use the WITH FREE SELECTIONS texpr option of SUBMIT statement.

(Read documentation to use FM FREE_SELECTIONS_RANGE_2_EX to fill this parameter)

0 Kudos
1,611

thanks it's working

suman_sap
Discoverer
0 Kudos
1,611

Hi Sri,

I have a similar issue. Can you please provide sample code. I want to call this report in other report without selection screen and get the data

I tried but it is not working for me. Please suggest

Thanks,

Suman.

suman_sap
Discoverer
0 Kudos
1,611

Hi,

I have similar issue.

can you please provide the code

sri6666
Active Participant
1,611

Try below code.

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: lr_pay_data TYPE REF TO data,
lt_selscreen TYPE TABLE OF rsparams WITH HEADER LINE.
FIELD-SYMBOLS: <fs_t_tab> TYPE ANY TABLE,
<fs_tab> TYPE any,
<lt_pay_data> TYPE ANY TABLE.

SELECTION-SCREEN BEGIN OF BLOCK be.
PARAMETERS: p_lifnr type lifnr,
p_bukrs type bukrs,
p_belnr type belnr.
SELECTION-SCREEN END OF BLOCK be .


trange_line-tablename = 'LFA1'.
trange_frange_t_line-fieldname = 'LIFNR'.
trange_frange_t_selopt_t_line-sign = 'I'.
trange_frange_t_selopt_t_line-option = 'EQ'.
trange_frange_t_selopt_t_line-low = p_lifnr.
*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 = 'LFB1'.
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 = p_bukrs.
APPEND trange_frange_t_selopt_t_line
TO trange_frange_t_line-selopt_t.


trange_line-tablename = 'BSIK'.
trange_frange_t_line-fieldname = 'BELNR'.
trange_frange_t_selopt_t_line-sign = 'I'.
trange_frange_t_selopt_t_line-option = 'EQ'.
trange_frange_t_selopt_t_line-low = p_belnr.
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.

cl_salv_bs_runtime_info=>set( EXPORTING display = abap_false
metadata = abap_false
data = abap_true ).
SUBMIT rfitemap with SELECTION-TABLE lt_selscreen
WITH FREE SELECTIONS texpr
AND RETURN EXPORTING LIST TO MEMORY.
wait UP TO 1 SECONDS.

TRY.
cl_salv_bs_runtime_info=>get_data_ref( IMPORTING r_data = lr_pay_data ).
ASSIGN lr_pay_data->* TO <lt_pay_data>.
CATCH cx_salv_bs_sc_runtime_info.

ENDTRY.

suman_sap
Discoverer
0 Kudos
1,611

Thanks Sri. It worked