Posted: Sun Oct 14, 2007 6:50 pm Post subject: SUBMIT report (Excecute rep from within a rep)
The SUBMIT statement executes a report from within a report. i.e. you could have a drill-down which calls another report. Can only execute reports of type '1'.
Code:
*Code used to execute a report
SUBMIT Zreport.
*Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
* 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.
*Code used to populate 'parameters' & execute report
SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'.
Other additions for SUBMIT
Code:
*Submit report and return to current program afterwards
SUBMIT zreport AND RETURN.
*Submit report via its own selection screen
SUBMIT zreport VIA SELECTION-SCREEN.
*Submit report using selection screen variant
SUBMIT zreport USING SELECTION-SET 'VARIANT1'.
*Submit report but export resultant list to memory, rather than
*it being displayed on screen
SUBMIT zreport EXPORTING LIST TO MEMORY.
* Once report has finished and control has returned to calling
* program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
* DISPLAY_LIST to retrieve and display report.
*Example Code (Retrieving list from memory)
DATA BEGIN OF itab_list OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF itab_list.
DATA: BEGIN OF vlist OCCURS 0,
filler1(01) TYPE c,
field1(06) TYPE c,
filler(08) TYPE c,
field2(10) TYPE c,
filler3(01) TYPE c,
field3(10) TYPE c,
filler4(01) TYPE c,
field4(3) TYPE c,
filler5(02) TYPE c,
field5(15) TYPE c,
filler6(02) TYPE c,
field6(30) TYPE c,
filler7(43) TYPE c,
field7(10) TYPE c,
END OF vlist.
IF sy-subrc NE '0'.
WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
ENDIF.
Submit report as job
Code:
*Submit report as job(i.e. in background)
data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.
* Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.