on 03-03-2008 6:55 AM
hi
i am writing a perform in a form
perform in program ztest
endperform
now in program ztest i have a code check if that becomes false i dont want the remaingin part of code to execute and want the cursor return to the form or next program as per normal flow
wht should i give Exit or continue if condtion is false or sth else in need to give..i want the cursor to return to the form next line as if my perform was not there..
regards
arora
Hi,
In the form you have to call subroutine as follows.
/: Perform sub in program Ztest
/: using &field_check&
/: changing &return_value&
/:endperform.
in the subroutine program you have to code as follows.
Form sub tables intab structure itcsy
outtab structure itcsy.
read table intab with key name = 'FIELD_CHECK'.
if sy-subrc = 0.
check input-value = 'TRUE VALUE'.
read table outtab with key name = 'RETURN VALUE'.
if sy-subrc = 0.
outtab-value = 'RETURN VALUE'.
outtab-name = 'RETURN VALUE'.
modify outtab index sy-tabix.
endif.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
*****************SUB-ROUTINE USING USING VALUE****************************
DATA : A TYPE I VALUE 10.
PERFORM SUB USING A.
WRITE : A.
&----
*& Form SUB
&----
text
----
-->P_A text
----
form SUB using VALUE(P_A).
P_A = P_A * 10.
WRITE : P_A.
endform. " SUB
ARUN REDDY I
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A SAMPLE SUBROUTINE************************
DATA : A TYPE I VALUE 10.
PERFORM SUB.
&----
*& Form SUB
&----
text
----
--> p1 text
<-- p2 text
----
form SUB .
WRITE : A.
endform. " SUB
*************************A SUB-ROUTINE USING USING EXTENSION************
DATA : A TYPE I VALUE 10.
PERFORM SUB USING A.
WRITE : A.
&----
*& Form SUB
&----
text
----
-->P_A text
----
form SUB using p_a.
P_A = P_A * 10.
WRITE : P_A.
endform. " SUB
ARUN REDDY I
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
why dont you use using and changing parameters?
On false condition, pass some variable back to the form, so it will continue execution just after the perform..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IT WORKS SIMILAR TO CALL-BY-RFERENCE.THE VALUES RETURNED WILL BE SAME FOR FORM AND PERFORM.
****************************SUB-ROUTINE USING CHANGING VALUE****************************
DATA : A TYPE I VALUE 10.
PERFORM SUB CHANGING A.
WRITE : A.
&----
*& Form SUB
&----
text
----
<--P_A text
----
form SUB changing VALUE(p_a).
P_A = P_A * 10.
WRITE : P_A.
endform. " SUB
PARAMETERS USED IN THE CALLING SUB-ROUTINES ARE CALLED ACTUAL PARAMETERS.
PARAMETRS USED IN THE CALLED SUB-ROUTINES ARE CALLED FORMAL PARAMETERS.
CALL-BY-REFERNCE:
SAME MEMORY WILL BE ALLOCATED FOR ACTUAL AND FORMAL PARAMETERS.
CALL-BY-VALUE:
DIFFERENT MEMPRY WILL BE ALLOCATED FOR ACTUAL AND FORMAL PARAMETERS.
ARUN REDDY I
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.