Submit rfbibl01 fails in background as 'LIST_FROM_MEMORY' raising exceptio
Hi All,
I have a requirement where I submit "rfbibl01" in a custom program. The program works fine in foreground. Below is the code I am using for foreground run. The list output of rfbibl01 is being written to memory using the below submit statement and then read using FM 'LIST_FROM_MEMORY' into an internal table. This internal table is being used for further processing.
SUBMIT rfbibl01 WITH ds_name = v_filetemp
WITH fl_check = v_fl_check
WITH os_xon = ''
WITH xnonunic = ''
WITH callmode = 'C'
WITH max_comm = '1000'
WITH pa_xprot = ''
WITH anz_mode = 'N'
WITH update = 'S'
WITH xpop = ''
WITH xlog = 'X'
WITH xinf = ''
EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = i_memory_list[]
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
Error 'List not Found' .
ENDIF.
The same code gives exception for FM 'LIST_FROM_MEMORY', when run in background. The submit statement is successfull, but the FM raises error message and so the background processing is stopped.
I have tried changing my code for background mode as below.
CONSTANTS: c_job TYPE tbtcjob-jobname VALUE 'ZFXL_56632_GL_ALINEA_SUB',
c_kind TYPE c VALUE 'P',
c_sign TYPE c VALUE 'I',
c_dest(8) TYPE c VALUE 'HPMISPRT',
c_true TYPE c VALUE 'X',
c_option(2) TYPE c VALUE 'EQ'.
DATA: v_jobcnt TYPE tbtcjob-jobcount,
v_desc(200) TYPE c,
l_release(1) TYPE c.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = c_job
IMPORTING
jobcount = v_jobcnt
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: print_parameters TYPE pri_params,
archi_parameters TYPE arc_params,
valid_flag(1) TYPE c,
v_spono TYPE sy-spono.
TYPES: BEGIN OF t_tsp01,
rqident TYPE tsp01-rqident,
rqcretime TYPE tsp01-rqcretime,
END OF t_tsp01.
DATA i_tsp01 TYPE STANDARD TABLE OF t_tsp01.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
layout = 'X_65_132'
line_count = 65
line_size = 132
IMPORTING
out_parameters = print_parameters
out_archive_parameters = archi_parameters
valid = valid_flag
EXCEPTIONS
invalid_print_params = 2
OTHERS = 4.
IF valid_flag <> space AND sy-subrc = 0.
Submit program in background to transfer log
SUBMIT rfbibl01 WITH ds_name = v_filetemp
WITH fl_check = 'X' " v_fl_check
WITH os_xon = ''
WITH xnonunic = ''
WITH callmode = 'C'
WITH max_comm = '1000'
WITH pa_xprot = ''
WITH anz_mode = 'N'
WITH update = 'S'
WITH xpop = ''
WITH xlog = 'X'
WITH xinf = ''
EXPORTING LIST TO MEMORY AND RETURN
VIA JOB c_job
NUMBER v_jobcnt
TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
ARCHIVE PARAMETERS archi_parameters
WITHOUT SPOOL DYNPRO
WITH destination = c_dest
WITH immediately = 'X' "space
WITH keep_in_spool = c_true
AND RETURN.
COMMIT WORK.
SELECT rqident RQCRETIME
FROM tsp01
INTO table i_tsp01
WHERE rqowner EQ sy-uname.
v_spono = sy-spono.
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = v_jobcnt
jobname = c_job
IMPORTING
JOB_WAS_RELEASED =
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
But I do not see any spool number generated. My requirement is to use this spool number, job name and job number to get the list that is written to the spool and then do some processing on it.
Can anyone suggest me how to solve this issue?
<b><REMOVED BY MODERATOR></b>
Thanks,
Deepthi
Message was edited by:
Alvaro Tejada Galindo
Hello Deepthi,
Check whether the report is displaying ALV grid when it is executed in bacground.
Since when the report displays ALV grid then u can't export the list to memory from ALV grid.
Regards,
Vasanth
Similar Messages
-
BAPI_DOCUMENT_CREATE2 fails in Background
Hi everyone,
I wrote an ABAP-report calling BAPI 'BAPI_DOCUMENT_CREATE2'.
This ABAP has to create a document and upload files per FTP into DMS (Checkin)
Works Online fine (cause the BAPI avoids FTP as a GUI is online available) but miserably fails in background:
Message: RFC callback calls are not allowed in the ABAP...
This message comes from a failed call of the FM 'SYSTEM_START_REG_SERVER'
in the FM 'CV120_FTP_START_REG_SERVER' as described in an old thread (Error in Check in of Originals by BAPI In background)
Sample of the BAPI-call:
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = documentdata
pf_ftp_dest = 'SAPFTPA'
IMPORTING
documenttype = documenttype
documentnumber = documentnumber
documentpart = documentpart
documentversion = documentversion
return = return
TABLES
documentdescriptions = documentdescriptions
objectlinks = objectlinks
* documentstructure = documentstructure.
* documentfiles = documentfiles
* documentstructure = documentstructure.
documentfiles = documentfiles.
I tried a lot, even in 2 steps (first create the doc per BAPI, second checkin per call of CVAPI_DOC_CHECKIN)
but in everycase, i always get the same problem...
Any help will greatly be appreciated : i daily and manually (ok, even if 1 report launch per day is sufficent) have to upload aprox.
2000 PDFs ...
Thanks in advance for answering...
Edited by: Guillaume Delorme on May 5, 2010 11:08 AMHi everyone,
Due to holidays, i gotta post under another account...
There was a logical mistake in my problem:
-> i thought i had to do the physical checkin of the files while or after the BAPI_DOCUMENT_CREATE2-call.
In my case, the content-server is reachable from the app-server as it's been defined in the AL11.
The content-server is directly defined in table TDWD with complete directorypath as a vault-server (NO DVA-VAULT).
The SAP-FBs do actually handle two cases for file-checkin that can suit my concern::
-> DVA-Vault?->FTP-Connect for filetransfer
-> No DVA-Vault? ->Local GUI-Upload for filetransfer
For background-processing fails always the GUI-Upload -> normal
I don't use any DVA-Vault -> i must do something else.
Solution: Ridiculously easy...
*-> FIRST :Physical Checkin over a stupid TRANSFER DATASET for the file.
*If OK:
*->SECOND: Call of BAPI_DOCUMENT_CREATE2 with reference to the transferred File
* ->Structure BAPI_DOC_DRAW2:
* -> Short Dataname in BAPI_DOC_DRAW2-docfile1
* -> Datacarrier in BAPI_DOC_DRAW2-datacarrier1 (actually the key for the VAULT-server)
* -> App.type in BAPI_DOC_DRAW2-wsapplication1.
* -> Description, Documentype, username, laboratory are must-fields with my customizing too.
* ->Internal Table BAPI_DOC_FILES2:
* -> Short Dataname in BAPI_DOC_FILES2-docfile
* -> Datacarrier in BAPI_DOC_FILES2-storagecategory (actually the key for the VAULT-server)
* -> App.type in BAPI_DOC_FILES2-wsapplication.
* -> no other fields required for this table
* ->(...)
*endif.
Now it runs fine every 5 minutes and i handle about 3000 documents a day...
I give points to Phillip van den Heever who reminded me the AL11-Setting and i mark this topic solved as soon as i can...
Thanks to everyone and greets,
Guillaume Delorme -
Code to Submit RIMODGEN in the Background
Does anyone know how to submit RIMODGEN in the background? Here's a small clip of my code. I don't think the problem is with my parameters. The program executes but the integration model is not created.
CLEAR gt_params.
PERFORM load_params USING 'I_INCR' 'P' 'I' 'EQ' 'X'. "Dark Mode
PERFORM load_params USING 'I_MODID' 'P' 'I' 'EQ' p_model.
PERFORM load_params USING 'I_LOGSYS' 'P' 'I' 'EQ' p_lsys.
PERFORM load_params USING 'I_APPL' 'P' 'I' 'EQ' 'MATERIALS'.
PERFORM load_params USING 'I_MATINC' 'P' 'I' 'EQ' 'X'.
LOOP AT gt_mara INTO gs_mara.
PERFORM load_params USING 'MA_MATNR' 'S' 'I' 'EQ' gs_mara-matnr.
ENDLOOP.
SUBMIT rimodgen
WITH SELECTION-TABLE gt_params
AND RETURN.
Thanks in advance for any help someone can provide.
MikeCould you please elaborate on your requirement. In general we use SM36 and SM37 for IM creation and scheduling. For IM activation you have to use program RIMODAC2 and create and schedule job using SM36 and SM37
Thanks
Aparna
Edited by: Saradha Ramesh on Jun 12, 2009 6:15 PM -
Submit ALV report in Background & exporting list to memory and return
Dear all,
I created one Z program (ZPROGRAM2).
Here i use SUBMIT ZPRORAM1_ALV exporting list to memory and return.
call function 'LIST_FROM_MEMORY'.
call function 'TABLE_COMPRESS' .
ZPRORAM1_ALV output i send mail.
This all are working in foreground.
If i schedule ZPROGRAM2 in background. that SUBMIT ZPRORAM1_ALV statement not working.
Please give me the Solution.
Thanks,
Durai.VIt is because of the ALV output that you are using. Check the condition sy-batch = 'X' (background processing) and then display a classical report. It will work then.
Thanks,
Jayant -
Submit in report in Background job.
Hi, In a report trasaction MCBE is submitted. When this report is executed in back ground there is no spool list generated but in job log a selection version ID is shown. As a result submit ....exporting list to memory is failing.
Is there any way to export the data during background execution of the report to ABAp memory??
Thanks, Kapil,Hi,
use submit to spool
Refer to the code below
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = v_jobname
IMPORTING
jobcount = v_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Submit Report
SUBMIT rkaep000 TO SAP-SPOOL
VIA
JOB v_jobname " JOBNAME
NUMBER v_jobcount " UNIQUE ID OF JOB
IMMEDIATELY ' '
WITHOUT SPOOL DYNPRO "SKIP PRINT DIALOG SCREEN
USING SELECTION-SCREEN 0100
WITH p_tcode = 'KSB1'
WITH kostl IN s_kostl
WITH kstgr = p_ksgru
WITH kstar IN s_kstar
WITH koagr = p_kagru
WITH r_budat IN s_budat
WITH p_disvar = v_layout
AND RETURN.
COMMIT WORK.
CLOSE THE JOB
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
AT_OPMODE = ' '
AT_OPMODE_PERIODIC = ' '
CALENDAR_ID = ' '
EVENT_ID = ' '
EVENT_PARAM = ' '
EVENT_PERIODIC = ' '
jobcount = v_jobcount
jobname = v_jobname
LASTSTRTDT = NO_DATE
LASTSTRTTM = NO_TIME
PRDDAYS = 0
PRDHOURS = 0
PRDMINS = 0
PRDMONTHS = 0
PRDWEEKS = 0
PREDJOB_CHECKSTAT = ' '
PRED_JOBCOUNT = ' '
PRED_JOBNAME = ' '
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
STARTDATE_RESTRICTION = BTC_PROCESS_ALWAYS
strtimmed = 'X'
TARGETSYSTEM = ' '
START_ON_WORKDAY_NOT_BEFORE = SY-DATUM
START_ON_WORKDAY_NR = 0
WORKDAY_COUNT_DIRECTION = 0
RECIPIENT_OBJ =
TARGETSERVER = ' '
DONT_RELEASE = ' '
TARGETGROUP = ' '
DIRECT_START =
IMPORTING
JOB_WAS_RELEASED =
CHANGING
RET =
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.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
regards
Pankaj -
Hi,
We have a query regarding submission of Jobs in background. If we use JOB_OPEN,JOB_CLOSE in our executable program to submit a job to run this proram with a transaction code and also schedule this job in background using SM36 the what will be the effect?Hi pankaj,
1. If the program only display some data,
and does not update anything,
then nothing will go wrong.
2. Both programs will run independently of each other,
in background.
regards,
amit m. -
SUBMIT REPORT AS A BACKGROUND JOB
Hi all,
I am executing one report in foreground in that report i want to submit one report which should be executed in background only. how it is possible to execute 2nd report in <b>background mode</b> only.
Regards
deepakThis is the Basic code to Achieve that.
Call Function 'JOB_OPEN'
SUBMIT RSBDCBTC
via background Job <Job info>
With QIE = <QID Returned by BDC_OPEN_Group FM>
AND RETURN.
Call Function 'JOB_CLOSE'
2) Also go through this
DATA: lv_job_name LIKE tbtco-jobname,
lv_job_nr LIKE tbtco-jobcount,
lv_job_released TYPE c,
lv_job_start_sofort TYPE c,
lv_print_parameters TYPE pri_params.
lv_job_name = 'Z_BGPROGRAM'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = lv_job_name
IMPORTING
jobcount = lv_job_nr
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF syst-subrc = 0.
" submit job with all the selection screen params...
SUBMIT (lv_job_name)
WITH applfile = applfile " these are the parameters of the background program
WITH p_lines = p_lines
USER syst-uname " you must use this
VIA JOB lv_job_name NUMBER lv_job_nr AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lv_job_nr
jobname = lv_job_name
strtimmed = 'X'
IMPORTING
job_was_released = lv_job_released
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 syst-subrc <> 0.
MESSAGE i162(00) WITH
'An error occured while closing the background job.'.
STOP.
ENDIF.
ENDIF.
ENDIF.
SKIP 1.
WRITE: / 'Background process', lv_job_name , 'called successfully' NO-GAP.
WRITE: / 'You can check the job in transaction SM37'.
Thanks -
Not able to Submit CJI5 report in background using Variant
Hi Experts,
Is it possible to fill the multiple screens through FM rs_create_variant.
Reagrds,
NavaHi Ramesh,
I am trying to submit the CJI5 report in back ground through variant. The varaint was created using FM RS_CREATE_VARIANT. it's throughing an error .
IF I create variant directly via selectin screen then it's working fine.
FYI.
REPORT z_co99_cji5
NO STANDARD PAGE HEADING
MESSAGE-ID 00
LINE-SIZE 290.
PROGRAM : Z_CO99_CJI5 *
TITLE : CJI5 In Background *
AUTHOR. : Raja Nesanoor *
DATE WRITTEN : 27-Feb_2007 *
REVTRAC : xxxxxx *
PROGRAM FUNCTION: *
To DISPLAY CJI5 Report in background *
PROGRAM TYPE : Executable program *
DEV. CLASS : XXXXXX *
LOGICAL DB : NA *
AUHTORIZATION CHECKS *
Object Authorization Fields ABAP Fields *
S_TCODE *
BUKRS v_BUKRS *
CHANGE HISTORY *
Date Id Name Indicator Description *
DATA : v_repid LIKE sy-repid VALUE 'ZRKPEP005' ,
v_variant LIKE varid-variant VALUE 'V_CJI5' .
DATA: BEGIN OF w_varid.
INCLUDE STRUCTURE varid.
DATA: END OF w_varid.
DATA: BEGIN OF i_rsparams OCCURS 10.
INCLUDE STRUCTURE rsparams.
DATA: END OF i_rsparams.
DATA: BEGIN OF i_rsparams1 OCCURS 10.
INCLUDE STRUCTURE rsparams.
DATA: END OF i_rsparams1.
DATA: BEGIN OF i_varit OCCURS 2.
INCLUDE STRUCTURE varit.
DATA: END OF i_varit.
DATA: BEGIN OF i_vscreens OCCURS 2.
INCLUDE STRUCTURE rsdynnr.
DATA: END OF i_vscreens.
start-of-Selection
START-OF-SELECTION.
SET PARAMETER ID 'CAC' FIELD 'GC10'.
SET PARAMETER ID 'PDB' FIELD '000000000001'.
PERFORM populate_var_table.
PERFORM create_variant.
PERFORM submit_cji5.
*& Form POPULATE_VAR_TABLE
text
--> p1 text
<-- p2 text
FORM populate_var_table .
CLEAR w_varid .
REFRESH i_varit .
REFRESH i_rsparams .
i_rsparams-selname = 'CN_NETNR'.
i_rsparams-kind = 'S'.
i_rsparams-sign = 'I'.
i_rsparams-option = 'EQ'.
i_rsparams-low = '90273536'.
i_rsparams-high = space.
APPEND i_rsparams.
CLEAR : i_rsparams .
i_rsparams-selname = 'CN_NETNR'.
i_rsparams-kind = 'S'.
i_rsparams-sign = 'I'.
i_rsparams-option = 'EQ'.
i_rsparams-low = '90274010'.
i_rsparams-high = space.
APPEND i_rsparams.
CLEAR : i_rsparams .
i_rsparams-selname = 'R_OBDAT'.
i_rsparams-kind = 'S'.
i_rsparams-sign = 'I'.
i_rsparams-option = 'BT'.
i_rsparams-low = space .
i_rsparams-high = space.
APPEND i_rsparams.
CLEAR : i_rsparams .
i_rsparams-selname = 'P_DISVAR'.
i_rsparams-kind = 'P'.
i_rsparams-sign = 'I'.
i_rsparams-option = 'EQ'.
i_rsparams-low = '1SAP' .
APPEND i_rsparams.
CLEAR : i_rsparams .
i_rsparams-selname = 'P_USEDB'.
i_rsparams-kind = 'P'.
i_rsparams-sign = 'I'.
i_rsparams-option = 'EQ'.
i_rsparams-low = SPACE.
APPEND i_rsparams.
w_varid-mandt = sy-mandt.
w_varid-report = v_repid.
w_varid-variant = v_variant.
w_varid-flag1 = space.
w_varid-flag2 = space.
w_varid-transport = space.
w_varid-environmnt = 'A'. "Variant for batch and online
w_varid-protected = space.
w_varid-secu = space.
w_varid-version = '0'.
w_varid-ename = sy-uname.
w_varid-edat = sy-datum.
w_varid-etime = sy-uzeit.
w_varid-aename = space.
w_varid-aedat = space.
w_varid-aetime = space.
w_varid-mlangu = sy-langu.
i_varit-mandt = sy-mandt.
i_varit-langu = sy-langu.
i_varit-report = w_varid-report.
i_varit-variant = w_varid-variant.
i_varit-vtext = 'CO99-OUTPUT'.
APPEND i_varit.
ENDFORM. " POPULATE_VAR_TABLE
*& Form CREATE_VARIANT
text
--> p1 text
<-- p2 text
FORM create_variant .
data: h_rc like sy-subrc.
*Check variant exists.
CALL FUNCTION 'RS_VARIANT_EXISTS'
EXPORTING
report = v_repid
variant = v_variant
IMPORTING
R_C = h_rc
EXCEPTIONS
not_authorized = 01
no_report = 02
report_not_existent = 03
report_not_supplied = 04.
IF h_rc = 0.
CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
EXPORTING
curr_report = v_repid
curr_variant = v_variant
vari_desc = w_varid
TABLES
vari_contents = i_rsparams
vari_text = i_varit
EXCEPTIONS
illegal_report_or_variant = 01
illegal_variantname = 02
not_authorized = 03
not_executed = 04
report_not_existent = 05
report_not_supplied = 06
variant_doesnt_exist = 07
variant_locked = 08
selections_no_match = 09.
COMMIT WORK.
ELSE.
CALL FUNCTION 'RS_CREATE_VARIANT'
EXPORTING
curr_report = v_repid
curr_variant = v_variant
vari_desc = w_varid
TABLES
vari_contents = i_rsparams
vari_text = i_varit
EXCEPTIONS
illegal_report_or_variant = 1
illegal_variantname = 2
not_authorized = 3
not_executed = 4
report_not_existent = 5
report_not_supplied = 6
variant_exists = 7
variant_locked = 8
OTHERS = 9.
COMMIT WORK.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. " CREATE_VARIANT
*& Form submit_cji5
text
--> p1 text
<-- p2 text
FORM submit_cji5 .
CALL FUNCTION 'SUBST_START_REPORT_IN_BATCH'
EXPORTING
iv_jobname = 'TEST_JOB'
iv_repname = v_repid
iv_varname = v_variant
iv_authcknam = sy-uname
iv_language = sy-langu
iv_varianttext = 'CO99-OUTPUT'
TABLES
tt_reportparam = i_rsparams
EXCEPTIONS
variant_exist_check_failed = 1
variant_update_failed = 2
variant_update_not_authorized = 3
variant_update_no_report = 4
variant_update_no_variant = 5
variant_update_variant_locked = 6
variant_insert_failed = 7
variant_insert_not_authorized = 8
variant_insert_no_report = 9
variant_insert_variant_exists = 10
variant_insert_variant_locked = 11
variant_write_failed = 12
no_batch_service = 13
no_server_list = 14
batch_scheduling_failed = 15
OTHERS = 16.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.
Thanks
Nava -
How to submit the report in Background job.
Hello Friends,
In the selection screen I have 2 radio buttons one for background Process & other for foreground processing. if the user selects the background processing the program should execute in background and output need to be sent to SAP Inbox.
Issues:
1) If I am using the JOB_Submit FM or Report Submit the program is going to infinite loop and many continiously jobs are are being scheduled. How to avoid.
2) Is there any best possible way to send the mail to SAP Inbox.
Note: I am using OOALV in my program....
Thanks,
RaviHi,
the first problem looks like you have an infinite recursion. You just need to avoid background scheduling again. There is a system field sy-batch. So if this field is equal to 'X' then you are already in background mode and you don't need to schedule your background job again. Another way is to split your program in two programs. The first will be responsible for scheduling or executing the second one.
You can use FM SO_NEW_DOCUMENT_SEND_API1 to send message to workflow inbox. You need to user receiver type B. There are so many posts on this forum about sending emails from ABAP which may help you with implementing this requirement.
Cheers -
How to submit a Program in Background without wait ?
hi experts,
I have one requirement in which i want to call another executable program from one program by passing some parameters to the calling program from called program. <b>I dont want to wait till the executatio of the calling program gets over.</b>i just want to submit the program & <b>wants to continue with my calling program</b>.
i am not bothered with the results of the called program.
How to do this...
if possible pl. send me the code. especially i am using some parameters & internal tables to be passed to the called program from calling program.
Regards,
UmeshHi Umesh,
You can schedule a job programatically .. Please find below the steps..
This will schedule a background job (and this you can view in Sm37) and returns control to the calling program.
DATA: jobnumber TYPE tbtcjob-jobcount,
jobname TYPE tbtcjob-jobname.
Set the job name
jobname = 'xxx'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobnumber
EXCEPTIONS
OTHERS = 0.
SUBMIT reportname USER sy-uname
VIA JOB jobname
NUMBER jobnumber
WITH param1 = "fill the parms/sel fields with new values
WITH Param2= "fill the parameters/sel fields
AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobnumber
jobname =jobname
strtimmed = 'X'
EXCEPTIONS
OTHERS = 0.
Thank You.
Regards,
Uma -
Using SUBMIT program command in Background
Hi,
I am submitting the program in Background using Submit<program> command.
Job is getting released but not fininishing(not executing the program) in ECC6.0.
Same program is working in fine in 4.5b.
Please let me know if any one faces this situation. Its very urgent.
Expecting the reply from you soon..
Thanks
Regards,
Raj AHi,
perhaps you or your admin have configured to less batch-workprocess or they are all configured only for A-class jobs.
Try to start the job as A-Class job. If the program is executed, then ask your administrator to configure more batch workprocess that are not reserved for A-class jobs.
Regards,
Stefan -
How 'Submit WITH VIEW in background' can be Done
HI EXPERTS
I want to run This code in the background from a zreport .Can any body help me ho can i run this in background.
SUBMIT RSCMPADJ WITH VIEW = TBL_DD02L-TABNAME
WITH RFC_DEST = RFC_DEST
WITH SEL = SPACE
EXPORTING LIST TO MEMORY
AND RETURN .Hello,
1. Call FM : JOB_OPEN
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBGROUP = 'AUTO'
JOBNAME = W_JOBNAME
IMPORTING
JOBCOUNT = W_JOBNO
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4 .
2. SUBMIT RSCMPADJ WITH VIEW = TBL_DD02L-TABNAME
<b>VIA JOB W_JOBNAME NUMBER W_JOBNO</b> WITH RFC_DEST = RFC_DEST
WITH SEL = SPACE
EXPORTING LIST TO MEMORY
AND RETURN .
3. FM: JOB_CLOSE
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = W_JOBNO
JOBNAME = W_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
OTHERS = 8
Regards,
Naimesh -
BAPI_DOCUMENT_CREATE2 failed in background
Hi experts,
when i using this BAPI to create document, it works fine if executed on line. but when executed in background, it failed saying that 'Error while checking in and storing: &'.
the file is already on the application server like:
Erpr3d11\apps\SAP\PM\IMAGE\abc.jpg
can anyone help me? thanks a lot in advance!Hi Wei,
as you have marked this question as solved, I would kindly ask you to post if you have found a suitable solution for your requirement and how it was realised. This will help all other forum users to get similar issues solved too.
Best regards,
Christoph -
Script to Submit XFDF in the background?
I was wondering if anyone has any hints or techniques on how to submit a pdf as XFDF in the background using javascript on a web instance of Adobe Reader. Right now, I have a button that when the user hits save, submits the XFDF to another web page that then saves the data to the database. I'd love to be able to do this without having to redirect the user to a new page. I'd like to be able to just have it save in the background and keep the user on the web page and maybe even use a timer option in Javascript to do an auto submit at a time interval.
Any suggestions?
Thanks
JohnCould you please elaborate on your requirement. In general we use SM36 and SM37 for IM creation and scheduling. For IM activation you have to use program RIMODAC2 and create and schedule job using SM36 and SM37
Thanks
Aparna
Edited by: Saradha Ramesh on Jun 12, 2009 6:15 PM -
External commands fail in Background Jobs on Application server
Hi,
We are having problems with jobs that include External Commands. The jobs run successfully if on the Central Instance. But if they run on either of the two Application Server's it fails with 'Unable to connect to Target Host' error message.
I can run the External Commands from SM49 on both AS's. But as soon as its run in background it fails.
I have read the rfcexec.sec file needs to be in the .\work directory on the application so I have this in place.
This is what gets written to dev_w0 when the failure occurs :
M *****************************************************************************
M *
M * LOCATION SAP-Gateway on host <APP_SERVER> / sapgw75
M * ERROR timeout during allocate
M *
M * TIME Fri May 30 11:20:34 2008
M * RELEASE 640
M * COMPONENT SAP-Gateway
M * VERSION 2
M * RC 242
M * MODULE gwr3cpic.c
M * LINE 1795
M * DETAIL no connect of TP sapxpg from host <CENTRAL_INSTANCE.domain>
M * after 22 sec
M * COUNTER 483
M *
M *****************************************************************************
M
A RFC 1446 CONVID 48742194
A * CMRC=27 DATA=0 STATUS=0 SAPRC=242 ThSAPECMINIT
A RFC> ABAP Programm: SAPLCRFC (Transaction: )
A RFC> User: <USERNAME> (Client: 300)
A RFC> Destination: %_TCPIP_%1 (handle: 2, , )
A RFC SERVER> RFC Server Session (handle: 1, 48741194, {C4A35AF0-2F4C-4E36-98C3-9999A6FE99D7})
A RFC SERVER> Caller host: iblonc4306_P75_75
A RFC SERVER> Caller transaction code: (Caller Program: RSBTCXPG)
A RFC SERVER> Called function module: SXPG_STEP_COMMAND_START
I'd really appreciate any suggestions on how to fix this issue??
Thanks,
KyeHi Siddhesh,
Thank you for your prompt response. I'm confident all of the prerequisites are set correctly.
I have enabled the trace on SAPXPG but its only writing to the log dev_cp and dev_xpg when the command is executed successfully.
For example, if I use SM49 to run the External command from one of the Application Servers dev_cp & dev_xpg are updated and the command completes successfully. However if I run the job (that has the external command as a single step) from SM37 it fails and doesn't log anything to dev_cp or dev_xpg??
Is this normally how the trace would work?
Thanks again,
Kye
Maybe you are looking for
-
I had installed a few weeks ago but removed it and I haven't used this computer since then. I was able to download lightroom with no issues. Any suggestions?
-
CS4 Installation on two computers
I've installed CS4 & Lightroom as an upgrade to CS3 on my XP desktop. Is it possible to use the same disks to install CS4 & Lightroom on my Vista laptop (no CS3 & Lightroom installed)?
-
Speakers are not working on my Pavilion g series Notebook PC
Hello my speakers on my laptop havent been working for a while now, the image below shows the processor. Theearphones still work. It is a 64 bit operating system. Thanks, Richard.
-
Actual Goods Movement Date is missing in 2LIS_11_V_SSL
Hi Daily we are loading the Order Delivery data from the 2LIS_11_V_SSL datasource into the Global Level DSO(ZTEST) and it is snapshot of ECC Production System . That means, only the latest data is avialable in the ZTEST DSO . Now for some of the Sale
-
Error 402653081Trying to install IOS 5 on 3GS
I keep getting this error when trying to instal IOS5 on my 3GS(wsing windows 7) I have updaded I tunes but have tried 4 times to in stall the update. this error comes up when the backing up the iphone data. It says if I reset the phone I will wipe th