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: 

Diff. between function module and objects .

Former Member
0 Kudos

Hi Sapians ,

What my question is when we call a function module twice with in my program

It will work on only one instance of function group ?

can u tell me clearly ,What are the scenario so we need two instance of a same function group in my program ?

With Regards

Tarun

2 REPLIES 2

Former Member
0 Kudos

hi

no prob on that .

i use same fm 2 time in 1 prog its working .

how to use the fm.

see my code

IF NOT i_salesdoc IS INITIAL.

*Download the sales document file

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

filename = p_file1

filetype = 'DAT'

TABLES

data_tab = i_salesdoc

fieldnames = i_header

EXCEPTIONS

OTHERS = 1.

IF sy-subrc = 0.

IF NOT i_component IS INITIAL.

PERFORM create_headers_comm.

*Download the component file header

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

filename = p_file2

filetype = 'DAT'

TABLES

data_tab = i_head

fieldnames = i_header

EXCEPTIONS

OTHERS = 1.

IF sy-subrc = 0.

*Download the component file data

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

filename = p_file2

filetype = 'DAT'

mode = 'A'

TABLES

data_tab = i_component

EXCEPTIONS

OTHERS = 1.

IF sy-subrc = 0.

MESSAGE s001(00) WITH text-019.

ELSE.

MESSAGE e001(00) WITH text-027.

ENDIF.

ELSE.

MESSAGE e001(00) WITH text-027.

ENDIF.

ELSE.

MESSAGE e001(00) WITH text-029.

ENDIF.

ELSE.

MESSAGE e001(00) WITH text-027.

ENDIF.

ELSE.

MESSAGE e001(00) WITH text-028.

ENDIF.

it's will help u.

kk.

Former Member
0 Kudos

Hi,

Function modules means it is unique.

Whenever u call the function module the parameter go to the function module

after processing it comes back with result.

if u call 100 times also it will go to the same function module.

u can check with debugging.

Assign points if useful.