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

INCLUDE

Former Member
0 Likes
976

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
927

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

7 REPLIES 7
Read only

Former Member
0 Likes
927

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>.

Read only

Former Member
0 Likes
928

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

Read only

0 Likes
927

Hi Ferry,

I am using this statement,

PERFORM FORM IN PROGRAM program

CHANGING CONTROL_RECORD_OUT.

I am getting a short dump.

Please help.

Read only

0 Likes
927

they are in the same FUNCTION MODULE.

Read only

0 Likes
927

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.

Read only

Former Member
0 Likes
927

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>

Read only

Former Member
0 Likes
927

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