10-09-2007 12:19 PM
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
10-09-2007 12:25 PM
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.
10-09-2007 12:26 PM
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.