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

Functions

Former Member
0 Likes
868

Hello Friends,

I am new in the world of SAP and also SDN.I would like to know which fields need to be filled for different function modules. Each function module has a different set of fields to be filled. Please fill me on the details.

Thank you,

Reson.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
830

hi

goto se37 and open the FM documentation u want

u will find some thing like this

*"----


""Lokale Schnittstelle:

*" IMPORTING

" VALUE(CON_NAME) TYPE DBCON_NAME <b>OPTIONAL</b>" TABLES

*" LOCK_LIST STRUCTURE LOCK_L_SDB

*" EXCEPTIONS

*" NO_CONNECTION

*"----


u need not fill the params which r indicated as <b>optional</b> but the rest r mandatory & shud b filled

8 REPLIES 8
Read only

Former Member
0 Likes
830

hi

just go to the function module and see the impoting and exporting parameters.

you will cone to know thw parameters to be passed and their types

to find the madatory fields to be passed see whether the

field is optional or not.

Message was edited by: Vijay Kumar Reddy

Read only

Former Member
0 Likes
830

Hi Reson,

It depends on the function module and ur requirement , mandatory fields has to be filled

Read only

0 Likes
830

hi Reson,

WELCOME TO SDN.

It depends on which FM you are using and what are the Mandatory fields in that.

For Example if you are using GUI_DOWNLOAD then these are the parameters to be passed.

CALL FUNCTION <b>'GUI_DOWNLOAD'</b>

EXPORTING

filename = ld_fullpath

filetype = 'ASC'

  • APPEND = 'X'

write_field_separator = 'X'

  • CONFIRM_OVERWRITE = 'X'

TABLES

data_tab = it_datatab[] "need to declare and populate

EXCEPTIONS

file_open_error = 1

file_write_error = 2

OTHERS = 3.

Regards,

Santosh

Read only

rahulkavuri
Active Contributor
0 Likes
830

CALL FUNCTION <module>

[EXPORTING

f1 = s1

f2 = s2

fn = sn (parameters which you pass from program to function are

s1, s2, sn)]

[IMPORTING

f1 = r1

f2 = r2

fn = rn (parameters which program receives you pass from function in

r1, r2, rn)]

[TABLES f1 = a1 … fn = an]

EXCEPTIONS notvalid = 1

not correct = 2

OTHERS = 5].

It depends on the condition where u use it, if u are simply defining a function module on ur own then u can pass ur variables in <b>exporting</b> and get the return values in <b>importing</b>

Read only

Former Member
0 Likes
830

Hi,

Every FM has IMPORTING, Exporting , Exception parameter.

Importing :- r those parameter which used by FM to generate result.

They are 2 type mandatory and option ( Has the Name Suggests)

Exporting :- r those parameters ; actually a result

Exception :- always uncomment the exception to avoid dump.

exceptions r handled statement between

if sy-subrc = exception Number

.......exception Handling.

endif.

Go through the link ( A Book for freshers )

http://cma.zdnet.com/book/abap/index.htm

Please mark Helpfull answers

Regards

Message was edited by: Manoj Gupta

Read only

Former Member
0 Likes
830

Hi,

Go to SE37 and give the FM name and go in display mode and check the import and table parameters if they mark it as Optional then you need not to pass for those parameters. if it is not optional then you have to pass the data to that parameters.

Regards

vijay

Read only

Former Member
0 Likes
831

hi

goto se37 and open the FM documentation u want

u will find some thing like this

*"----


""Lokale Schnittstelle:

*" IMPORTING

" VALUE(CON_NAME) TYPE DBCON_NAME <b>OPTIONAL</b>" TABLES

*" LOCK_LIST STRUCTURE LOCK_L_SDB

*" EXCEPTIONS

*" NO_CONNECTION

*"----


u need not fill the params which r indicated as <b>optional</b> but the rest r mandatory & shud b filled

Read only

0 Likes
830

Just wanted to point out that you don't have to code the function module signature in your ABAP code. All you need to do is use the CALL FUNCTION pattern. Doing so, the system will write the entire signature for you in your ABAP program.

Go to Se38 and edit your program, put your cursor at the desire spot and click the "Patterns" button, in the dialog enter the name of your function module and hit enter. You will see that the function call has been populated in your program.

Regards,

Rich Heilman