‎2007 Aug 09 5:19 PM
I want to access a FORM in one INCLUDE form another INCLUDE.I want to get the internal tables values from there through this include.
Please Help.
‎2007 Aug 09 5:24 PM
Hi,
You can use PERFORM statement with option TABLES.
Syntax:
PERFORM form IN PROGRAM prog.
Options:
1. ... TABLES itab1 itab2 ...
2. ... USING u1 u2 u3 ...
3. ... CHANGING c1 c2 c3 ...
4. ... IF FOUND
Regards,
Ferry Lianto
‎2007 Aug 09 5:23 PM
I assume the includes are in different main programs then. You can try something like
FIELD-SYMBOLS <FIELD> type VBAK
DATA W_FIELD(30) value '(SAPMV45A)VBAK'.
assign (w_field) to <field>.
‎2007 Aug 09 5:24 PM
Hi,
You can use PERFORM statement with option TABLES.
Syntax:
PERFORM form IN PROGRAM prog.
Options:
1. ... TABLES itab1 itab2 ...
2. ... USING u1 u2 u3 ...
3. ... CHANGING c1 c2 c3 ...
4. ... IF FOUND
Regards,
Ferry Lianto
‎2007 Aug 09 5:30 PM
Hi Ferry,
I am using this statement,
PERFORM FORM IN PROGRAM program
CHANGING CONTROL_RECORD_OUT.
I am getting a short dump.
Please help.
‎2007 Aug 09 5:32 PM
‎2007 Aug 09 5:47 PM
You say they are in the same function modue so I assume different includes. You can use my example of the field-symbols to get the data.
‎2007 Aug 09 5:32 PM
Hi Devi,
PERFORM (<fsubr>)[IN PROGRAM (<fprog>)][USING ... <pi>... ]
[CHANGING... <pi>... ]
[IF FOUND].
Suppose a program contains the following subroutines:
PROGRAM FORMPOOL.
FORM SUB1.
WRITE: / 'Subroutine 1'.
ENDFORM.
FORM SUB2.
WRITE: / 'Subroutine 2'.
ENDFORM.
Dynamic subroutine specification:
PROGRAM FORM_TEST.
DATA: PROGNAME(8) VALUE 'FORMPOOL',
SUBRNAME(8).
SUBRNAME = 'SUB1'.
PERFORM (SUBRNAME) IN PROGRAM (PROGNAME) IF FOUND.
SUBRNAME = 'SUB2'.
PERFORM (SUBRNAME) IN PROGRAM (PROGNAME) IF FOUND.
The produces the following output:
Subroutine 1
Subroutine 2
Hope this might helps you..
Regards,
Siva
<b>Note:pls Reward all useful answers</b>
‎2007 Aug 09 5:43 PM
Hi,
Can you paste your codes including the subroutine form?
Please check this sample codes as well on passing parameters to subroutine.
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db979d35c111d1829f0000e829fbfe/content.htm
Regards,
Ferry Lianto