Skip to Content
0
Former Member
Mar 25, 2009 at 06:34 AM

Calling a Subroutine dynamically (PERFORM xxxx IN PROGRAM yyyy)

562 Views

Hello Gurus,

Please help me to work with this. I'm trying to call a subroutine to a particularly program, but I want it to be flexible/reusable. I tried using field-symbols to pass the name of subroutine and program, but can't make it. Here's the details:

I have 2 paramaters:

PARAMETERS:

prognam LIKE tnapr-pgnam,

formnam(50).

Inside my program, Iwant to make this PERFORM statement to be dynamic:

PERFORM formname IN PROGRAM prognam.

So I don't need to crete several perform statements. Any help is very very much appreciated.