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.
Similar Messages
-
How run a report in background process ?
Hi Experts,
I wrote a code in which I am have multiple selection screens....means in first screen there will 3 radio buttons.
So, depending upon the radio button selected, the other selction screen will be displayed...
So, here i want to run a report in background process...But in menubar im not able to find 'program'.
So, please help me this to run my report in background process.. with any simple code...
Thanks,
Rocky.Hi,
Try to see this example and adapt it for your case:
constants : c_jobname like tbtcjob-jobname value 'ZRFC_CM_38',
c_jobclass like tbtcjob-jobclass value 'A',
c_x type c value 'X',
c_msgclass type arbgb value 'ZXXXSD',
c_error type bapi_mtype value 'E',
c_status type bapi_mtype value 'S',
c_msg1 type msgnr value '177',
c_msg2 type msgnr value '178'.
data : v_jobcount like tbtcjob-jobcount.
ranges:
r_auart for vbak-auart,
r_wbstk for vbuk-wbstk,
r_mtart for mara-mtart,
r_reswk for ekko-reswk,
r_vtweg for vbak-vtweg.
call function 'JOB_OPEN'
exporting
jobname = c_jobname
importing
jobcount = v_jobcount
exceptions
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
others = 4.
if sy-subrc = 0.
Assignment of Ranges
append lines of:
distribution_channel to r_vtweg,
order_type_range to r_auart,
status_range to r_wbstk,
material_type_range to r_mtart,
plant_range to r_reswk.
Submit program in background
submit z_beve_salesorder_list
with p_spart = division
with p_file = file_name
with p_land1 = country
with s_vtweg in r_vtweg
with s_auart in r_auart
with s_wbstk in r_wbstk
with s_mtart in r_mtart
with s_reswk in r_reswk
via job c_jobname
number v_jobcount
and return.
Close the Job
call function 'JOB_CLOSE'
exporting
jobcount = v_jobcount
jobname = c_jobname
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
invalid_target = 8
others = 9.
if sy-subrc = 0.
Status Message
return-type = c_status.
message id c_msgclass
type c_status
number c_msg1
into return-message
with c_jobname
sy-datum
sy-uzeit.
else.
Error Message
return-type = c_error.
message id c_msgclass
type c_error
number c_msg2
into return-message
with c_jobname.
endif.
endif.
Regards. -
Hai friends,
Requirement is " I need to submit the report in background and program should execute only on every monday of the week.
Pl do the needful and clarify with hard coding.
Good answers expect good points.
Regards,
Vamsykrishna.Hi Vamshy,
Execute Program with some values in selection-screen and save the selection screen values as some variant.
Goto SM36 tcode and give some job name,job class ..etc.Then Press
Start_Conidtion Button in Application tool bar.Here you choose Date/Time button and select Period_Values button in the same screen after choosing some coming Monday's date selected_start option.
here you can provide Weekly option in period_values option.
dont forget to save all those values you entered.
Execute the job in SM37 tcode
If its not solved your problem feel free to ask further.
You can achieve the same thing thru function modules like job_submit,job_close..
Reward if it useful to you
Thanks
Sivaparvathi -
Report Execution - Background Process
Hi Friends,
I have developed a report program.
I have also created a transaction code for executing it.
Now the user needs to execute this program as a background job.
I have tried with SM36 and SM37 transactions. Here, you need to set the variants and time for execution.
But the user has lots of selection criteria and setting the variants for this requirement is highly impossible.
Kindly let me know whether I can add any additional statements in the program so that the program executes as a background process when initiated th' the selection screen / transaction code.
Kindly provide your suggestions.
Thanks in advance.Hi Karthik,
Looks like a wrapper ABAP program is required to meet your requirement. This program can be called in the background and in turn can submit the report program that you have created to achieve the actual functionality.
In this wrapper program, you need to create a dynamic variant using FMs (search RSVARIANT in SE37). Here you can populate the fields of the selection screen based on any complex criteria as you mentioned using ABAP statements. The dynamic variant is similar to the variants created on the selection screen.
Once you have the variant (dynamic) ready you can create a background job and submit it within this wrapper program, for which you again have to use the FMs (search createjob*, and go to the function group).
You have to release the submitted job and you can get the status of the job while it is running using the standard FMs provided for this.
Finally, you can create a spool list for the wrapper program that can detail the status of the submitted job.
It is a good idea to delete the dynamic variant once it ahs been used because if required again, it can be created again. If the dynamic variant is created daily or several times a day, it is definitely good to delete it after the use. The right place to do deletion is at the end of the wrapper program after confirming that the job submitted has completed. Or as an alternate strategy, all variants prior to a week can be deleted when the wrapper program runs today (we are using this strategy).
I have used this successfully.
Hope this helps.
Thanks
Sanjeev -
Regarding Background processes
Hi,
I need information regarding the Oracle background processes how it works internally step by step process for all the Background Processes and kindly tell me is their any duration for all the processes and kindly tell me is their online site so that i can learn and tell me how do we manage the tablespaces and i do not know sql kindly tell me how to learn sql and pl/sql?if you provide me the link for all these i would be garteful.
regards,
sudhir... and specifically start the reading from Oracle Concepts.....In the paragraph(s) regarding the Oracle bkg processes , there are links that direct you to other more detailed docs....
Have a good reading.....
Greetings... -
Regarding background processing of the session
Hi Gurus
I have some records in my flat file.
While i am doing uploading the file using tc, in foreground it is processing correctly and no issues.
While in Background some of the records are not processing properly and in sm35 for those records I am getting the message :"InCorrect".
What may be the reasons I am not getting.
Can you please suggest me where may be the wrong exactly.
Your suggestions are highly encouragable.
Regards,
kumarHi Sree Ram,
This is a very common problem faced in Mass upload of data. This mainly happens if the current transaction is dependent on the previous transaction. For e.g. transaction 2 has a dependency on sucessfull processing of transaction 1.This is due to the time taken by the transaction to update the database table.
Put a commit statement after every transaction in your recording and this will ensure that the records are updated and you will not face any problem in background processing.
Regards,
Guru -
Submit report in background on specific server
Hi,
I like to execute a report on a specific server in background. Is there a FM to do this. I know I can use SM36, but that's not the way I want it.
Regards,
GJ van HollandHi,
Here is a sample code.
Report bkgnd.
Perform dobackground.
FORM dobackground.
Local parameters declaration
DATA : jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount.
DATA : ws_spld LIKE pri_params-pdest,
ws_lstname LIKE pri_params-plist,
ws_listext LIKE pri_params-prtxt.
DATA : params LIKE pri_params,
arparams LIKE arc_params,
days(1) TYPE n VALUE 2,
valid TYPE c.
jobname = 'job_name'.
ws_lstname = 'list_name'.
ws_listext = 'List_text'.
Create a job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
Set print parameters
SELECT SINGLE spld INTO ws_spld FROM usr01 WHERE bname = sy-uname.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING destination = ws_spld
list_name = ws_lstname
list_text = ws_listext
immediately = ' '
line_size = 200
line_count = 65
no_dialog = c_true
IMPORTING out_parameters = params
out_archive_parameters = arparams
valid = valid.
Submit the report to create spool with retreived print parameters
SUBMIT your_program
WITH parameters_if_any
TO SAP-SPOOL
SPOOL PARAMETERS params
ARCHIVE PARAMETERS arparams
WITHOUT SPOOL DYNPRO
VIA JOB jobname NUMBER jobcount
AND RETURN.
Close job
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount
jobname = jobname
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
invalid_target = 8
OTHERS = 9.
ENDFORM.
Hope this was of use to you.
Thanks,
Susmitha -
Regarding background processing
hi experts,
i have developed a report in which huge amount of data is involved so i decided to execute in the background,,,for this i created the variant and for back ground i wrote this code but when i execute this it gives an error plz help me to solve this problem sud i change something in the variant or in the function module....
report given here::::
REPORT ZBACKGROUND.
parameters:job(32) .
data:count like btcevtjob-JOBCOUNT,
teamit like TBTCJOB-AUTHCKNAM.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
DELANFREP = ' '
JOBGROUP = ' '
JOBNAME = JOB
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
JOBCLASS =
IMPORTING
JOBCOUNT = COUNT
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ SY-SUBRC.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
ARCPARAMS =
AUTHCKNAM = TEAMIT
JOBCOUNT = COUNT
JOBNAME = JOB
REPORT = 'ZRAW_PRODUCTION_REPORT'
VARIANT = 'ZRAW'
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ SY-SUBRC.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = COUNT
JOBNAME = JOB.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ SY-SUBRC.
error:::ShrtText
Exception condition "INVALID_JOBDATA" raised.
What happened?
The current ABAP/4 program encountered an unexpected
situation.
Error analysis
A RAISE statement in the program "SAPLBTCH" raised the exception
condition "INVALID_JOBDATA".
Since the exception was not intercepted by a superior program
in the hierarchy, processing was terminated.
Short description of exception condition:
Error in Job Data, See SYSLOG
For detailed documentation of the exception condition, use
Transaction SE37 (Function Library). You can take the called
function module from the display of active calls.
Trigger Location of Runtime Error
Program SAPLBTCH
Include LBTCHU24
Row 308
Module type (FUNCTION)
Module Name JOB_SUBMIT
ource Code Extract
ine SourceCde
278 GLOBAL_STEP_TBL-AUTHCKNAM = AUTHCKNAM.
279 GLOBAL_STEP_TBL-STATUS = BTC_SCHEDULED.
280 MOVE-CORRESPONDING PRINT_PARAMS TO GLOBAL_STEP_TBL.
281 MOVE-CORRESPONDING ARC_PARAMS TO GLOBAL_STEP_TBL.
282 APPEND GLOBAL_STEP_TBL.
283
284 CALL FUNCTION 'BP_JOB_MODIFY'
285 EXPORTING
286 DIALOG = DIALOG_FLAG
287 JOBCOUNT = GLOBAL_JOB-JOBCOUNT
288 JOBNAME = GLOBAL_JOB-JOBNAME
289 NEW_JOBHEAD = GLOBAL_JOB
290 OPCODE = BTC_MODIFY_WHOLE_JOB
291 TABLES
292 NEW_STEPLIST = GLOBAL_STEP_TBL
293 EXCEPTIONS
294 CANT_ENQ_JOB = 02
295 INVALID_NEW_JOBDATA = 09
296 OTHERS = 99.
297
298 CASE SY-SUBRC.
299 WHEN 0.
300 *
301 * Stepnummer ermitteln
302 *
303 DESCRIBE TABLE GLOBAL_STEP_TBL LINES STEP_NUMBER.
304
305 WHEN 02.
306 RAISE LOCK_FAILED.
307 WHEN 09.
>>>>> RAISE INVALID_JOBDATA.
309 WHEN OTHERS.
310 RAISE JOB_SUBMIT_FAILED.
311 ENDCASE.
312
313 ENDFUNCTION.Refer to these sample programs
http://www.sapdevelopment.co.uk/reporting/rep_submit.htm
http://www.kabai.com/abaps/z05.htm
REgards,
Santosh -
Execute MCSI report in background : process Output
Hello Folks,
I am working on Ecc 6.0 . i executed the report MCSI (RMCY9200) in background .
I need to process the output of that Job , But could not find any spool for the same job ...
Then i came to know that the Output of the job has to be seen from the Select Version option with the same Report MCSI(tcode)...
But now i have no idea, as how to process that output through an abap program...
Experts, please throw sum light, as how i can process it through an abap program ?
Thanks & regards
Sonal...Hi Rajani,
This is because of the printer specification selected while running/scheduling the job.
Please follow the below steps to get it corrected:
1) Go to SE38, enter the program name and press F8
2) Enter the selection parameters and from menu click Program -> Execute in Background
3) Now you need to select *Properties* button at below
4) Click on Format in the Next window
5) Select one which format with maximun WIDTH ot the width which works for you.
6) Save the Settings and run the job
Hope this helps!
Regards
Shital -
Submit report in background and get result into calling program
Hi,
I want to call the standard SAP program from Zprogram to create invoice using Submit. here the code
SUBMIT RV60SBT1 TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
WITH VKOR1 eq TVKO-VKORG
with X_VBELN eq gv_vbeln_so
with ALLEA eq 'X'
with ALLEL eq ''
AND RETURN.
the standard SAP program creates invoice (billing document number). I want to get the billing document number which created using the above statement into the calling program. ......could anyone pls tell me how to do this? ie how to read the billing document number in the calling program.
Regrds
shan
Edited by: Shankar Raju Devadoss on Mar 21, 2011 9:00 AMHi Shankar,
You can try it in both ways.
1. By using the parameter ID VF. (GET PARAMETE ID)
2. Select the invoice numbers from the table VBRK for the current date (SY-DATUM) and
sort it by time and get the latest invoice.
Regards
Hareesh Menon -
Data of alv report in excel file in background processing using open datas
Hi Experts,
I have developed report for purchase register . if i execute this report in background process i am not able to get the downloaded file in excel and output is also not coming properly, columns are going to overlap.
i used open dataset read dataset and close dataset but still problem is not solved. so if anyone have code with this and also which will have concatenate statement in the code send it.
Regards,
RahulHi Rahul,
Ur code shud be like below:
DATA : l_filename2 TYPE string,
v_extn.
SPLIT p_filename AT '.xls' INTO l_filename2 v_extn.
CONCATENATE l_filename2 'downloaded' INTO l_filename2 SEPARATED BY '_'.
CONCATENATE l_filename2 'txt' INTO l_filename2 SEPARATED BY '.'.
OPEN DATASET l_filename2 IN TEXT MODE FOR OUTPUT ENCODING DEFAULT.
IF sy-subrc <> 0.
MESSAGE e499(sy) WITH text-e02.
ENDIF.
LOOP AT it_order_number INTO wa_order_number.
TRANSFER wa_order_number TO l_filename2.
ENDLOOP.
CLOSE DATASET l_filename2.
Now, go to tcode AL11 and check it in the Application server itself.
Hope this helps,
Regards,
Arnab. -
Background processing of interactive alv lists
Hi,
I have an interactive alv list which works fine with online processing. When run in background it only create spool for the first list. What can be a solution other than merging all the secondary alv list to the primary list level. Can we create alv list (for background proesiing mode) for more than one internal table. (I think normally we can have only one internal table displayed in a list using reuse_alv). Please inform me if further details has to be published.
Thanks and regards,
Rajeeve Patriconline after first display user can interact with the report and so the secondary report can be displayed....now in background mode if u run it spools out first report...Now, someone has to interact with this report so that second report can be shown...But user can't interact with the first report in background process.....so, it might be that if report is running in background then the 2 reports needs to be merged and shown in one report...
-
Hi Experts,
I have developed report for purchase register . if i execute this report in background process i am not able to get the downloaded file in excel and output is also not coming properly, columns are going to overlap.
i used the functional module SAP_CONVERT_TO_XLS_FORMAT, but it is coming without data i.e excel file is blank.So tell me How to download excel file in background process
directly? If u have reference code send me.
Regards,
Balu.KHi Bala,
Below is the sample code...
PARAMETERS: p_file TYPE fileextern DEFAULT '/sapout/xyz'.
File on Application Server
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
Transfer the content.
LOOP AT gt_output INTO gs_output.
TRANSFER gs_output TO p_file LENGTH 1000.
ENDLOOP.
CLOSE DATASET p_file.
Hope it will help.
About SPAD, follow the below steps.
Goto SPAD-> Full Administartion-> Device Types-> Format Types->
Check for the format X_65_1024/4.
This is the maximum allowed size format with 65 lines and 1024 charcters.
If its there you can use it.
Or create a new format with 65 lines(20000 lines are allowed without page breaks) and 1024 columns(maximum allowed) Z_65_1024.
Then copy the standard Device type to ZSAPWIN and attach the new format Z_65_1024.
Then copy the Output device LOCL to ZLOCL and assign device type ZSAPWIN.
Then while sheduling jobs in background you can use ZLOCL with the new fromat Z_65_1024.
BR/Manas -
Background processing in ALV Oops
Hi all,
I have requirement to execute a report in background processing.I have to create report using classes.
Iam using class cl_gui_alv_grid for creating report.When iam executing report in background am getting Fatal errror-GUI can not be reached.
Regards,
Srilatha.Hi,
The issue is bcz. in background screen container is not recognized.
Change the code as follows:
SET PF-STATUS 'SCREEN_100'.
SET TITLEBAR 'xxx'.
<b>*if program is run in background
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING
e_offline = off.
IF off IS INITIAL.
IF container1 IS INITIAL.
CREATE OBJECT container1
EXPORTING
container_name = 'CC_ALV1' .
ENDIF.
ENDIF.
CREATE OBJECT g_grid1
EXPORTING
i_parent = container1.</b>
PERFORM prepare_field_catalog.
PERFORM exclude_button.
PERFORM display_alv.
Best regards,
Prashant -
Suppress spool in Submit Report
Hi All
I am doing a Submit Report in background in loop.
I can check from the background job if the Submit was successful or not. But if it is successful I dont want any output in spool.
By default it is creating a spool request for every Submit.
But dont want any spool to be created as the submit will be executed no. of times.
Kindly let me know if and how we can suppress the spool request. The code I have written is attached below.
LOOP AT lt_t320a INTO ls_t320a.
SUBMIT XYZ
WITH matnr IN matnr
WITH werks = ls_t320a-werks
TO SAP-SPOOL SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB job NUMBER jno
AND RETURN .
ENDLOOP.
Thanks in advance.
Regards
PrafullaHi Narinder,
I have tried without TO SAP-SPOOL but it doesn't work.
Submit is automatically creating the spool request when run in background mode.
Kind Regards
Prafulla
Maybe you are looking for
-
Loading songs onto same iPod, different computers
Can you load your iPod from different computers (iTunes installed on both)? When I tried to load some new stuff from a different location, it says it's linked to another iTunes library, do I want to replace what's on the iPod with the new library (so
-
Can no longer open a folder while dragging a file into it...
Suddenly I am unable to drag a file into a folder, hold it over that folder and have the folder open so I can then navigate within that folder before dropping the file (does that make sense?)...it has been working just fine for some time and now it w
-
"Put harddisks to sleep when possible" vs longer HDD life?
Something I've been pondering: I can save battery by telling the computer to put the harddisk to sleep when possible, but am I sacrificing HDD life span by spinning it up and down often?
-
I want to buy Photoshop, not rent it for a mensual fee.
Is it possible to buy a licence and install Photoshop CC on an unique PC ? I don't want to pay for Cloud on a mensual or annual basis.
-
Hi all i am using session for my loginid in my jsp...i have been maintaining the loginid session nearly to 30 forms...so when a user sits idle for 15 minutes ,then automatically it should identify with a script message or redirect to login page indic