‎2007 May 06 1:44 PM
Hello Frnds,
I have a query regarding Funtion modules. Actually i m working in newer version so i want to know the replacement for the older version.
Suppose earlier for uploading flat file data we used "ws_upload". But now in newer version we are using "GUI upload". So can anyone help me that how to find the new replacement function modules for the older ones.
i.e in SAP.
thanking u all.
regards,
karan
‎2007 May 06 1:48 PM
<b>Refer the following code:</b>
*&---------------------------------------------------------------------*
*& Form upload_file
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM upload_file USING p_filename TYPE any
CHANGING p_local_table TYPE t_local_table.
* To get the input data from desktop file
DATA: l_file TYPE string.
CLEAR: l_file,
p_local_table.
l_file = p_filename.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
filetype = 'ASC'
TABLES
data_tab = p_local_table
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE e002 WITH l_file.
ENDIF.
ENDFORM. " upload_fileHere l_file is the desktop file path and p_local_table is the internal table where the data is to be uploaded from the local file.
‎2007 May 06 1:52 PM
Hi!
The replacements are sometimes documented by SAP.
If they are not, just post here your EXACT wish, which FM do you want to upgrade, and someone will surely tell you within a few minutes.
Regards
Tamá
‎2007 May 06 2:00 PM
There is no specific way. You can 'Function Module documentation' in SE37. You can get some help.Ex: For 'WS_UPLOAD' , 'Function Module documentation' clearly says that :
<b>FU WS_UPLOAD
____________________________________________________
Text
OBSOLETE: Transfer Presentation Server File to Internal Table
Uploads a file from the presentation server into an internal table.
Obsolete. Use class CL_GUI_FRONTEND_SERVICES.</b>
Now, If you dont find a FM in newer version, You can search a FM which does the similar task in the newer version. Such as in the newer version for uploading flat file :
1. Open SE37
2. Write 'UPLOAD' in the Functional module name
3. Then press F4
4. From the help you can find a appopriate FM
In some 'Function Module documentation' also, you will find a SAP recomendation for replacement of a older FM.