‎2005 Feb 10 7:42 PM
Hi,
I am trying to create background jobs with the help of SUBMIT.
Statements are something liek this:
KICK_COUNT = 0.
WHILE KICK_COUNT < 3.
CONCATENATE 'ZSUBMIT_BIW' KICK_COUNT INTO jbname.
KICK_COUNT = KICK_COUNT + 1.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = jbname
IMPORTING
JOBCOUNT = jbcnt.
p_pid = kick_count. " Brahma
set parameter id 'PID' field p_pid.
SUBMIT ZBW_BP_SI_USER_EXIT
with P_PID = KICK_COUNT
via job jbname number jbcnt
AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = jbcnt
JOBNAME = jbname
STRTIMMED = 'X'.
MOVE JBNAME TO I_JOB_STATUS-I_JOB_NAME.
MOVE JBCNT TO I_JOB_STATUS-I_JOB_COUNT.
APPEND I_JOB_STATUS.
ENDWHILE.
IN the ZBW_BP_SI_USER_EXIT program I have select statment :
SELECT * FROM ZBW_EXIT_TAB
INTO CORRESPONDING FIELDS OF TABLE I_REFPROC
WHERE PID = p_pid.
This select statment doesn't work when it is kicked off through above SUBMIT statement. By having WRITE statements I am confirming that p-pid (parameter) is getting passed perfectly alright.
If I execute the ZBW_BP_SI_USER_EXIT program separately with the value in P_PID , then SELECT statment above works fine.
PLease let me know what could be going wrong.
Thanks in advance.
-Santosh Taware
‎2005 Feb 10 8:36 PM
‎2005 Feb 10 8:06 PM
‎2005 Feb 10 8:36 PM
‎2005 Feb 10 8:55 PM
Thanks Rich,
Yeah, Parameter is there in the program ZBW_BP_SI_USER_EXIT and the passing paramtere type/lenght is same as the parameter specified in the program ZBW_BP_SI_USER_EXIT.
parameters P_PID like zbw_exit_tab-pid.
and KICK_COUNT LIKE tbtcjob-jobcount.
-Santosh
‎2005 Feb 10 9:00 PM
I have no clue then, its working great for me. Comment out the JOB_OPEN and JOB_CLOSE, comment out the "via job x number y" extension of your submit statement. Now debug. Does it work?
Are zbw_exit_tab-pid and KICK_COUNT the same type/length?
How is the zbw_exit_tab-pid defined in the data dictionary, you are adding 1 to kick_count, doing this may change the way the data in that field is formatted depending on how its defined in the data dictionary.
Regards
Rich Heilman
‎2005 Feb 10 10:21 PM
Even though KICK_COUNT and P_PID are same (tbtcjob-jobcount), it creates problem while passing parameter.
So I just used condense P_PID in the ZBW_BP_SI_USER_EXIT
program. and it worked.
Thanks for you help!
-Santosh