2007 Oct 01 7:17 AM
Hi
what is the replacement keyword for STOP in OO Context
its giving mesg as
The STOP statement is not supported in the OO context.
thanks,
Hi
what is the replacement keyword for STOP in OO Context
its giving mesg as
The STOP statement is not supported in the OO context.
thanks,
2007 Oct 01 7:22 AM
hi Kiran,
Can depend on your requirement... what do you want to achieve?
thanks
ec
2007 Oct 01 7:30 AM
hI
IF I REPLACE EXIT KEYWORD IT'S GOING OUT OF FORM ROUTINE
THIS IF CONDITION IS IN FORM ROUTINE
FORM OPEN_DATA_SET.
IF NOT PR_UNIX1 IS INITIAL AND NOT PR_PC1 IS INITIAL.
OPEN DATASET PR_UNIX1 FOR INPUT IN BINARY MODE.
IF SY-SUBRC <> 0.
MESSAGE S206 WITH PR_UNIX1.
EXIT.
ENDIF.
ENDIF.
ENDFORM.
2007 Oct 01 7:33 AM
than you should place an ELSE somewhere...
FORM OPEN_DATA_SET.
IF NOT PR_UNIX1 IS INITIAL AND NOT PR_PC1 IS INITIAL.
OPEN DATASET PR_UNIX1 FOR INPUT IN BINARY MODE.
IF SY-SUBRC <> 0.
MESSAGE S206 WITH PR_UNIX1.
ELSE.
this will run if sy-subrc is 0
ENDIF.
ENDIF.
ENDFORM.
2007 Oct 01 7:41 AM
Can you be a bit clearer about the context of the code you are trying to write? - you mention that you want to replace "stop" in OO but the example you gave was a form not a method.
The main use I found for a "stop" within a report was to instantly pass control to the "end-of-selection" event e.g. if no data found after doing the a database selection. If this is the context of the code you are asking about, then you will probably need to recode this to set and pass a flag, e.g. "g_stop type sap_boolean" set to "X", and test this variable before executing each subsequent chunk of logic.
Jonathan
2007 Oct 01 7:24 AM
Hi
IF SY-SUBRC <> 0.
MESSAGE S206 WITH PR_UNIX3.
STOP.
ENDIF.
2007 Oct 01 7:27 AM
2007 Oct 01 7:36 AM
IF SY-SUBRC <> 0 .
I WANT TO TERMINATE THE PROGRAM
HOW? WITHOUT USING STOP
2007 Oct 01 7:38 AM
2007 Oct 01 7:36 AM
Hi KIran,
You can use CONTINUE statement.
Ex.
A loop pass is exited using CONTINUE if the loop index sy-index is an odd number.
DATA remainder TYPE i.
DO 20 TIMES.
remainder = sy-index MOD 2.
IF remainder <> 0.
CONTINUE.
ENDIF.
WRITE / sy-index.
ENDDO.
Regards,
Pritha.
Reward points if helpful.
2007 Oct 01 7:42 AM
2007 Oct 04 2:36 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |