2007 Jun 19 3:58 PM
2) Suppose i have aprogram i whould make the program to run only in background if any ones wants to execute it it should not run in foreground insted give erormessage , its not about raising a message but howto make a report to run only in background ??...............................................is there any system variable to do so
2007 Jun 19 4:13 PM
hi,
SY-BATCH is the system variable, using this we knows the program executing in background or not.
IF SY-BATCH = 'X' means program executing in background.
sample program.
tables: kna1.
parameters: p_kunnr like kna1-kunne.
data: begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.
start-of-selection.
select kunnr name1 from kna1 into table itab
where kunnr = p_kunnr.
IF SY-BATCH = 'X'.
LOOP AT ITAB.
WRITE:/ ITAB-KUNNR,
ITAB-NAME1.
ENDLOOP.
ELSE.
MESSAGE A000 with 'execute in background only'.
**OR
LEAVE LIST-PROCESSING.
ENDIF.
regards,
Asgokreddy.
Message was edited by:
Ashok Reddy
hi,
SY-BATCH is the system variable, using this we knows the program executing in background or not.
IF SY-BATCH = 'X' means program executing in background.
sample program.
tables: kna1.
parameters: p_kunnr like kna1-kunne.
data: begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.
start-of-selection.
select kunnr name1 from kna1 into table itab
where kunnr = p_kunnr.
IF SY-BATCH = 'X'.
LOOP AT ITAB.
WRITE:/ ITAB-KUNNR,
ITAB-NAME1.
ENDLOOP.
ELSE.
MESSAGE A000 with 'execute in background only'.
**OR
LEAVE LIST-PROCESSING.
ENDIF.
regards,
Asgokreddy.
Message was edited by:
Ashok Reddy
2007 Jun 19 3:59 PM
check for sy-batch in the report. if it = 'X' run program else leave program.
Reward if helpful
2007 Jun 19 4:11 PM
Hey buddy
can you give me a small example please ...
thanks ahmed
2007 Jun 19 4:13 PM
hi,
SY-BATCH is the system variable, using this we knows the program executing in background or not.
IF SY-BATCH = 'X' means program executing in background.
sample program.
tables: kna1.
parameters: p_kunnr like kna1-kunne.
data: begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.
start-of-selection.
select kunnr name1 from kna1 into table itab
where kunnr = p_kunnr.
IF SY-BATCH = 'X'.
LOOP AT ITAB.
WRITE:/ ITAB-KUNNR,
ITAB-NAME1.
ENDLOOP.
ELSE.
MESSAGE A000 with 'execute in background only'.
**OR
LEAVE LIST-PROCESSING.
ENDIF.
regards,
Asgokreddy.
Message was edited by:
Ashok Reddy
2007 Jun 19 4:15 PM
Hi,
If sy-batch <> 'X'.
stop.
else.
write your program
endif.
Reward if helpful.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |