Invalid_JOBData = 3 in JOB_SUBMIT
Hi Folks,
I'm scheduling the job but while JOB_SUBMIT i'm getting Invalid_jobdata. I have searched in SDN for help but i could find any relevant answer to my issue.
PARAMETERS: p_varian LIKE v_bicu-variant NO-DISPLAY
DEFAULT 'JE_UPLOAD_A'.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = syst-uname
jobcount = job_count
jobname = p_jobnam
report = 'RFBIBL00'
variant = p_varian
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10.
Any help on this.
Regards
VEnk@
Venkat Reddy wrote:
> Yes through debugging itself i got know tht Invalid Jobdata was coming, wondering in many sites they gave analysis as VARIANT problem could it be tht.??
By debugging i mean debugging the 'JOB_SUBMIT' function. Did you try it before posting the qn?
Similar Messages
-
'INVALID_JOBDATA' in JOB_SUBMIT.
Hi All,
I am using JOB_OPEN, JOB_SUBMIT, JOB_CLOSE to schedule background job .
but it is throwing exception saying 'INVALID_JOBDATA' in FM JOB_SUBMIT.
I also tried 'BP_JOB_CREATE' still it is throwing the same exception.
Can anybody tell me the work around to this.
Thanks ,
SwarupHello,
Refer this programs how they are using these 3 FMs pass the parameters according to u r requirement.
RTXWQU01
RUTCNVSC
RUTCNVSK
RUTMSJOB
RUTTABSJ
RUTTABSQ
RV15B001
RV15F001
RV56BPGI
RV60SBAT
RWMFA200
RWMFA210
RWMFA300
RWS41F04
RZDEBIV0 -
Problem in using JOB_OPEN, JOB_SUBMIT & JOB_CLOSE
Hi,
I using following code to submit the Job. But Job which is created is getting canceled in SM37 can anybody let me where the error is ?
I used GET_PRINT_PARAMETERS function module too but same results.
Thanks in advance.
DATA: TBTCJOB TYPE TBTCJOB,
NUMBER1 LIKE TBTCJOB-JOBCOUNT,
authcknam TYPE tbtcjob-authcknam,
JOBCOUNT LIKE TBTCJOB-JOBCOUNT,
JOBNAME LIKE TBTCJOB-JOBNAME,
ARC_PARAMS LIKE ARC_PARAMS,
OUT_PARAMS LIKE PRI_PARAMS,
VALID,
VALID_FOR_SPOOL.
jobname = '634_1155'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
jobclass = 'A'
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF SY-SUBRC EQ 0.
authcknam = sy-uname.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = authcknam
jobcount = jobcount
jobname = jobname
* PRIPARAMS = OUT_PARAMS
report = 'RMDATIND'
variant = 'TEST2'
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10.
IF SY-SUBRC = 0.
data lv_time like sy-uzeit.
lv_time = sy-uzeit + 10.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = jobcount
JOBNAME = jobname
sdlstrtdt = sy-datum
sdlstrttm = lv_time
STRTIMMED = 'X'
EXCEPTIONS
OTHERS = 01.
ENDIF.
ENDIF.
Edited by: Thomas Zloch on Jun 15, 2010 6:28 PMHi,
Thanks for looking in this issue Job log is showing this
2010/06/15 12:31:00 Job started 00 516 S
2010/06/15 12:31:00 Step 001 started (program RMDATIND, variant TEST2, user ID VANNAM) 00 550 S
2010/06/15 12:31:00 634_1155: This job was started periodically or directly from SM36/SM37 BD 076 I
2010/06/15 12:31:00 Job 634_1155: Data does not match the job definition; job terminated BD 078 E
2010/06/15 12:31:00 Job cancelled after system exception ERROR_MESSAGE 00 564 A -
Error return from JOB_SUBMIT / SUBMIT when running with another username
I am trying to run the program RSBDCSUB after setting up a BDC session.
Due to our authorisations in the production environment I have to run this program under a generic user (l_ernam) that has the authorisations as most users do not.
Here is the code I am using:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = l_jobname
IMPORTING
JOBCOUNT = l_jobcount
CHANGING
RET = l_ret
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4
Submit RSBDCSUB And Return
User l_Ernam
Via Job l_Jobname Number l_Jobcount
with mappe = l_mappe .
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = l_jobcount
jobname = l_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
When I run this with a restricted user I get a return of 8 from the submit rsbdcsub - has anyone seen this before and can you offer advice on how to solve it?.
I have also tried using JOB_SUBMIT with the following settings instead
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = l_ernam
jobcount = l_jobcount
jobname = l_jobname
REPORT = l_report
VARIANT = l_variant
EXCEPTIONS
BAD_PRIPARAMS = 1
BAD_XPGFLAGS = 2
INVALID_JOBDATA = 3
JOBNAME_MISSING = 4
JOB_NOTEX = 5
JOB_SUBMIT_FAILED = 6
LOCK_FAILED = 7
PROGRAM_MISSING = 8
PROG_ABAP_AND_EXTPG_SET = 9
OTHERS = 10
and in this case get a return of 3 (INVALID_JOBDATA) - anyone any ideas as to how to resolve this?.Hello Caroline,
I do not know whether this issue is resolved at your end. I faced a similar problem and found that User Type for the generic user(l_Ernam) was the cause.
We had initially defined User Type for the generic user as a 'Communication' and it was giving return code 8 after SUBMIT.
We later changed the User Type to 'System' and it worked as intended. Job was created under the name of the user who executed the main program and the steps added using the generic user(l_Ernam).
Please note that the user who is running the main program will need authorization to add job steps using the generic user.
With Kind Regards,
Jatin. -
Invalid_jobdata when submitting job with rfc user
Hi,
I've created a function module in the erp system to remotly trigger a report program by a bw prossess chain.
When running in the forground it works fine, but the runtime is so long that I want it as a background job.
So I call job_open, job_submit, job_close in the function module. When I test the function module in the erp system with my dev user it opens a new job, adds a step and release correctly. It also runs fine if I intercept it in the debugger and change sy-uname to aleremote (the standard rfc user).
It does not work when it's acctually called rfc from the bw system. The job is opened, but job_submit throws invalid_jobdata.
Could this have anything to do with rfc or the executing user (which is of type SYSTEM)?I've caught the execption so there is no dump, but I'm unable to determine why the function module job_submit gives invalid_jobdata only when the executing user is the aleremote user and only when the call originated (the call to my module) from a remote system (the module job_submit is called locally thru my module). Authorization for the user is sap_all, but I was woundering maybe the user type system could be a problem?
-
Passing variant values in job_submit FM
Hi Guys,
I am running a report in background using job_submit FM.
Currently I am using Get and Set parameters to pass selection screen values.
But these values are not effective when run in background.
If variant is an option, how to populate the variant from selection screen values.
ThanksHi,
U follow the given code. If u have taken varinat as parameter then ok.
other wise u have to pass rs_create_varaint* function module in the program.
DATA : v_jobhead LIKE tbtcjob.
DATA : v_jobcount LIKE tbtcjob-jobcount.
DATA : v_eventparm LIKE tbtcjob-eventparm.
DATA : v_flg_released TYPE c.
DATA: e_error.
DATA: running LIKE tbtcv-run.
TYPES: esp1_boolean LIKE boole-boole.
CONSTANTS: esp1_false TYPE esp1_boolean VALUE ' ',
esp1_true TYPE esp1_boolean VALUE 'X'.
CONSTANTS: true TYPE boolean VALUE esp1_true,
false TYPE boolean VALUE esp1_false.
PARAMETERS: v_jobnam LIKE tbtcjob-jobname,
v_report LIKE sy-repid,
v_varian LIKE raldb-variant,
v_uname LIKE sy-uname.
START-OF-SELECTION.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = v_jobnam
IMPORTING
jobcount = v_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
e_error = true.
ELSE.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = v_uname
jobcount = v_jobcount
jobname = v_jobnam
report = v_report
variant = v_varian
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10.
IF sy-subrc <> 0.
e_error = true.
ELSE.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = v_jobcount
jobname = v_jobnam
strtimmed = 'X'
IMPORTING
job_was_released = v_flg_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 <> 0.
e_error = true.
ELSE.
DO.
CALL FUNCTION 'SHOW_JOBSTATE'
EXPORTING
jobcount = v_jobcount
jobname = v_jobnam
EXCEPTIONS
jobcount_missing = 1
jobname_missing = 2
job_notex = 3
OTHERS = 4.
IF sy-subrc <> 0.
e_error = true.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF running = space.
exit.
endif.
enddo.
endif.
endif.
endif.
Regards,
Naveen M. -
JOB_OPEN and JOB_SUBMIT
could anybody tell me how to writ the code for scheduling the background job by using function modules JOB_OPEN and JOB_SUBMIT in my report program.
this is not BDC program..it is just a normal report.
Cheers & ThanksUse JOB_OPEN to indicate you want to create a background job. Use
JOB_INSERT to define the steps in your background job and JOB_CLOSE to
indicate that you have completed your definition of it.
The parameters of these functions mimic the input requirements from
SE37. If you look at their definition in SE11 the vast majority of these
parameters are self-explanatory.
Kind Regards
Chaitanya -
Need help with JOB_OPEN, JOB_SUBMIT and JOB_CLOSE
I am calling a standard Report which popups list of sessions.
Out of which, i select one session and the data belonging to that session is deleted from data base.
I need to perform the above task using a single report which consists of JOB_OPEN, JOB_SUBMIT and JOB_CLOSE function modules.
I mean i know the session number which i have to select. Where should i pass it and in which FM so that no popup should come and the data is automatically deleted as soon as the report is executed.
Can anyone tell me how to do this??I have clearly mentioned that I am executing a standard report which generates list of sessions.
SO deleting data from Database tables is the functionality of the report.
We dont need to worry about that.
I just need to perform that same functionality using JOB_OPEN, JOB_SUBMIT and JOB_CLOSE
i.e. is i write submit (reort)
via job number and return.
Where should i pass session number???
My only purpose is no break or halt should be there or i shouldnt select sessions while executing report.
I just pass session names at the beginning and the report is executed successfully. -
How we will use these Job_open and Job_submit job_close??
Hi Experts,
i am new in Developement, i need one help here my problem is
I have one issue which is a report here i am getting the data into internal table, that data fetching i want to schedule it in background job..
can any body tell me how can i use the JOB_OPEN and JOB_SUBMIT function modules....
plz provide any example..
Thanks in Advance,
Venkat NHi,
Here is the sample program
*Submit report as job(i.e. in background)
data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.
Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Regards
Sudheer -
How to do job_submit on a program which calls a custom FM?
Hi all,
I am doing a job_open, job_submit and job_close to submit a FM in background.
Now, how do I do a job_submit for a program which contains the FM that doing the real processing?
Details:
Program ZNSC_WRAP_RMD contains call function "YXAPY_REVIEW_MASTER_DATA'
CALL FUNCTION 'YXAPY_REVIEW_MASTER_DATA'
EXPORTING
i_pay_area = ' '
I_CHECK_OPTION =
I_GUI_ENABLE = ' '
I_PERNR =
IMPORTING
E_LOCK_EMP_TBL_ERROR =
E_TIME_RECON_TBL =
E_UNAPPROVED_TIME_TBL_ERROR =
E_WAGE_TYPE_TBL =
E_MISSING_INFO_TBL_ERROR =
E_RETURN = e_return
tables
t_return = t_return
Any idea?A job running in the background can not and should not use the frontend resources example GUI.
In your function module I see a parameter * I_GUI_ENABLE = ' '. Check it's usage and make sure GUI (and frontend processes) are disabled for the job to run in the back ground.
Any direct or indirect use of classes or FM calls which require frontend cannot execute in background as a job.
Regards,
Aabhas -
How do JOB_OPEN, JOB_SUBMIT, & JOB_INSERT Work?
Hi,
Can anybody tell me how to use the function modules JOB_OPEN and JOB_SUBMIT in my report program?
Thanks,
Das.Hi Manosh,
see the sample code for the Job scheduling using the fun modules
IF p_bjob = 'X'.
CONCATENATE sy-cprog sy-datum sy-uzeit
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.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
IMPORTING
out_archive_parameters = arc_params
out_parameters = print_params
valid = valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF valid = chk.
SUBMIT yREP WITH s_kunnr IN s_cust
AND RETURN
USER sy-uname
VIA JOB jobname
NUMBER jobcount
TO SAP-SPOOL
SPOOL PARAMETERS print_params
ARCHIVE PARAMETERS arc_params
WITHOUT SPOOL DYNPRO.
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.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE i029 WITH jobname.
ENDIF.
ELSE.
MESSAGE s000 WITH text-003.
STOP.
ENDIF.
ENDIF.
Also,
Yes you can use job functions:
JOB_OPEN
JOB_SUBMIT
JOB_CLOSE
You can add multiple steps into one job by using JOB_SUBMIT.
kindly reward if found helpful.
cheers,
Hema. -
JOB_OPEN JOB_SUBMIT JOB_CLOSE
Hello Experts,
I have a requirement where I want to execute a portion of my code in the background inorder to reduce the performance issue.
This can be done through JOB_OPEN JOB_SUBMIT JOB_CLOSE command which generates a new JOB in the background mode.
JOB_OPEN
JOB_SUBMIT
JOB_CLOSE
Question : How can I pass the internal table with the values through JOB_SUBMIT??
Thanking you all in advance,
Warm Regards,
gayatri.Hi,
* Get Print Parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
no_dialog = 'X'
IMPORTING
valid = g_valid
out_parameters = gs_params.
* Open Job
* g_stim = '185800'.
CONDENSE g_var6.
CONCATENATE g_var8+6(2)
g_var8+3(2)
g_var8(2)
INTO g_stim.
g_sdat = sy-datum .
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = g_job
sdlstrtdt = sy-datum
sdlstrttm = g_stim
IMPORTING
jobcount = g_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.
CONDENSE : g_var1,
g_var2,
g_var3,
g_var4,
g_var5,
g_var6,
g_var7,
g_var8.
gs_rspar-selname = 'P_USER'.
gs_rspar-kind = 'P'.
gs_rspar-low = g_var1.
APPEND gs_rspar TO gt_rspar.
gs_rspar-selname = 'P_PWD'.
gs_rspar-kind = 'P'.
gs_rspar-low = g_var2.
APPEND gs_rspar TO gt_rspar.
gs_rspar-selname = 'P_HOST'.
gs_rspar-kind = 'P'.
gs_rspar-low = g_var3.
APPEND gs_rspar TO gt_rspar.
gs_rspar-selname = 'P_FILE'.
gs_rspar-kind = 'P'.
gs_rspar-low = g_var4+2.
APPEND gs_rspar TO gt_rspar.
gs_rspar-selname = 'P_FNAME'.
gs_rspar-kind = 'P'.
gs_rspar-low = g_var5.
APPEND gs_rspar TO gt_rspar.
gs_rspar-selname = 'P_FILE1'.
gs_rspar-kind = 'P'.
gs_rspar-low = g_var6.
APPEND gs_rspar TO gt_rspar.
gs_rspar-selname = 'P_FILE2'.
gs_rspar-kind = 'P'.
gs_rspar-low = g_var7.
APPEND gs_rspar TO gt_rspar.
gs_rspar-selname = 'P_DEST'.
gs_rspar-kind = 'P'.
gs_rspar-low = 'SAPFTPA'.
APPEND gs_rspar TO gt_rspar.
gs_rspar-selname = 'P_COMP'. <----- This are Parameter value to be passed in background Program
gs_rspar-kind = 'P'.
gs_rspar-low = 'N'.
APPEND gs_rspar TO gt_rspar.
SUBMIT ztest123 VIA JOB g_job
NUMBER g_jobcount
* USING SELECTION-SCREEN
WITH SELECTION-TABLE gt_rspar
TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS gs_params
AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = g_jobcount
jobname = g_job
sdlstrtdt = g_sdat
sdlstrttm = g_stim
* 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 -
Schedule a program with JOB_SUBMIT
Hi Friends,
I need to execute a program using function modules JOB_OPEN, JOB_SUBMIT, JOB_CLOSE when ever i executed
(i.e; similar to Background scheduling immediatly using SM36, sm37)
please help me in the code,
i have written a sample program using JOB_OPEN, JOB_SUBMIT, JOB_CLOSE function modules,
but in SP01, i am able to see many jobs under my user.
How can i avoid multiple Background jobs triggering when i execute a program once using above function modules.
Thanks in Advance,
GaneshCALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = <JOB NAME>
IMPORTING
jobcount = tbtcjob-jobcount
EXCEPTIONS
OTHERS = 01.
IF sy-subrc = 0.
repid = <REPORT NAME>.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = tbtcjob-authcknam
jobcount = tbtcjob-jobcount
jobname = tbtcjob-jobname
report = repid
variant = raldb-variant
EXCEPTIONS
OTHERS = 01.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobname = tbtcjob-jobname
jobcount = tbtcjob-jobcount
strtimmed = 'X'
EXCEPTIONS
OTHERS = 01.
ENDIF.
ENDIF. -
Scheduling a background job using Job_Submit and Job_Close FM
Hi Guys,
I am calling a report in background using Job_Submit and Job_Close FM's.
I am not providing start time and date in the Job_close FM, in this case, when the job will be scheduled to start.
Even after an hour, job status is still scheduled.
I am not exporting variant, since I am using memory ID.
Thanks
Edited by: sapgeek007 on May 11, 2009 4:11 AMIn Job_close fm use the parameter 'STRTIMMED'
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = LV_NUMBER
jobname = LV_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
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.
That would start the background job immediately.
Regards,
Deepak -
JOB_SUBMIT with Selection Screen Value
I have a requirement :
with other select-options and parameters, i have two radio button, Foreground and Background:
when Background radio button will be selected program should be scheduled as a background job.
How i will pass selection screen value in JOB_SUBMIT ??
Cheers.
SrikantaHi ,
Try This
*& Report ZMMVB_PG_SL_CHANGE_BDC
REPORT zmmvb_pg_sl_change_bdc.
TABLES : mara,t133a,marc.
DATA i_t133a LIKE t133a OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
ekgrp LIKE marc-ekgrp,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
dispo LIKE marc-dispo,
END OF itab1.
DATA : fname LIKE ibipparms-path ,
ename TYPE string,
mode.
DATA: BEGIN OF it_t133a OCCURS 0,
bilds LIKE t133a-bilds,
pstat LIKE t133a-pstat,
guifu LIKE t133a-guifu,
auswg LIKE t133a-auswg,
END OF it_t133a.
DATA: ctr TYPE i,
ctr_s(2) TYPE n,
wrk(35),
ch(1),
viewno(2) TYPE n,
guifu LIKE t133a-guifu.
DATA: BEGIN OF it_views OCCURS 30.
INCLUDE STRUCTURE mbildtab. " Selection Views
DATA: END OF it_views.
DATA bdc_data LIKE bdcdata OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-000.
PARAMETERS : ek RADIOBUTTON GROUP rg1 ,
sl RADIOBUTTON GROUP rg1
SELECTION-SCREEN END OF BLOCK b.
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-001.
PARAMETERS : fg RADIOBUTTON GROUP rg2 DEFAULT 'X',
bg RADIOBUTTON GROUP rg2.
SELECTION-SCREEN END OF BLOCK c.
START-OF-SELECTION.
IF fg = 'X'.
mode = 'A'.
ELSEIF bg = 'X'.
mode = 'E'.
ENDIF.
IF ek = 'X'.
guifu = 'SP09'.
PERFORM bdc_ekgrp_change.
ELSEIF sl = 'X'.
guifu = 'SP12'.
PERFORM bdc_mrpcontroller_change.
ENDIF.
*& Form BDC_EKGRP_CHANGE
* text
* --> p1 text
* <-- p2 text
FORM bdc_ekgrp_change .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
field_name = ' '
IMPORTING
file_name = fname.
IF NOT ( fname IS INITIAL ) .
ename = fname .
ENDIF.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = ename
filetype = 'DAT'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF itab[] IS NOT INITIAL.
LOOP AT itab.
REFRESH bdc_data.
IF itab-matnr NA sy-abcde AND itab-matnr NA '/*-_.'.
UNPACK itab-matnr TO itab-matnr.
ELSE.
TRANSLATE itab-matnr TO UPPER CASE.
ENDIF.
SELECT SINGLE * FROM mara WHERE matnr = itab-matnr.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
PERFORM view_routine.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
itab-matnr.
CONCATENATE 'MSICHTAUSW-DYTXT(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
wrk. "'MSICHTAUSW-DYTXT(08)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
CONCATENATE 'MSICHTAUSW-KZSEL(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_field USING wrk "'MSICHTAUSW-KZSEL(08)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
itab-werks.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
* PERFORM bdc_field USING 'MAKT-MAKTX'
* '"HEX BOLT M16X1.5X100,B8.8,BP"'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-EKGRP'.
* PERFORM bdc_field USING 'MARA-MEINS'
* 'NOS'.
PERFORM bdc_field USING 'MARC-EKGRP'
itab-ekgrp.
* PERFORM bdc_field USING 'MARA-MATKL'
* '1702'.
* PERFORM bdc_field USING 'MARC-USEQU'
* '3'.
* PERFORM bdc_field USING 'MARC-KORDB'
* 'X'.
CALL TRANSACTION 'MM02' USING bdc_data MODE mode UPDATE 'S'.
ENDLOOP.
ENDIF.
ENDFORM. " BDC_EKGRP_CHANGE
*& Form BDC_MRPCONTROLLER_CHANGE
* text
* --> p1 text
* <-- p2 text
FORM bdc_mrpcontroller_change .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
field_name = ' '
IMPORTING
file_name = fname.
IF NOT ( fname IS INITIAL ) .
ename = fname .
ENDIF.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = ename
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF itab1[] IS NOT INITIAL.
LOOP AT itab1.
REFRESH bdc_data.
IF itab1-matnr NA sy-abcde AND itab1-matnr NA '/*-_.'.
UNPACK itab1-matnr TO itab1-matnr.
ELSE.
TRANSLATE itab1-matnr TO UPPER CASE.
ENDIF.
SELECT SINGLE * FROM mara WHERE matnr = itab1-matnr.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
PERFORM view_routine.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
itab1-matnr.
CONCATENATE 'MSICHTAUSW-DYTXT(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
wrk. "'MSICHTAUSW-DYTXT(11)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
CONCATENATE 'MSICHTAUSW-KZSEL(' viewno ')' INTO wrk.
CONDENSE wrk NO-GAPS.
PERFORM bdc_field USING wrk "'MSICHTAUSW-KZSEL(11)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
itab1-werks.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
* PERFORM bdc_field USING 'MAKT-MAKTX'
* '"HEX BOLT M16X1.5X100,B8.8,BP"'.
* PERFORM bdc_field USING 'MARA-MEINS'
* 'NOS'.
* PERFORM bdc_field USING 'MARC-DISGR'
* '701'.
* PERFORM bdc_field USING 'MARC-EKGRP'
* 'A00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARC-DISPO'.
* PERFORM bdc_field USING 'MARC-DISMM'
* 'PD'.
PERFORM bdc_field USING 'MARC-DISPO'
itab1-dispo.
* PERFORM bdc_field USING 'MARC-DISLS'
* 'MB'.
CALL TRANSACTION 'MM02' USING bdc_data MODE mode UPDATE 'S'.
ENDLOOP.
ENDIF.
ENDFORM. " BDC_MRPCONTROLLER_CHANGE
*& Form bdc_dynpro
* text
* -->PROGRAM text
* -->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR bdc_data.
bdc_data-program = program.
bdc_data-dynpro = dynpro.
bdc_data-dynbegin = 'X'.
APPEND bdc_data.
ENDFORM. "BDC_DYNPRO
* Insert field *
FORM bdc_field USING fnam fval.
CLEAR bdc_data.
bdc_data-fnam = fnam.
bdc_data-fval = fval.
APPEND bdc_data.
ENDFORM. "BDC_FIELD
*& Form VIEW_ROUTINE
* text
* --> p1 text
* <-- p2 text
FORM view_routine .
CLEAR viewno.
SELECT * FROM t133a INTO CORRESPONDING FIELDS OF TABLE i_t133a
WHERE bilds = '21' AND guifu LIKE 'SP%' .
LOOP AT i_t133a .
ch = i_t133a-pstat.
IF mara-vpsta NA ch .
DELETE i_t133a .
CONTINUE .
ENDIF .
ENDLOOP.
SORT i_t133a BY guifu ASCENDING .
LOOP AT i_t133a .
viewno = viewno + 1 .
IF i_t133a-guifu = guifu .
EXIT .
ENDIF .
ENDLOOP .
ENDFORM. " VIEW_ROUTINE
Regards,
Maybe you are looking for
-
Unable to create restore disk image with Disk Utility
I've tried three times in order to create a restore image of the users' volume of my Powerbook. I followed exactly the procedure explained typing "man asr" in a terminal window. I booted the Powerbook in target disk mode while connected to my iMac G5
-
Function modules for table operations
Hi! I found the module "rfc_get_table_entries", can s.o. tell me some other standard function modules to work with database information? rfc_get_table_entries returns a concatenated Database line, it would be better for me to get a table with the cor
-
Update Mac remote desk top to 8.0.12
i'm new to this I have remote desk top installed on my macbook and when I click on the icon i get the " what's new in 8.0.01" my question is how do i get the new release.
-
Oracle 9i installation hangs at the "oracle Databas Configuration Assistant". I'm tryin to install Oracle 9i "first Time" and I get down to the last CD, and it hangs @ 50% "oracle Databas Configuration Assistant". Any Ideas??? Mark Lewis Nortel Netwo
-
No authorization for the component (query name)!
Hello all, when i am publishing the query in web, the following error message is displayed! "No authorization for the component (query name)!" i had installed and configured everything here, so the person responsible for authorization is none other t