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 in background

former_member262988
Active Contributor
0 Kudos

Hi,

can i use submit statement for executing a report from another report in background mode....or need to use bdc only...

3 REPLIES 3

Former Member
0 Kudos

you can use submit statement in foreground as well as background mode..

Former Member
0 Kudos

Hi,

you can use submit in background run also use job_options as below

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = name

IMPORTING

jobcount = number

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc = 0.

SUBMIT submitable TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

WITHOUT SPOOL DYNPRO

VIA JOB name NUMBER number

AND RETURN.

IF sy-subrc = 0.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = number

jobname = name

strtimmed = 'X'

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

IF sy-subrc <> 0.

...

ENDIF.

ENDIF.

ENDIF.

former_member203501
Active Contributor
0 Kudos

hi use like this..

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.

if you use the selection screens, the two reports must have the same fields in the selection screens