Submit Report Issue !
Hi Guys,
I am calling a report using submit statement with dynamic value for selection screen..
Here is my code
isels-selname = 'AUFNR'.
isels-kind = 'S'.
isels-sign = 'I'.
isels-option = 'BT'.
isels-low = internal_order.
**isels-HIGH = sy-datum .
APPEND isels.
SUBMIT y_test " using SELECTION-SCREEN
WITH SELECTION-TABLE isels
EXPORTING LIST TO MEMORY
AND RETURN.
I want this report to run in background.. but instead its showing the report on the screen and its not exporting the list to memory.
Cheers
Hi ,
Following code helps you run it in background,
DATA: lw_number TYPE tbtcjob-jobcount.
CONSTANTS: lc_name TYPE tbtcjob-jobname VALUE 'JOB_1'.
* Calling FM to open job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = lc_name
IMPORTING
jobcount = lw_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
* Calling the background report and passing it a SELECTION-TABLE
SUBMIT zreport1
WITH SELECTION-TABLE int_rspar
VIA JOB lc_name NUMBER lw_number
AND RETURN.
* Calling FM to close job
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lw_number
jobname = lc_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.
***This will effect running of report completely in background under the Job name that You will give, U can later go and check in T-code - 'SM37'
***For sending the output list to memory and later retrieving it :
*Example Code (Retrieving list from memory)
*This internal table stores the value
* Of output listed to memory
DATA BEGIN OF itab_list OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF itab_list.
* To load into ascii file format
DATA: BEGIN OF vlist OCCURS 0,
line(256),
END OF vlist.
SUBMIT zreport1
WITH selection-table int_rspar
EXPORTING LIST TO MEMORY
AND RETURN.
* To read from the memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.
* To write it onto the output
CALL FUNCTION 'WRITE_LIST'
EXPORTING
WRITE_ONLY = 'X'
TABLES
listobject = itab_list
EXCEPTIONS
EMPTY_LIST = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* OR use following
* Display the output list on a different screen.
CALL FUNCTION 'DISPLAY_LIST'
* EXPORTING
* FULLSCREEN =
* CALLER_HANDLES_EVENTS =
* STARTING_X = 10
* STARTING_Y = 10
* ENDING_X = 60
* ENDING_Y = 20
* IMPORTING
* USER_COMMAND =
TABLES
listobject = itab_list
* EXCEPTIONS
* EMPTY_LIST = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* also can get into ascii file
* This can be used to write the output data to vlist in ascii format
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.
IF sy-subrc NE '0'.
WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
ENDIF.
I hope you can use this to best suit your requirement !!
Regards,
Salil.
Similar Messages
-
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 -
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 -
Hi,
I have run a stage analysis report but it says no data inspite of open opportunities being present in the system. Could anyone kindly let me know what could be the issue?
Regards
SharatHi Sharat,
Welcome you to the forum. Please close your first thread.
Regarding your Stage Analysis Report Issue, what selection has been made? This report show closed opportunity only.
Thanks,
Gordon -
1. 30 documents of 2009 were matching and post with clear is perfomred. After performing post with clear also the line items are not moving from open line items. When we download the open line items as of today, these line items are appearing.
2. When we download the ZBLRFIOI report for GRIR a/c 349100 to have the opne line items. we have some set of documents showing as " FI Open items without J2" - This is reporting issues.
Thanks
MallikarjunaHi
Pls try with F.13 for that GR/IR account 349100 by selecting check box select gl accounts
And give Company code, year and pending document numbers in selection screen
And before that pls make sure that OB74 clearing settings maintained or not
It will clear all the open items exists
Reg
Vishnu -
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. -
Hi,
I am facing one reporting Issue relating to Display Attributes.
Characteristic: Business Partner
Display Attributes: Address0, Address1, Address3...etc.
Requirement is to display mentioned Display attributes along with Business Partner.
For this I have selected Business Partner as characteristic and mentioned above three as display attributes to Business Partner.
But Query out put is not showing Display attributes. For this I have done all settings at reporting level, all gone vain.
I am using Bex 7.0.
Kindly look in to the Issue and let me know the solution.
Regards,
Venkat.Mahipathi.
09886652422.
[email protected]Hi,
Check in Reporting properties or check attributes in analyzer proprties then it will display
************asign points if usefull***********
swapna -
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 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
Maybe you are looking for
-
Selecting text in Numbers 3.0
When typing text in a cell in Numbers 2.0 after typing the first letter a window would open showing other entries in the same column that started with the same letter and I could copy and paste a selection into the new cell. This function has disappe
-
IT Service Management (Solution Manager - Configuration)
Dear Expert! We are using SM 7.1 SP11. The System Preparation and Basic Configuration has been done Now, we want to configure the IT Service Management under the Solution Manager Configuration. There are some steps are manual in the standard configur
-
Getting list of populated database tables only
Hi, recently started a new company and new to Oracle 10g. The database system they have has around 5000 tables. The majority of these are not used (it is an off the shelf package). What I am trying to do is get a list of all tables in the database BU
-
Hullo, I have just done a fresh install of Windows 7 Professional 64-Bit and the MediaGo application will not install Version 2.7.0.357 on my machine. (it was on the machine and operational before?) Have done some research and found nothing that is c
-
Integration with ECC 6 and Xcelsius
Hi, I would like to know if its possible to integrate Xcelsius directly with an ECC report. For example, take the ALV data and 'send' it to Xcelsius in order to have an Xcelsius report. I know that Xcelsius has (now), built in integration with BW que