‎2008 Jan 17 11:39 AM
hi friends,
could u plz tell me in dynamic action how to use subroutines ?? ie. 'F'
plz tell me how the subroutine program should be???with an example
thanks in advance.
with regards,
priya.s
‎2008 Jan 17 11:42 AM
Hi,
perform (sname) IN PROGRAM (pname) [IF FOUND]
Plzz reward points if it helps.
‎2008 Jan 17 12:19 PM
Hi,
Dynamic Subroutines are Obsolete now I think.
But you can use normal subroutines:
A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
FORM subr [USING p1 TYPE type
p2 LIKE field
...
VALUE(p3) TYPE type
VALUE(p4) LIKE field
... ]
[CHANGING { {VALUE(p1)}|{p1 [{TYPE type}|{LIKE field}]}
{VALUE(p2)}|{p2 [{TYPE type}|{LIKE field}]}
... } ]
...
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. In this way, you eliminate the risk of non-executable statements occurring by mistake through a subroutine closing an event block at the wrong place.
You can call the subroutine by the statement:
PERFORM <formname>.
For more information refer:
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db976935c111d1829f0000e829fbfe/frameset.htm
Pls rewrad points if useful.
Regards,
Renjith Michael.
‎2008 Jan 17 12:30 PM
Hi,
Example of Dyanamic Action which calls a FORM routine:
In View T588Z
0001 F GET_DATE(ZTEST)
0001 I INS, 19, 01
0001 W P00019-VTRMN = RP50D-DATe1
The GET_DATE routine in program ZTEST calculates the date and enters DATE1 field via ''TABLES RP50D in ZTEST
Regards,
Archana.