02-07-2008 10:47 AM
Hi,
I want to Submit a report via selection screen filling the selection screen values.
Do let me know how to fill the selection-table and pass it.
Thanks & Regards,
SP
02-07-2008 10:54 AM
Hi, an example,
REPORT report1.
DATA text TYPE c LENGTH 10.
SELECTION-SCREEN BEGIN OF SCREEN 1100.
SELECT-OPTIONS: selcrit1 FOR text,
selcrit2 FOR text.
SELECTION-SCREEN END OF SCREEN 1100.
...
Calling program
REPORT report2.
DATA: text TYPE c LENGTH 10,
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 = 'SELCRIT1'.
rspar_line-kind = 'S'.
rspar_line-sign = 'I'.
rspar_line-option = 'EQ'.
rspar_line-low = 'ABAP'.
APPEND rspar_line TO rspar_tab.
range_line-sign = 'E'.
range_line-option = 'EQ'.
range_line-low = 'H'.
APPEND range_line TO range_tab.
range_line-sign = 'E'.
range_line-option = 'EQ'.
range_line-low = 'K'.
APPEND range_line TO range_tab.
SUBMIT report1 USING SELECTION-SCREEN '1100'
WITH SELECTION-TABLE rspar_tab
WITH selcrit2 BETWEEN 'H' AND 'K'
WITH selcrit2 IN range_tab
AND RETURN.
02-07-2008 10:59 AM
Hi,
SAP keyword docu explains it clearly.......
... WITH SELECTION-TABLE rspar
Effect
If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
SELNAME (length 8),
KIND (length 1),
SIGN (length 1),
OPTION (length 2),
LOW (length 45),
HIGH (length 45).
To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
Cheers,
jose.
02-07-2008 11:08 AM
Hi,
Check the below links
http://www.sapdevelopment.co.uk/reporting/rep_submit.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba51a35c111d1829f0000e829fbfe/content.htm
Regards,
Nagaraj
02-07-2008 11:09 AM
DATA: seltab TYPE TABLE OF rsparams,
lifnr_tab LIKE LINE OF seltab.
lifnr_tab-selname = 'S_LIFNR'. "SELECT-OPTIONS name
lifnr_tab-sign = s_lifnr-sign.
lifnr_tab-option = s_lifnr-option.
LOOP AT s_lifnr.
lifnr_tab-low = s_lifnr-low.
lifnr_tab-high = s_lifnr-high.
APPEND lifnr_tab TO seltab.
ENDLOOP.
SUBMIT (sy-repid) VIA SELECTION-SCREEN
WITH SELECTION-TABLE seltab.
02-07-2008 11:11 AM
Hi,
Please refer to the sample code
Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
seltab_wa-selname = 'PNPPERNR'.
seltab_wa-sign = 'I'.
seltab_wa-option = 'EQ'.
* load each personnel number accessed from the structure into
* parameters to be used in the report
loop at pnppernr.
seltab_wa-low = pnppernr-low.
append seltab_wa to seltab.
endloop.
SUBMIT zreport with selection-table seltab
via selection-screen.
Thanks,
Sriram Ponna.