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 REPORT

Former Member
0 Kudos

i have this internal table with only a one field(i.e a table having entries of one field only). now i have to use submit report and pass that internal table to the report. the report will intake these values from a internal table and then will display from a database table as per these entries in the internal table which we had passed.

now my question is what should be the syntax for this. please reply with example code.

i have a this some hint that we can use select options in the report for passing the internal table and then use the skip selection screen,, but i don't know how..

helpful answers will surely be rewarded.

regards

jai

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Jai,

Use Import/Export for your problem.

For details refer to this thread:

Thanks,

Munish

8 REPLIES 8

Former Member
0 Kudos

Syntax for SUBMIT:

SUBMIT REPORT01

VIA SELECTION-SCREEN

USING SELECTION-SET 'VARIANT1'

USING SELECTION-SETS OF PROGRAM 'REPORT00'

AND RETURN.

or

SUBMIT zsro_es_switch_activity_create

USING SELECTION-SCREEN '1000'

WITH s_insta EQ ws_anlage_pod

WITH s_actvt EQ eideswtactivity-activity

AND RETURN.

You can't able to pass the internal table through submit.

What you can do use the EXPORT and IMPORT Parameters to that.

Prakash.

0 Kudos

hi prakash

thanks for reply.. it will be helpful if u can elaborate how i can use export to report....

jai

Former Member
0 Kudos

Hi,

use below code

SUBMIT REPORT01

VIA SELECTION-SCREEN

USING SELECTION-SET 'VARIANT1'

USING SELECTION-SETS OF PROGRAM 'REPORT00'

AND RETURN.

Regards

amole

0 Kudos

Hi,

You can acheive it in two ways

1. You can export the internal table values in first

program and import it in the called report.This is

the easy method.

2. You can add parameters as in the called report with

fields in internal table, Fill those parameters in

your report and submit via selection screen. This is

complicated and time consuming process . Not

recommended performance wise also.

Hope this helps.

ferry_lianto
Active Contributor
0 Kudos

Hi Jai,

Please check this link for sample codes on submit.

http://www.sapdevelopment.co.uk/reporting/rep_submit.htm

Regards,

Ferry Lianto

Former Member
0 Kudos

Hi,

Go thru this docu.

SUBMIT - selscreen_parameters

Syntax

... [USING SELECTION-SET variant]

[USING SELECTION-SETS OF PROGRAM prog]

[WITH SELECTION-TABLE rspar]

[WITH sel1 value1 WITH sel2 value2 ...]

[WITH FREE SELECTIONS texpr] ... .

Extras:

1. ... USING SELECTION-SET variant

2. ... USING SELECTION-SETS OF PROGRAM prog

3. ... WITH SELECTION-TABLE rspar

4. ... WITH sel1 value1 WITH sel2 value2 ...

5. ... WITH FREE SELECTIONS texpr

Effect

USING-SELECTION-SET supplies all the selection screen components by means of a Variante variant. If you specify USING-SELECTION-SETS OF PROGRAM , you can use a variant from a different program; if you specify WITH SELECTION-TABLE, values for several selection screen components are transferred as the content of an internal table rspar; WITH sel value supplies individual selection screen components sel with values value. The addition WITH FREE SELECTIONS allows you to transfer dynamic selections to the selection screen for a logical database.

Addition 1

... USING SELECTION-SET variant

Effect

If you specify this edition, the parameters and selection criteria for the selection screen are supplied with values from a variant. For variant, you must specify a character-like data object that contains the name of a variant for the program accessed when the statement is executed. If the variant does not exist, the system sends an error message. If the variant belongs to a different selection screen, it is ignored.

Note

You can create and manage variants for every program in which selection screens are defined, either in the ABAP Workbench or during execution of the program by choosing Goto - Variants on a selection screen.

Addition 2

... USING SELECTION-SETS OF PROGRAM prog

Effect

If you specify this addition, the variants of the program prog are used in the program accessed. For prog, you must specify a character-like data object that contains the name of a program when the statement is executed. The addition has the following effect:

If a variant variant is specified with USING SELECTION-SET, the system searches for this variant in the program prog.

If the selection screen is displayed with VIA SELECTION-SCREEN, all the functions that can be accessed by means of the menu path Goto - Variants affect the variants of the program prog. However, these functions are only active if prog is an executable program.

Note

The program prog should contain a selection screen that has the same parameters and selection criteria as the selection screen used in the program accessed.

Addition 3

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

Note

In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.

Addition 4

... WITH sel1 value1 WITH sel2 value2 ...

Effect

This addition supplies values to individual parameters or selection criteria sel for the selection screen. For sel, you must specify the name of a parameter or selection criterion directly. Parameters are supplied with single values and selection criteria with selection tables that overwrite values already specified in the program accessed. The selection table to be transferred is compiled from all the WITH sel additions that address the same selection criterion sel. You can specify the following statements for value:

{EQ|NE|CP|NP|GT|GE|LT|LE} dobj [SIGN sign]

Transfer of a single value.

The operators before dobj correspond to the values specified for column OPTION for selection tables. For dobj, you must specify a data object whose data type can be converted to the data type of the selection screen component sel. For sign, you can specify a character-like field that must contain 'I' or 'E'. The standard value is 'I'.

If sel is a selection criterion, the system appends a line in the selection table to be transferred, placing the operator in column OPTION, the content of dobj in column LOW, and the content of sign in column SIGN.

If sel is a parameter, it is set to the value of dobj in the program accessed. The operator and the value of sign are not taken into account.

[NOT] BETWEEN dobj1 AND dobj2 [SIGN sign]

Transfer of an interval.

In this case, sel must be a selection criterion. For dobj, you must specify data objects whose data type can be converted to that of the columns LOW and HIGH for the selection criterion sel. For sign, you can specify a character-like field that must contain 'I' or 'E'. The standard value is 'I'.

A line is appended in the selection table to be transferred. If NOT is specified, the value 'NB' is placed in column OPTION; otherwise, the value entered is 'BT'. The content of the data objects dobj and sign is placed in the columns LOW, HIGH, and SIGN.

IN rtab

Transfer of a ranges table.

In this case, sel must be a selection criterion. For rtab, you must specify an internal table that has the same structure as the selection table for selection criterion sel. You can create a table like this using the addition RANGE OF to the statements TYPES and DATA.

The lines in table rtab are appended to the selection table to be transferred.

Note

You can also use = or INCL instead of the operator EQ.

You can specify the addition WITH sel value more than once, and you can also specify the same selection screen component more than once.

Example

The program report1 has a stand-alone selection screen with the screen number 1100. In the program report2, an internal table with row type RSPARAMS and a ranges table are filled for this selection screen. These are transferred at SUBMIT together with a single condition.

Program accessed

REPORT report1.

DATA text(10) TYPE c.

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

Result

After report1 has been accessed by report2, the selection tables for the selection criteria selcrit1 and selcrit2 in the program accessed contain the following entries:

SIGN OPTION LOW HIGH

selcrit1 I EQ ABAP

selcrit2 I BT H K

selcrit2 E EQ H

selcrit2 E EQ K

Addition 5

... WITH FREE SELECTIONS texpr

Effect

This addition supplies values to the dynamic selections for the selection screen for a logical database. The program accessed must be linked to a logical database that supports dynamic selections. texpr must be an internal table of the type RSDS_TEXPR from type group RSDS.

In texpr, the selections for the dynamic selections are specified in an internal format (stack formula). You can use the function modules FREE_SELECTIONS_INIT, FREE_SELECTIONS_DIALOG, and FREE_SELECTIONS_RANGE_2_EX from the function group SSEL to fill texpr in the calling program. While the first two function modules execute a user dialog, you can transfer ranges tables to FREE_SELECTIONS_RANGE_2_EX for each node in the dynamic selection in an internal table of the type RSDS_TRANGE. These are then converted to a table of the row type RSDS_TEXPR. If the calling program contains a selection screen with the same dynamic selections, you can transfer its content beforehand to a table of the type RSDS_TRANGE using the function module RS_REFRESH_FROM_DYNAMICAL_SEL.

The lines in the internal table type RSDS_TRANGE contain a flat component TABLENAME for each node and a table-like component FRANGE_T of the type RSDS_FRANGE_T for the fields in the node. The lines in RSDS_FRANGE_T contain a flat component FIELDNAME for each field and a table-like component SELOPT_T of the row type RSDSSELOPT from the ABAP Dictionary. RSDSSELOPT contains the four components SIGN, OPTION, LOW, and HIGH and can include the ranges table.

Example

Program report1 is linked to the logical database F1S, which supports dynamic selections for the node SPFLI. Program report2 enters conditions in a nested internal table of the type rsds_trange with selection conditions for field CONNID in node SPFLI; this is then converted to a table of the type rsds_texpr, which is transferred at SUBMIT.

Program accessed

REPORT report1.

NODES: spfli, sflight, sbook.

...

Calling program

REPORT report2.

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

trange_frange_t_line-fieldname = 'CONNID'.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'BT'.

trange_frange_t_selopt_t_line-low = '0200'.

trange_frange_t_selopt_t_line-high = '0800'.

APPEND trange_frange_t_selopt_t_line

TO trange_frange_t_line-selopt_t.

trange_frange_t_selopt_t_line-sign = 'I'.

trange_frange_t_selopt_t_line-option = 'NE'.

trange_frange_t_selopt_t_line-low = '0400'.

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

WITH FREE SELECTIONS texpr.

Thanks

Sunil

Former Member
0 Kudos

Hi,

Let's take an example for the material as the values..

REPORT ZCALLING_REPORT.

TABLES: MARA.

DATA: BEGIN OF T_DATA OCCURS 0,

MATNR TYPE MATNR,

END OF T_DATA.

RANGES: R_MATNR FOR MARA-MATNR.

START-OF-SELECTION.

SELECT MATNR UP TO 10 ROWS

INTO TABLE T_DATA.

LOOP AT T_DATA.

R_MATNR-SIGN = 'I'.

R_MATNR-OPTION = 'EQ'.

R_MATNR-LOW = T_DATA-MATNR.

APPEND R_MATNR.

ENDLOOP.

SUBMIT ZREPORT WITH SO_MATNR IN R_MATNR

AND RETURN.

-


REPORT ZREPORT.

TABLES: MARA.

SELECT-OPTIONS: SO_MATNR FOR MARA-MATNR.

START-OF-SELECTION.

LOOP AT SO_MATNR.

WRITE: / SO_MATNR-LOW.

ENDLOOP.

Thanks,

Naren

Former Member
0 Kudos

Hi Jai,

Use Import/Export for your problem.

For details refer to this thread:

Thanks,

Munish