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

example needed for function module

Former Member
0 Likes
859

kindly provide me an example for function module & let me how to use this function in a report program..Thnaks in advance..

5 REPLIES 5
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
754

Hi,

GO to Tcode SE80.Create fucntion group.Name should start with z or y.

GO to Tcode SE37.Create function module.Assign it to function group created above.Name should start with z or y.

In change mode,you can top include.This is the place you should put the declarations.

In F01,you need to write the form and U01 you should write the main program.Best way is to take any function module(z*) and follow it.

There are 3 types of fm.

1.Normal fm

2.RFC enabled

3.Update task.

Check this link for RFC.

http://help.sap.com/saphelp_47x200/helpdata/en/22/0425f2488911d189490000e829fbbd/frameset.htm

Read only

Former Member
0 Likes
754

Hi,

Declare PARAMETERS: P_FILE LIKE RLGRAP-FILENAME. in your program..

No write this :

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = 'P_FILE'

IMPORTING

FILE_NAME = P_FILE.

This will browse thru the directories to pick a name when U press F4 on the

P_FILE ..

Regards,

GSR.

Read only

Former Member
0 Likes
754

hi,

First, go to SE80, select from the listbox, "Function Group", enter the name of your function group, Hit enter. SYstem will ask if you want to create it, say yes. Once the function group is created, then righ-click on the node in the tree structure and select create->function module. Name it and give description.

Add your IMPORT and EXPORT parameters in the appropriate tab, add the source code in the appropriate tab. SAve and activate.

Here is some addtional reading.

http://help.sap.com/saphelp_470/helpdata/en/d1/801ee8454211d189710000e8322d00/frameset.htm

Regards,

Santosh

Read only

Former Member
0 Likes
754

Hi Pradeep,

Function modules are ABAP routines that are administered in a central function library. They apply across applications and are available throughout the system. You must assign function modules to a function pool that is called a function group. A function group is nothing but a container for the function modules. Now create a function group and then a function module, which you can use for the next exercise steps.

Check this step by step exercies.

http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm

Regards,

Raghav

Read only

andreas_mann3
Active Contributor