‎2007 Jan 23 8:03 PM
Hi all,
I want to include a call to subroutine TKKA1000_FUELLEN in function group kkag in my custom program. Can I do that? I come from a C/JAVA baclground in which I could INCLUDE the class or set of programs with a simple statement. can i do the smae here?
regards,
Mat
‎2007 Jan 23 8:09 PM
‎2007 Jan 23 8:08 PM
HI,
Check the below code....
<b>PERFORM form IN PROGRAM prog.</b>
Additions:
1. ... USING p1 p2 p3 ...
2. ... CHANGING p1 p2 p3 ...
3. ... TABLES itab1 itab2 ...
4. ... IF FOUND
In an ABAP Objects context, a more severe syntaxcheck is performed that in other ABAP areas. See Passsing SY-REPID not allowedand Receiving SY-SUBRC not allowed.
Effect
This variant is similar to variant 2 (externalperform). However, here you can specify the names of both thesubroutine and the program in which it occurs dynamically at runtime.If you do this, you should place the variables form and prog in parentheses. The names in form and prog must beentered in uppercase, otherwise a runtime error occurs. If you do notspecify any additions (such as USING) you do not need to specifythe program after IN PROGRAM. In this case, the system looks forthe subroutine in the current program.
Example
DATA: RNAME(30) VALUE 'WRITE_STATISTIC', "Form and program
"names must
PNAME(8) VALUE 'ZYX_STAT'. "be written in
"upper case
PERFORM (RNAME) IN PROGRAM ZYX_STAT.
PERFORM WRITE_STATISTIC IN PROGRAM (PNAME).
PERFORM (RNAME) IN PROGRAM (PNAME).
All three PERFORM statements have the same effect, that is,they call the subroutine 'WRITE_STATISTIC', which is defined inthe program 'ZYX_STAT'.
Notes
Dynamic PERFORM statements require more CPU time, since the system has to locate the subroutine each time.
Regards,
Vara
‎2007 Jan 23 8:09 PM
‎2007 Jan 23 8:48 PM
Alternative to Rich's suggestion, you can also do the following
PERFORM TKKA1000_FUELL(saplkkag).
You have to include all the relevant parameters.
hith
Sunil Achyut