Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

dynamic action

Former Member
0 Likes
438

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

3 REPLIES 3
Read only

Former Member
0 Likes
410

Hi,

perform (sname) IN PROGRAM (pname) [IF FOUND]

Plzz reward points if it helps.

Read only

Former Member
0 Likes
410

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.

Read only

Former Member
0 Likes
410

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.