Re : submit report
Hello Friends
I am calling another report in my program , I am passing the parameter to that program within my same program, but i don't want to get the output screen of the submitted report and it should process without displaying output screen
Hope you will understand my requirement.
Thanks in Advance
Nagaraj S
u can run it in the background
*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.
Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
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.
Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Similar Messages
-
Will SUBMIT report EXPORTING LIST TO MEMORY work, when Run in Background?
You can use SUBMIT <report> EXPORTING LIST TO MEMORY, and then Call the FM LIST_FROM_MEMORY to get the Data.
This works fine, when the Program is Run in Foreground. My question is, will it work when I Run the Program in Background? i.e. When I Run the Program in Background, will the SUBMIT Statement, Export the List to Memory? Because only then the FM LIST_FROM_MEMORY will get the Data.
Any alternate solution to meet the same requirement will be appreciated.It works for me... my spool output looked like:
11.01.2008 JC: Calling program - test list to memory 1
ZLOCAL_JC_SDN_CALLING_PROGRAM started at 12:54:29
ZLOCAL_JC_SDN_CALLING_PROGRAM call complete 12:54:30
ZLOCAL_JC_SDN_CALLING_PROGRAM started at 12:54:30
11.01.2008 JC: Called program - testing list to memory
ZLOCAL_JC_SDN_CALLED_PROGRAM was called at: 12:54:29
for the following code:
report zlocal_jc_sdn_calling_program.
parameters:
p_start(1) type c.
start-of-selection.
perform testcase.
*& Form testcase
form testcase.
data:
lt_list type table of abaplist.
write: / sy-repid, 'started at', sy-uzeit.
submit zlocal_jc_sdn_called_program
exporting list to memory
and return.
write: / sy-repid, 'call complete', sy-uzeit.
call function 'LIST_FROM_MEMORY'
tables
listobject = lt_list.
write: / sy-repid, 'started at', sy-uzeit.
call function 'WRITE_LIST'
tables
listobject = lt_list.
endform. "testcase
and
report zlocal_jc_sdn_called_program.
start-of-selection.
write: / sy-repid, 'was called at:', sy-uzeit. -
Skip Error message in submit report
Hello Gurus,
I am using SUBMIT <REPORT> command inside a loop of my calling report. For one record the SUBMIT <report> is throwing an eror message due to which my report is getting stopped by displaying the error message.
My requirement is to skip the record if there is any error in SUBMIT <report> and process rest of the records.
Please help me out.Hi,
Vasanth's idea regarding doing a CALL FUNCTION IN BACKGRUOND TASK does work, unless you need to get back some information from the SUBMIT, as export parameters can't be set when using IN BACKGRUOND TASK.
As i need to get data from the SUBMIT, i'll keep looking for other alternatives, so other ideas are still welcome...
Regards,
mr.
Hi Manuel,
Try calling report in background task like below:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = c_name "this name can be any name defined in constants(you do not have to create a job name anywhere in system or SM36)
IMPORTING
jobcount = w_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
*" Job opened successfully
IF sy-subrc EQ c_0.
*" Call program to process IDoc
SUBMIT ZSubmit WITH <any value> " e.g. p_field1 EQ <value>
VIA JOB c_name NUMBER w_number
AND RETURN.
[Note: In ZSubmit report you can send the data to calling program through ABAP memory i.e. Use EXPORT parameter to export data
Ex: constants: c_memory(7) type c value 'MEMORY1'.
At the end of ZSubmit report, before returning to the calling program write below statement:
EXPORT i_message TO MEMORY ID c_memory1.]
*" Successful processing of IDoc
IF sy-subrc EQ c_0.
"Here you can import data from ZSubmit report
import i_message from memory id c_memory1.
After retrieving the data, free the memory otherwise it will affect the performance of your report:
Free memory id c_memory1.
*" Close the job
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_number
jobname = c_name
strtimmed = c_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.
ENDIF.
ENDIF.
Hope this helps!
Regards,
Saba -
JOB_OPEN, SUBMIT REPORT VIA JOB, JOB_CLOSE, How to get result?
Hi Friends,
I am calling reports using jobs as calling job_open, submit report via job.., and job_close. But I want to the output/result of the report. How can I do this?
Thanks.Hello nkara,
Welcome to SDN!!!
Check this thread:
background grid
REgards,
Vasanth -
Submit report using internal table
Hi Experts!!,
REPORT 1
TYPES: BEGIN OF ty_out_table,
partner LIKE /sapsll/pntbp-partner,
bpvsy LIKE /sapsll/pntbp-bpvsy,
country LIKE adrc-country,
END OF ty_out_table.
internal table declaration & definition
DATA: gt_out_table TYPE STANDARD TABLE OF ty_out_table
WITH KEY partner
bpvsy.
I have data in internal table gt_out_table.
I want to pass data gt_out_table in report 2. using SUBMIT REPORT.
How to do that ?
REPORT 2
select-options: s_partnr for /sapsll/pntbp-bpvsy.
parameters: p_upd,
p_value .
please suggest.
Thanks
Aneehai,
... 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.
Notes
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.
When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display. -
Submit report to get output list
Hi friends,
I have one requirement to take output list of a transaction in one internal table.
As the transaction is very much interactive , that perticular internal table gets populated somewhere in the middle of the standard program...later on that table undergoes further processing to cope up with he interaction...
using SUBMIT report , we can export it to memory
and using FM 'LIST_FROM_MEMORY' we can get it back as following.
list_tab contains data in two fields RFCSIZE and RFCRECORD in numbers only...
Submit report_name with SELECTION-TABLE SELTAB
exporting list to Memory and return.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
BUT , Can we get the same output list (i.e before interaction) in one internal table...
thanksHi,
You can check whether the list is exported in between before the submit.
Supposed it is exported before the interaction den you can import it ..Just check the value is fetched and stored in a temporary table.
Is it a csutom program or standard SAP one..?
Hope this helps.
Regards,
Navin. -
Submit report with dynamic selections
Hi All,
I am trying to Submit a report with dynamic selections. I am using the option SUBMIT REPORT WITH FREE SELECTIONS.
But the dynamic selections are not getting passed.
Request you to kindly provide some inputs
My code is
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 = 'PA0002'.
*trange_frange_t_line-tablename = 'PA0002'.
trange_frange_t_line-fieldname = 'GBJHR'.
trange_frange_t_selopt_t_line-sign = 'I'.
trange_frange_t_selopt_t_line-option = 'EQ'.
trange_frange_t_selopt_t_line-low = '1987'.
trange_frange_t_selopt_t_line-high = '1987'.
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 RPCADVQ0
VIA SELECTION-SCREEN
WITH SELECTION-TABLE rspar_tab
WITH FREE SELECTIONS it_texpr
and returN.
Kindly provide your inputs
Regards
ReshmaHi Reshma,
Use the FM - RS_REFRESH_FROM_DYNAMICAL_SEL before FREE_SELECTIONS_RANGE_2_EX.
data: trange type rsds_trange,
g_repid type sy-repid.
g_repid = 'RPCADVQ0'.
call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
exporting
curr_report = g_repid
mode_write_or_move = 'M'
importing
p_trange = trange
exceptions
not_found = 1
wrong_type = 2
others = 3.
if sy-subrc eq 0.
" Do the changes to the trange
CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
EXPORTING
field_ranges = trange
IMPORTING
expressions = texpr.
submit RPCADVQ0
VIA SELECTION-SCREEN
WITH SELECTION-TABLE rspar_tab
WITH FREE SELECTIONS it_texpr
and returN.
endif.
Cheers,
Kothand -
Hi all,
Is there is any restriction in using <b>submit report and return</b> statement in BAPI function modules ?
Thanks ,
Jobyhi,
the below guidelines has to be followed while developing BAPIs.
1.BAPI must not contain CALL TRANSACTION or SUBMIT REPORT.
2.BAPI must not invoke a COMMIT WORK.instead use the BAPI.transaction commit to execute the commit after the BAPI has executed.
3.BAPI structures must not use includes.
4.There should be no Functional dependencies b/w two BAPIs.
<b>if helpful reward some points.</b> -
when I submitted the report RM06BA00 in other program using
SUBMIT (REPORT)
USING SELECTION-SET VARIANT
EXPORTING LIST TO MEMORY AND RETURN.
It's not coming to program from where I called...it's displaying the report
so when I used FM LIST_FROM_MEMORY for further process like emailing this report...I am not getting any data.
Could you pls. let me know why this is displaying report instead of coming back to the program from where it's submitted?
Reply ASAP.
Regards,
Sreedevi PHi Sreedevi,
Refer to the codes in this link.
Re: Submit Statement
Regards,
Arun Sambargi. -
SUBMIT REPORT statement issue in abap
Hi Experts,
I am facing issue while doing SUBMIT REPORT statement.
Below are the details for the Issue:
1. We want to execute another report ZTEST2 from one report , so we have written code in report ZTEST1 as below:
SUBMIT ZTEST2 AND RETURN.
2. It goes to ZTEST2 successfully but when we execute ZTEST2 and click on BACK buttton , it directly goes to ZTEST1 selection screen.
Instead we want to go ZTEST2 program's selection screen. As this back button is standard ALV button is there any way we can handle this without creating new PF-STATUS.
Regards,
SanjanaThat's very limiting.
It depends, there are some things you can do if you ztest2 does something that is traceable.
Without any more info I suggest to check time-lapse between submit calls. If it's inferior to 2 seconds I'd suppose user want's to leave.
mind you the syntax is wrong:
do.
g_initial = get time.
SUBMIT ZTEST2 AND RETURN.
g_final = get time.
if g_final - g_initial <= 2.
exit.
endif.
enddo.
For the user is in most cases transparent, only if he remains a lot of time in selection screen he'll remain there.
regards,
Edgar -
Submit report and export to memory
Hi
I am using this code to submit report
submit ZM005REP
WITH S_BLEND IN R2
WITH S_GROUP IN R3
WITH S_WERKS IN r1
exporting list to memory and return.
I am using LIST_FROM_MEMORY to read the list.
I want to further use the values from this list for calculations , but when I saw the list its just an array of strings.
I want to read the opening bal field which is returned in this list.
Any advice on this ?
Thanks,
ShitalHi,
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.
SUBMIT zreport EXPORTING LIST TO MEMORY.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = vlist
listobject = itab_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
Then you can use the ITAB_LIST for caliculation which is having all the values.
Thanks
Sudheer -
Submit report repeatedly through loop
Hi Experts,
I need to submit report in loop. For that i have used SUBMIT as follows
loop at itab into wa_it.
SUBMIT ('ABC') VIA SELECTION-SCREEN
WITH s_item = wa_it-item
AND RETURN.
endloop.
The above statement works fine. But i want next item no (wa_it-item) to be filled automatically as soon called report executes for current item number instead of pressing 'BACK' button.
If anybody worked on this please help me.
Thanks and regards,
Shivanand Kalagi.> I need to submit report in loop. For that i have used SUBMIT as follows
> loop at itab into wa_it.
> SUBMIT ('ABC') VIA SELECTION-SCREEN
> WITH s_item = wa_it-item
> AND RETURN.
> endloop.
>
> The above statement works fine. But i want next item no (wa_it-item) to be filled automatically as soon called report executes for current item number instead of pressing 'BACK' button.
>
Just take out the selection-screen option since you dont want to go through the selection screen.
You can write as follows
loop at itab into wa_it.
submit abc with with s_item = wa_it-item and return. <<< This will call the program without selection screen but passes the
clear: wa_it. parameters required to the program .
endloop.
Try this.... Sure it works -
Submit report using selection table not working in OO CL_SALV classes
I have used CL_SALV classes in my report. now the problem is submit report is not working. any suggestions.
It works in REUSE_ALV FMStill i m facing the same problem
-
Problem with submit report for transaction LT23
Hi,
I want to submit report for transaction LT23 based on the double click on a field in the output of my report. I am using selection table to pass values. The problem is I have something called dynamic selections. I am using some selection fields from the dynamic selection option. Can anyone tell me how do I pass the values in such a case?In your [submit|http://help.sap.com/abapdocu/en/ABAPSUBMIT.htm] statement in the [selection screen parameters|http://help.sap.com/abapdocu/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm] use the [WITH FREE SELECTIONS|http://help.sap.com/abapdocu/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm#!ABAP_ADDITION_5@5@] option to pass dynamic selections
NB: Use FREE_SELECTIONS_RANGE_2_EX to build the correct parameter texpr.
Regards
Raymond -
Submit Report (Regarding Background Processing)
Hi Guru's,
I want help regarding Background Processing.
I have developed a program which is running fine in forground but in Background mode no values are comming.
All values are becomig Zero.
Plz help.
*--- Submit Report for 'COGI' (Postprocessing of Error Records from Automatic Goods Movements)
SUBMIT coruaffw USING SELECTION-SCREEN '1000'
WITH r_cumul = 'X'
EXPORTING LIST TO MEMORY
AND RETURN.
*---- Get the List
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = it_list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
*--- Convert to Ascii
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listobject = it_list_tab
listasci = it_asci_tab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE i000 WITH 'Problem in converting LIST to ASCII'.
ENDIF.
DESCRIBE TABLE it_asci_tab LINES w_cogi.
w_cogi = w_cogi - 5.
CALL FUNCTION 'LIST_FREE_MEMORY'
TABLES
listobject = it_list_tab.Hi Arbind,
You have used return you need to add the addition with.Try this way hope it works
SUBMIT zreport EXPORTING LIST TO MEMORY
AND RETURN
WITH P_1 = P_1
WITH P_2 = P_2
WITH P_3 = P_3
WITH S_4 IN S_4
WITH S_5 IN S_5
WITH S_6 IN S_6. -
Report output list to internal table using submit report
Hello,
I have a report that generates the output in the form of an abap list. I want this data in an internal table for further processing. the report internally does not do a export data to memory so i cannot use import later on to get the data.
i did the following
SUBMIT <report name> exportING LIST TO MEMORY and return.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = ascitab
listobject = itab_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
This returns the data in the ascitab, but the data contains additional unwanted info like lines and hyphens etc. Also the data is in a table with a single column, so pulling out individuals fields is again an issue. Is there a way to get this data into an internal table directly?
best regards,
Surajhi suraj
export the internal table of report
DATA: BEGIN OF SR_VBAK ,
VBELN LIKE VBAK-VBELN,
END OF SR_VBAK.
DATA: IR_VBAK LIKE STANDARD TABLE OF SR_VBAK WITH HEADER LINE.
EXPORT IR_VBAK TO MEMORY ID 'SALES'.
SUBMIT <program name in which u want internal table records > AND RETURN.
now import that data in submit program .
here u have to creat a internal table with same structure as the internal table from which u r trying to export the data
DATA: BEGIN OF SR_VBAK,
VBELN LIKE VBAK-VBELN,
END OF SR_VBAK.
DATA : IR_VBAK LIKE STANDARD TABLE OF SR_VBAK WITH HEADER LINE.
IMPORT IR_VBAK FROM MEMORY ID 'SALES'.
regards
ANIL CHAUDHaRY
Maybe you are looking for
-
I just subscribed to your service to convert a PDF document to Word. How do I use this tool to convert my PDF document?
-
Launching MS Office for Mac 2011: "Font is not Installed" errors
Message Microsoft (MSOffice).app wants to use the font "xxx". This font is not installed. Allow Microsoft(whatever).app to use this font? show in finder, don't allow, allow. happens with all Office apps, runs through entire font library. about 3 mont
-
Query taking long time please help
select o.merchantid as merchantId, o.orderid as orderId, p.effortid as effortId, p.attemptid as attemptId, o.customerid as customerId, p.contractid as contractId, o.merchantreference as merchantReference, o.ordertype as orderType, o.statusid as order
-
Dependency of characteristics value in CV04N
Hi there, I have an issue when searching document using characteristics with dependencies. Let's say I have 2 characteristics (doc & doc_sub_type). characteristics : DOC has value A & B characteristics : DOC_SUB_TYPE has value A-1 & B1 When user sear
-
I cannot find the method in this interface!
Is service an interface and query its method in the following scrips? But I cannot find the method query in this interface. What is the function of new? Map map = service.query(new FreeMemAgent(), null); Thank you Edited by: jetq on Jun 7, 2009 9:05