Job Close
Hi,
Does anyone know what do the params "PRED_JOBNAME" & "PRED_JOBCOUNT" in FM JOB_CLOSE do when supplied with a job name & count in the respective field values of the job whcich is executed before the former.
Is the FM JOB_CLOSE specific to some authorization??
The problem that im facing is :
There are in all 2 progs-- 1st main program(module pool) ; 2nd dependent prog (report)
Now associated with each is a job(2jobs in all) which runs in the background.
Functionality of the application :
1st program creates 1st job in the backgrnd(thru Job_open,job_submit,job_close)
and after executing this job, a second report is submitted in the backgrnd as a job(2nd job) using the SUBMIT.... VIA JOB......AND RETURN statement followed by JOB_CLOSE supplying 1st job's name & count to the params PRED_JOBNAME &
PRED_JOBCOUNT respectively.
The whole scenario is working fine in Development Environment
Problem is in Staging and Production.
<b>Using my login</b> in Staging
After the 1st job is executed successfully,the 2nd job is not created(it is not even not visible at all if u view it thru sm37).
But using another's login(1 particular login only):
It executes as expected : i.e. 1st job executes successfully followed immediately by the 2nd job.
Now once that particular person has executed that program,everyone else can executed that code thereby creating both the jobs.
But why is it that only he can execut that program the first time enabling others to execute it after he has executed.??
<b>Note : The program is not Login specific at any point</b>
This is for sure that there is no Authorization issue,since 2nd job wud have not been created the 2nd time i executed the prog(after the particular person executed it).
What cud be issue?? Any suggestions??
Its urgent,
Answers will be rewarded.
Regards,
Rohan
Hi,
This function module is well documented by SAP, so just goto se37, type in the FM, then either view the documentation, or the long texts which are provided for the import and export parameters, even some of the exceptions have long texts.
Kind regards, Rob Dielemans
Similar Messages
-
Dispaly job close date in job search page in EREC
Currently applicants can only see job published date when they search jobs, I am just trying to display job closed date which has entered by HR Recruiter.
Any idea how do i display that field on that page so that applicant would know when the specific job closes?
How do i also display job pulish date in mm/dd/yyyy format even if Recruiter enters date in mm/dd/yyyy format it displays in other format?
ThanksHi Experts,
Please help me on this.
Thanks,
Rajeshkumar N -
WIP job close tolerance for 11i+
Has anyone heard if Oracle is considering under-completion tolerances similar to those in purchasing? Due to the nature of our business we close many jobs short and if there were tolerances it sure would make life easier.
The system doesn't "automatically" close jobs. The closest you can get is scheduling a concurrent request.
You chose the job status(es) to be closed. If you close a cancelled job, any charges are written off to variance per the wip accounting class.
Check page 3-90 in the most recent WIP manual.
Basically, the variances are posted in whatever period the job is closed in.
You may want to look at the cost manual for more information. -
WIP Job Close Tolerances in 11i+
Has anyone heard if Oracle is considering under-completion tolerances similar to those in purchasing? Due to the nature of our business we close many jobs short and if there were tolerances it sure would make life easier.
The system doesn't "automatically" close jobs. The closest you can get is scheduling a concurrent request.
You chose the job status(es) to be closed. If you close a cancelled job, any charges are written off to variance per the wip accounting class.
Check page 3-90 in the most recent WIP manual.
Basically, the variances are posted in whatever period the job is closed in.
You may want to look at the cost manual for more information. -
TP IMPORT returns job close failed
we just refreshed our crm qa system from prod. since then i have not been able to get the mass transport(large trunk) to work. when i enter the client, start date/time, and the period i get the following message:
System CQ1 Command TMS_MGR_IMPORT_TR_QUEUE
Client 100 Service TMS Batch Control
User TMSADM Start Hintergrund
Date 09/07/2006 Function TMS_BCI_JOB_CREATE
Time 10:00:59 Message TMS_BCI_JOB_CLOSE_FAILED
Release of TMS_0000000027TMS_TP_IMPORT in QA1 system failed with return code job_close_failed
we are not able to do any automatic transports. any help would be greatly appreciated.
thank youHi Dolores,
I think your question should better be put within a technology part of the sdn forums, this forum is for business process experts, there might not be that much help here...
Did you reconfigure the transport landscape after the system copy P --> Q? Please check from STMS that the config is still correct (transdir etc.).
but, well: the techies might be of more help to you...
kind regards,
Carl -
Problems creating background job for program (job open, submit and close)
Hi gurus,
im trying to start a background job using the FM BP_START_DATE_EDITOR to show the start date to the job or if it's imediate. this FM it's working fine, after call it im opening a job, submiting it and call the job close FM and the job close FM creates me the job.
The problem it's when i go to the sm37 to see the job status the job has been canceled, and the job log says that i have to give a start date to the job.
What i dont understand it's either the job is imediate or i choose a date to start the job always gives me this error...
Below goes my code,
any ideas will be rewarded
CLEAR: stdt_modify_type, stdt_output.
CALL FUNCTION 'BP_START_DATE_EDITOR'
EXPORTING
stdt_dialog = 'Y'
stdt_input = stdt_input
stdt_opcode = 14
IMPORTING
stdt_modify_type = stdt_modify_type
stdt_output = stdt_output
EXCEPTIONS
fcal_id_not_defined = 1
incomplete_last_startdate = 2
incomplete_startdate = 3
invalid_dialog_type = 4
invalid_eventid = 5
invalid_opcode = 6
invalid_opmode_name = 7
invalid_periodbehaviour = 8
invalid_predecessor_jobname = 9
last_startdate_in_the_past = 10
no_period_data_given = 11
no_startdate_given = 12
period_and_predjob_no_way = 13
period_too_small_for_limit = 14
predecessor_jobname_not_unique = 15
startdate_interval_too_large = 16
startdate_in_the_past = 17
startdate_is_a_holiday = 18
startdate_out_of_fcal_range = 19
stdt_before_holiday_in_past = 20
unknown_fcal_error_occured = 21
no_workday_nr_given = 22
invalid_workday_countdir = 23
invalid_workday_nr = 24
notbefore_stdt_missing = 25
workday_starttime_missing = 26
no_eventid_given = 27
OTHERS = 28.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
MOVE 'X' TO gv_flag.
ENDIF.
DATA jobname LIKE tbtcjob-jobname.
DATA jobcount LIKE tbtcjob-jobcount.
DATA job_release LIKE btch0000-char1.
DATA job_imediate TYPE c.
CLEAR: jobname, jobcount, job_release.
CONCATENATE 'MAPAEXEC' sy-uname sy-datum
INTO jobname SEPARATED BY space.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i003(zmapas).
EXIT.
ENDIF.
SUBMIT z_mapa_execucao_orcamental
VIA JOB jobname NUMBER jobcount
WITH ano EQ ano
WITH so_perio IN so_perio
WITH so_date IN so_date
WITH so_org EQ so_org
WITH so_num IN so_num
AND RETURN.
IF stdt_output-startdttyp EQ 'I'.
CLEAR job_imediate.
job_imediate = 'X'.
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
calendar_id = stdt_output-calendarid
event_id = stdt_output-eventid
event_param = stdt_output-eventparm
event_periodic = stdt_output-periodic "?
jobcount = jobcount
jobname = jobname
laststrtdt = stdt_output-laststrtdt
laststrttm = stdt_output-laststrttm
prddays = stdt_output-prddays "??
prdhours = stdt_output-prdhours "?
prdmins = stdt_output-prdmins "??
prdmonths = stdt_output-prdmonths
prdweeks = stdt_output-prdweeks "?
predjob_checkstat = stdt_output-checkstat
pred_jobcount = stdt_output-predjobcnt
pred_jobname = stdt_output-predjob
sdlstrtdt = stdt_output-sdlstrtdt
sdlstrttm = stdt_output-sdlstrttm
strtimmed = job_imediate
targetsystem = stdt_output-instname
start_on_workday_not_before = stdt_output-notbefore
start_on_workday_nr = stdt_output-wdayno
workday_count_direction = stdt_output-wdaycdir
IMPORTING
job_was_released = job_release
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.
MESSAGE i003(zmapas).
EXIT.
ELSE.
MESSAGE i004(zmapas) WITH jobname.
ENDIF.
Thanks in advance,
Best Regards
João MartinsHello João.
In debug mode, check the value of variables you passed to parameters sdlstrtdt and sdlstrttm.
As aditional info, I usually achieve your goal without FM BP_START_DATE_EDITOR.
Check this code:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = w_jobname
IMPORTING
jobcount = w_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
CHECK sy-subrc = 0.
CLEAR seltab_wa.
MOVE: t_jobs-param TO seltab_wa-selname,
t_processar-line+34 TO seltab_wa-low.
APPEND seltab_wa TO seltab.
seltab_wa-selname = 'P_LOJA'.
seltab_wa-low = t_processar-ficheiro+7(4).
APPEND seltab_wa TO seltab.
*** Submete o programa para o JOB
SUBMIT (t_jobs-repid)
WITH SELECTION-TABLE seltab
USER sy-uname
VIA JOB w_jobname NUMBER w_jobcount
AND RETURN.
*** Encerra o JOB
l_hora = sy-uzeit.
ADD 60 TO l_hora.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_jobcount
jobname = w_jobname
sdlstrtdt = sy-datum
sdlstrttm = l_hora
targetserver = w_servidor
IMPORTING
job_was_released = l_liberado
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.
Valter Oliveira. -
Dear All,
I have scheduled a job to run using "JOB_OPEN" " JOB-CLOSE" and submit statements. When i checked the status of the job in job-log, its in cancelled status, with an error "Internal session terminated with a runtime error (refer to ST22)". The exception in ST22 was "OBJECTS_NOT_CHARLIKE" that had occured in the standard pgm "SAPLKKBL".
Kindly let me know what is the reason behind this error.
Thanks,
Vishnu Priya.>
Vishnu Priya K wrote:
The exception in ST22 was "OBJECTS_NOT_CHARLIKE" that had occured in the standard pgm "SAPLKKBL".
Looks like the program you have SUBMITted deals with ALV. Is it a standard program or a custom one ?
BR,
Suhas -
Job Scheduling using job_close
Hi gurus,
im trying to scheduke several jobs using the FM Job close, but the jobs are running paralel..
The first job its' schedule with a start date or imediate, and the letf ones are schedule to start after his precessor finish, but once i run the programa 4 jobs start running ...
Can any one help me on this?
Below goes my code...
DO njobs TIMES.
**Nome de Job
CLEAR: jobname, jobcount, job_release.
CLEAR: job_imediate, str_job.
ADD 1 TO ind_job.
WRITE ind_job TO str_job.
CONCATENATE 'EXECORC' sy-uname sy-uzeit str_job
INTO jobname SEPARATED BY '-'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i003(zmapas).
EXIT.
ENDIF.
IF gv_global EQ 'X'.
**Submit job
SUBMIT z_mapa_execucao_orcamental
VIA JOB jobname NUMBER jobcount
WITH ano EQ ano
WITH so_perio IN so_perio
WITH so_date IN so_date
WITH so_org EQ so_org
WITH so_num IN so_num
AND RETURN.
ELSE.
***Limites
CLEAR: upper_bound, lower_bound.
upper_bound = njobs * ind_job.
lower_bound = upper_bound - njobs + 1.
CLEAR so_num.
REFRESH so_num.
LOOP AT tab_prog FROM lower_bound TO upper_bound.
so_num-sign = 'I'.
so_num-option = 'EQ'.
so_num-low = tab_prog-zlinha.
APPEND so_num.
ENDLOOP.
SUBMIT z_mapa_execucao_orcamental
VIA JOB jobname NUMBER jobcount
WITH ano EQ ano
WITH so_perio IN so_perio
WITH so_date IN so_date
WITH so_org EQ so_org
WITH so_num IN so_num
AND RETURN.
ENDIF.
IF ind_job EQ 1.
IF stdt_output-startdttyp EQ 'I'.
job_imediate = 'X'.
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount
jobname = jobname
sdlstrtdt = stdt_output-sdlstrtdt
sdlstrttm = stdt_output-sdlstrttm
strtimmed = job_imediate
IMPORTING
job_was_released = job_release
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.
MESSAGE i003(zmapas).
EXIT.
ELSE.
CLEAR: predjob, predjobcount, stdt_output.
predjob = jobname.
predjobcount = jobcount.
MESSAGE s004(zmapas) WITH jobname.
ENDIF.
ELSE.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount
jobname = jobname
* predjob_checkstat = 'X'
pred_jobcount = predjobcount
pred_jobname = predjob
* strtimmed = 'X'
IMPORTING
job_was_released = job_release
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.
MESSAGE i003(zmapas).
EXIT.
ELSE.
CLEAR: predjob, predjobcount, stdt_output.
predjob = jobname.
predjobcount = jobcount.
MESSAGE s004(zmapas) WITH jobname.
ENDIF.
ENDIF.
Thanks in Advance,
Best Regards,
João MartinsHello.
First of all, parameter predjob_checkstat makes the second job to start only if the previous one ends without error. Probably this solves your problem at all ... the second waits to the end of the first to see if it ended with error or not.
I was analysing your problem. Parameter strtimmed can only be set in the first JOB_CLOSE. All the others cannot have this parameter set to 'X' if you want them to wait for the end of the previous ones.
So, try predjob_checkstat = 'X' and strtimmed = space.
Also, I have one example that is working:
*** Escalona um JOB para cada ficheiro encontrado.
LOOP AT t_processar.
CLEAR: w_jobcount, w_jobname, l_liberado.
ADD 1 TO l_conta.
MOVE l_conta TO l_conta2.
CONDENSE l_conta2.
CONCATENATE t_jobs-jobname l_conta2 INTO w_jobname.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = w_jobname
IMPORTING
jobcount = w_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
*** Criou-se o JOB com sucesso
IF sy-subrc = 0.
CLEAR seltab_wa.
*** Monta o parâmetro
MOVE: t_jobs-param TO seltab_wa-selname,
t_processar-line+34 TO seltab_wa-low.
APPEND seltab_wa TO seltab.
seltab_wa-selname = 'P_LOJA'.
seltab_wa-low = t_processar-ficheiro+7(4).
APPEND seltab_wa TO seltab.
*** Submete o programa para o JOB
SUBMIT (t_jobs-repid)
WITH SELECTION-TABLE seltab
USER sy-uname
VIA JOB w_jobname NUMBER w_jobcount
AND RETURN.
*** Encerra o JOB
IF l_conta EQ 1.
l_hora = sy-uzeit.
ADD 120 TO l_hora.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_jobcount
jobname = w_jobname
sdlstrtdt = sy-datum
sdlstrttm = l_hora
targetserver = w_servidor
IMPORTING
job_was_released = l_liberado
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.
ELSE.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_jobcount
jobname = w_jobname
predjob_checkstat = 'X'
pred_jobcount = w_jobcount2
pred_jobname = w_jobname2
targetserver = w_servidor
IMPORTING
job_was_released = l_liberado
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. "l_conta eq ...
ENDIF. "sy-subrc = 0 do JOB-OPEN
w_jobname2 = w_jobname.
w_jobcount2 = w_jobcount.
PERFORM f_limpa_param.
ENDLOOP. "at t_processar
Regards.
Valter Oliveira. -
How can i schedule jobs daily by using fm's
hi all,
am using open job ,submit job,close job fm's to schedule back ground jobs,
want to schedule it daily which parameter i need to pass in close_job for daily job schedulingyou can get the clear documentation by using ABAPDOCU transaction.
Regards
Mani. -
BDC is not working as background job
Dear Expert,
I have developed a program which contain BDC of FB75 with mode 'E' . I have Schedule this program as background by FM 'JOB OPEN' , Submit statement and 'JOB CLOSE'. My problem is when i run this program as background BDC is not working.
What is the solution of this problem?
Thanks
AvadheshHi Avadhesh,
if FB75 is doing a commit work, then, your batch job will finish with error at the time of BDC execution.
Try to add the option parameter type CTU_PARAMS to the CALL TRANSACTION with field RACOMMIT = 'X'.
DATA opt TYPE ctu_params.
opt-RACOMMIT = 'X'.
CALL TRANSACTION 'FB75' USING bdcdata_tab OPTIONS FROM opt.
Regards. -
How to schedule job hourly on daily basis
Hi,
Experts.
I want to schedule a job between 9:00 AM to 9:00 PM daily on working days Monday to Friday IST.
It should run on hourly basis daily. Currently we are following the manual process for scheduling the jobs in SM36. We want to automate the process. Can SCMA help in this ?
How to achieve this, would like to have experts insights on the same.
Regards,
Edited by: Sharvari Joshi on Nov 23, 2010 7:36 PMWrite an ABAP report program. with the below code stub.
Further you can check the function group BTCH for more options.
Customize the function call job close.
Hope this helps in automating.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = JOBNAME
JOBCLASS = 'C'
IMPORTING
JOBCOUNT = JOBCOUNT
EXCEPTIONS
CANT_CREATE_JOB = 01
INVALID_JOB_DATA = 02
JOBNAME_MISSING = 03.
IF SY-SUBRC NE 0.
exit."error processing
ENDIF.
SUBMIT (JOBNAME)
USER SY-UNAME
VIA JOB JOBNAME
NUMBER JOBCOUNT
AND RETURN.
IF SY-SUBRC = 0.
ELSEIF SY-SUBRC = 4.
RAISE SCHEDULING_CANCELLED_BY_USER.
ELSEIF SY-SUBRC = 8.
RAISE ERROR_DURING_SCHEDULING.
ELSEIF SY-SUBRC = 12.
RAISE ERROR_IN_INTERNAL_NUMBER_ASSIG.
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
* AT_OPMODE = ' '
* AT_OPMODE_PERIODIC = ' '
* CALENDAR_ID = ' '
* EVENT_ID = ' '
* EVENT_PARAM = ' '
* EVENT_PERIODIC = ' '
JOBCOUNT =
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 = ' '
* 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. -
SUBMIT VIA JOB MESSAGE TYPE 'E'
Hi!
Please help me, I can't use submit via background job, because he can't handle message errors of type 'E'. When this kind of message occurs, all background processing stops and I get a report screen with this message in the status bar.
Is there any solution?Let me understand this. You have a program A from which you submit a program B in the background and if in program B an error is raised, your program A execution stops. Is this true?
Did you do a job close in your code. Here is a sample program ZTEST1 that submits another program ZTEST2 in the background. If there is an error message thrown out in ZTEST2, the job submitted is cancelled, with the job log showing the error message. The processing of ZTEST1 continues even after that.
I don't know why yours is not. Please let us know.
<u>Program ZTEST1</u>
REPORT ztest1 .
PARAMETERS: p_matnr1 LIKE mara-matnr.
DATA: v_jobcount LIKE tbtcjob-jobcount,
v_jobname LIKE tbtcjob-jobname.
START-OF-SELECTION.
v_jobname = 'TESTJOB'.
*-- open the job
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 the report
SUBMIT ztest2 WITH p_matnr2 = p_matnr1
USER sy-uname VIA JOB v_jobname
NUMBER v_jobcount AND RETURN.
*-- close the job
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = v_jobcount
jobname = v_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.
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:/ 'Job submitted successfully.'.
<u>Program ZTEST2</u>
REPORT ztest2 MESSAGE-ID zz.
PARAMETERS: p_matnr2 LIKE mara-matnr.
DATA: itab LIKE mara OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
SELECT * INTO TABLE itab FROM mara
WHERE matnr = p_matnr2.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid material number'.
ENDIF.
LOOP AT itab.
WRITE:/ itab-matnr.
ENDLOOP. -
FM for Shdule a job immediately
I want to assign a job in background which has to process immediately.
I am running a program ...from that I will send the sales order number to another program in selection screen and will run that program in background.
What is the function module forthis.
In this function module I need to send the reportname and sales ordernumber as input.Hello,
Does it have to be submitted to a function module?
We have done a similar process with a program by using:
From Program A:
Call Function 'Job Open'
exporting
jobname = g_jobname
importing
jobcount = g_jobnumber
exceptions
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
SUBMIT program_name
with <selection screen parameters>
user user_name
via job g_jobname
number g_jobnumber
and RETURN.
Call Function 'Job Close'
Otherwise, from an RFC, we have done this:
call function 'Z_MY_FUNCTION_MODULE'
in background task
destination 'NONE'
tables
table = z_table.
This allows the RFC to finish without waiting for the completion of the Z function module.
Hope this helps!
K--- -
Discrete job History tab shows wrong completed qunatity
Hi All
We are facing an issue, When we perform the WIP completion trx thru mobile apps the completed quantity in discrete job history is not in sink with the transaction.Can any one comment on this issue.
job qnty:256
job status:Closed
In history tab
remaning qnty:135
completed qnty:121
Performed the WIP completion trx for qnty 135 and then for qnty 121 thru mobile apps
ThanksWelcome to the Forum.
First off if the job belongs to a open INV period, unclose the job (WIPUser>>Discrete>>Close Discrete Jobs>>Close Discrete Jobs (Form)>>Tools>>Unclose).
Then check if there are any pending WIP completions from back end using
peding LPN drop-
SELECT *
FROM apps.WIP_LPN_COMPLETIONS WLC,
apps.WMS_LICENSE_PLATE_NUMBERS LPN
WHERE WLC.ORGANIZATION_ID = 477
AND WLC.LPN_ID = LPN.LPN_ID
AND LPN.LPN_CONTEXT = 2
AND WIP_ENTITY_ID = :P ---your WIP_entity_id
-- Pending Material Transactions
SELECT *
FROM apps.MTL_MATERIAL_TRANSACTIONS_TEMP MMTT
WHERE ORGANIZATION_ID = 477
AND TRANSACTION_SOURCE_TYPE_ID = 5
AND TRANSACTION_TYPE_ID = 44 ---WIP ASSY COMPLETION
AND TRANSACTION_SOURCE_ID NOT IN
(SELECT TXN_SOURCE_ID
FROM apps.MTL_TXN_REQUEST_LINES
WHERE TXN_SOURCE_ID = MMTT.TRANSACTION_SOURCE_ID
AND ORGANIZATION_ID = MMTT.ORGANIZATION_ID
AND LINE_STATUS = 9)
AND TRANSACTION_SOURCE_ID = :P ---your WIP_entity_id
If you have records in this check then and try to manually drop the LPN into the destination subinventory.
HTH -
How to find the job has failed in back ground
Hi All,
I have a requirement where i will be running a report online and background.
If my job has failed in Background, then i have to trigger a mail to the user stating that the job has been terminated.
Now, How will i know the Job has failed and how should i handle this in my report so as to trigger a mail.
Hope i am clear with my requirement.Kindly clarify if possibe with any func modules or sample codings.
Thanks in advance
NandaHi try that:
try:
1) fm job_open
2) submit report
3) fm job_close
4) finally select table TBTCO
example:
DATA: jobcount_test LIKE tbtcjob-jobcount,
job_released LIKE btch0000-char1,
rcode(2),
strtimmed LIKE btch0000-char1 VALUE 'X'.
DATA jobname LIKE tbtcjob-jobname.
CONCATENATE 'TEST_' sy-repid '_' sy-datum INTO jobname.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount_test
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE x000(yp) WITH 'JOB-START ' jobname ' failed !!!'.
ELSE.
*--Step insert
SUBMIT rsbdcsub
USER sy-uname VIA JOB jobname NUMBER jobcount_test
WITH mappe = map
WITH von = pdatum
WITH z_verarb = 'X'
AND RETURN .
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount_test
jobname = jobname
strtimmed = strtimmed
targetsystem = sy-host
IMPORTING
job_was_released = 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 sy-subrc > 1.
MESSAGE x000(yp) WITH 'JOB-CLOSE ' jobname ' failed!!!'.
ENDIF.
ENDIF.
Andreas
Maybe you are looking for
-
Mac Mini, Front Row and projection TV?
I am wondering whether our plan to get a new MacMini with Front Row to be the heart of our entertainment system is a good idea. We want to use the Mac as our DVD player and stereo (music) source. We also want to get a fairly high resolution projector
-
How to send a group notification in approval process?
I'd like to send a group notification in approval process, so as to tell them that they hava pending tasks in OIM. As if the out of the box does not support sending an email to a group of users. I have written the custom code to implement it, but I d
-
Connection between power supply, Motherboard & Chassis Fans
Hi guys, Please help me out here to connect my chassis fans to the motherboard/ powersupply. My rig is stated below === Msi x99s Gaming 7 mobo Cooler master storm stryker Cabinet Corsair cx750 === I just want to connect my chassis fans(White LED) - 1
-
Which is better for runners?
I run 3+ miles a day, 7 days a week. I have been through 3 iPods over the past 2 years, which have all died from some kind of defective hard drive or something. Is there an iPod that is designed to handle the abuse of running? I think that the consta
-
Unable to print web content "an unknown error occurs"
When attempting to print web items an error message window appears with the following; "An unknown error occurred while printing". Non- web items can be printed.