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

using perform statement in function module

Former Member
0 Likes
3,845

can I create a subroutine inside the function module. if possible where should the code for the form should be written.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,879

Hai,

You sholud not(can not) write Sunroutine definition in source code of function module.

Just write:

perform sub1 in source code of function module.

<b>Double click on subroutine name</b> then a dialog box appears press enter.

Click on Top-include name(L followed by Function group name folloed bt TOP ,For example if your FG name is FG1 then click on LFG1TOP which is called TOP INCLUE) and Press Enter.

There write your subroutine code.

Hope you can perfectly go forward.

<b>Award points if it helps you.</b>

Regds,

Rama.Pammi

4 REPLIES 4
Read only

Former Member
0 Likes
1,879

Hi Jenibalet S ,

Yes, You can create a subroutine inside the function module.

FUNCTION XXXXXX.

perform sub1.

ENDFUNCTION.

The form ... endform of the subroutine should be in an include under the same function group.

Regards,

Tanmay

Read only

Former Member
0 Likes
1,879

Hi,

Subroutines cld be created in FM's. they go in the includes of fM.

Check the link for info ;

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

Read only

Former Member
0 Likes
1,879

YES IN SOURCE CODE OF FN MODULE

PERFORM P_FORM.

ENDFUNCTION.

FORM P_FORM

<SOME CODE>

ENDFORM.

OR YOU CAN WRITE THE FORM IN SOME INCLUDE PROG ALSO..

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
1,880

Hai,

You sholud not(can not) write Sunroutine definition in source code of function module.

Just write:

perform sub1 in source code of function module.

<b>Double click on subroutine name</b> then a dialog box appears press enter.

Click on Top-include name(L followed by Function group name folloed bt TOP ,For example if your FG name is FG1 then click on LFG1TOP which is called TOP INCLUE) and Press Enter.

There write your subroutine code.

Hope you can perfectly go forward.

<b>Award points if it helps you.</b>

Regds,

Rama.Pammi