Application Development 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: 

Is it possible to define a fnc module inside my ABAP code.

Former Member
0 Kudos

If yes then please let me know how?

The main program of the function "xyz" does not begin

with "FUNCTION-POOL". The above error is always thrown, if i try to

define a function in my abap code.

Currently I presume it is not possible to define FM here.

Can anyone tell me What function pools are? and the difference between function groups and function pools

Points will be rewarded.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hey Sesh, U almost answered my qts, But i would like to know now how can i define that function group in my abap code so that i can write a function module there,

IF u know any syntax, please let me know..

Vinod

6 REPLIES 6

Former Member
0 Kudos

Vinod,

I hope you are asking about FUNCTION-GROUP.

Function Modules are always created using transaction SE37. While creating them you have to assign them to a Function Group. Using the same transaction SE37 you can create a Function Group also.

Once the Function Module is created, you can use it in your report by clicking "Pattern" box from the Task bar of ABAP editor.

Please let me know if I have interpreted your question correctly.....

0 Kudos

Hi,

FUnction Pools and Function Groups are same. When we create them we call them Function Groups as it is shown in the Workbench. But the program that is generated is called Function pool. As the name suggests its a collection of Function modules.

You cannot create a Function outside a function group. So if you want to use a function module in your program first create a function group and then create your function module inside that and then use it in your program.

Regards,

Sesh

Former Member
0 Kudos

Vinod,

You can. I think you have not activate your function group.

se37->Environment-->Inactive objects.>Function Group->select your function group and activate it (ctrl+F8)

Pls. mark if useful

Former Member
0 Kudos

Hey Sesh, U almost answered my qts, But i would like to know now how can i define that function group in my abap code so that i can write a function module there,

IF u know any syntax, please let me know..

Vinod

0 Kudos

Hi Vinod,

I think the program the you are creating is a REPORT program. And you want to create a Function module for which as I told you need to create a Function Group. A Function Group is also a program similar to a REPORT program. So you cannot create a FUNCTION GROUP inside a REPORT program. What you need to do is goto SE80, there in the dropdown select Function Group and give a name to it and then using forward navigation you can create Function Group, Once you created the Function group you can create function module using Se37 or in SE80 itself. Then in your report program using CALL FUNCTION to call this function module you created.

Regards,

Sesh

0 Kudos

U can write a function module in a ABAP program,u can only call an existing FM from ur abap code in SE38..

if u have some specific requirement then may be u can write a subroutine or use MAcro inside ur ABAP code..

amit