Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SUBMIT with parameter

Former Member
0 Likes
669

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

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
605

Also, please check to make sure that there is a parameter "P_PID" in program ZBW_BP_SI_USER_EXIT. When you use the Submit statement "WITH" parameters, there is no checking that the parameters exist in the submitted program.

Regards,

Rich Heilman

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
605

Your code looks pretty good to me, are you sure that the ZBW_EXIT_TAB-PID and the P_PID are of the same type and the data is in the same format? If so, what exactly are the data types/lengths.

Regards,

Rich Heilman

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
606

Also, please check to make sure that there is a parameter "P_PID" in program ZBW_BP_SI_USER_EXIT. When you use the Submit statement "WITH" parameters, there is no checking that the parameters exist in the submitted program.

Regards,

Rich Heilman

Read only

0 Likes
605

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

Read only

0 Likes
605

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

Read only

0 Likes
605

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