‎2008 May 12 10:13 AM
Hi Experts...
A Subroutine can be called using
PERFORM Sub-Name using...
Is there any other way that a subroutine (- i.e., the code for subroutine written in between FORM ... ENDFORM) can be triggered?
Rewardable...
Santo
‎2008 May 12 10:17 AM
Hi,
U cannot call a subroutine in any other way except by using Perform.
Calling Subroutines
You call subroutines using the statement
PERFORM... [USING ... <pi>... ]
[CHANGING... <pi>... ].
Subroutines can call other subroutines (nested calls) and may also call themselves (recursive calls). Once a subroutine has finished running, the calling program carries on processing after the PERFORM statement. You can use the USING and CHANGING additions to supply values to the parameter interface of the subroutine.
Defining Subroutines
A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
FORM <subr> [USING ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]
[CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ].
...
ENDFORM.
<subr> is the name of the subroutine. The optional additions USING and CHANGING define the parameter interface. Like any other processing block, subroutines cannot be nested. You should therefore place your subroutine definitions at the end of the program, especially for executable programs (type 1). In this way, you eliminate the risk of accidentally ending an event block in the wrong place by inserting a FORM...ENDFORM block.
‎2008 May 12 10:17 AM
Hi,
U cannot call a subroutine in any other way except by using Perform.
Calling Subroutines
You call subroutines using the statement
PERFORM... [USING ... <pi>... ]
[CHANGING... <pi>... ].
Subroutines can call other subroutines (nested calls) and may also call themselves (recursive calls). Once a subroutine has finished running, the calling program carries on processing after the PERFORM statement. You can use the USING and CHANGING additions to supply values to the parameter interface of the subroutine.
Defining Subroutines
A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
FORM <subr> [USING ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]
[CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ].
...
ENDFORM.
<subr> is the name of the subroutine. The optional additions USING and CHANGING define the parameter interface. Like any other processing block, subroutines cannot be nested. You should therefore place your subroutine definitions at the end of the program, especially for executable programs (type 1). In this way, you eliminate the risk of accidentally ending an event block in the wrong place by inserting a FORM...ENDFORM block.
‎2008 May 12 10:17 AM
Hi,
Using Perform we r passing actual parameters.
USing FORM statement formal parameters r used.
With in form and endform statements code is written .
Regards,
Narasimha
‎2008 May 12 10:18 AM
‎2008 May 12 10:20 AM
hi,
there is no way to trigger form... endform without using perform
if u dont use subroutiens.
try writing that code in a function module and call that functuion module.
reagrds
prasanth