09-29-2008 9:54 AM
Hello All,
I have a quick question. I am working with a background job and I have a doubt about the sy-batch value. I know it set to 1 when the process in run in background but if I turn the debuggin on [ via the infinite loop ] then will the sy-batch value change to SPACE ?
In debugging I see its changed to space but I am wondering is it cause I am debuggin in background or is it because Its an update task ?
can you please advise ?
thanks,
09-29-2008 10:16 AM
The SY-BATCH should come as "X" when you debug a background job via infinite loop. Have you called any code update task? If yes then it will be processed via dialog processing so here SY-BATCH will be initial.
I just set this program in background and found that the SY-BATCH as "X" and it goes to infinite loop.
REPORT ztest1.
DATA: l_flag TYPE c LENGTH 1.
DO.
IF l_flag = sy-batch.
EXIT.
ENDIF.
ENDDO.
DATA: l_string TYPE string,
l_final TYPE string.
l_string = 'UPS Surface Collect #954365'.
DATA: l_dummy1 TYPE string,
l_dummy2 TYPE string.
SPLIT l_string AT ' #' INTO l_dummy1 l_dummy2.
CONCATENATE l_dummy1 l_dummy2 INTO l_final.
WRITE:/1 l_final.
Edited by: Sourav Bhaduri on Sep 29, 2008 2:47 PM
09-29-2008 9:59 AM
Hi,
It's a system field not program specific so if you are debugging in the foreground then it will be set to space.
Darren
09-29-2008 10:00 AM
Hi Reena Sharma,
May i know how you can debug a background execution?
Whether it's get into DEBUGGER screen?
No, Youcan't debug.
Regards,
R.Nagarajan.
09-29-2008 10:02 AM
yes it does get into the debuggin screen, since I have put an infinite loop.
Also its not a SM37 job but its in sm50
09-29-2008 10:06 AM
Hi Renna Sharma,
SM50 is the 'PROCESS OVERVIEW'.
How you found SY-BATCH as INITIAL there.
Background execution can't be debug.
Regards,
R.Nagarajan.
09-29-2008 10:07 AM
09-29-2008 10:08 AM
You can debug it from SM50 as I assume you are or if you are on NetWeaver 2004 or 2004s you can use checkpoints.
See transaction SAAB.
Darren
09-29-2008 10:09 AM
Yes I can, thats not my question. My question is will value of sy-batch change, I am really confused over it...
09-29-2008 10:16 AM
The SY-BATCH should come as "X" when you debug a background job via infinite loop. Have you called any code update task? If yes then it will be processed via dialog processing so here SY-BATCH will be initial.
I just set this program in background and found that the SY-BATCH as "X" and it goes to infinite loop.
REPORT ztest1.
DATA: l_flag TYPE c LENGTH 1.
DO.
IF l_flag = sy-batch.
EXIT.
ENDIF.
ENDDO.
DATA: l_string TYPE string,
l_final TYPE string.
l_string = 'UPS Surface Collect #954365'.
DATA: l_dummy1 TYPE string,
l_dummy2 TYPE string.
SPLIT l_string AT ' #' INTO l_dummy1 l_dummy2.
CONCATENATE l_dummy1 l_dummy2 INTO l_final.
WRITE:/1 l_final.
Edited by: Sourav Bhaduri on Sep 29, 2008 2:47 PM
09-29-2008 10:25 AM
Thanks a lot for your help Sourav. Indeed I have an update task [ I am doing a VF04 and submitting the print job to a 3rd party printer ] .
So can i conclude that if there is an update task involved the sy-batch will be set to null ?
thanks,
Edited by: Reena Sharma on Sep 29, 2008 10:26 AM
09-29-2008 10:42 AM
yes...SY-BATCH will be "X" only when in background work process. when in update task it will be processed in UPDATE wok process. So in your case SY-BATCH will be initial.