GUI_DOWNLOAD and UPLOAD Function Modules?
Hi All,
What exactly done by GUI_DOWNLOAD and UPLOAD Function Modules?
Akshitha.
What you exactly want know?
Here is the Sap documentation for both FM:
FU GUI_UPLOAD
Short Text
Upload for Data Provider
Functionality
The module loads a file from the PC to the server. Data can be transferred binarily or as text. Numbers and date fields can be interpreted according to the user settings.
Example
Binary upload: No conversion or interpretation
begin of itab,
raw(255) type x,
end of itab occurs 0.
CALL FUNCTION 'GUI_UPLOAD'
exporting
filetype = 'BIN'
filename = 'C:\DOWNLOAD.BIN'
tables
data_tab = itab.
Text upload
begin of itab,
text(255) type c,
end of itab occurs 0.
CALL FUNCTION 'GUI_UPLOAD'
exporting
filetype = 'ASC'
filename = 'C:\DOWNLOAD.TXT'
tables
data_tab = itab.
Parameters
FILENAME
FILETYPE
HAS_FIELD_SEPARATOR
HEADER_LENGTH
READ_BY_LINE
DAT_MODE
CODEPAGE
IGNORE_CERR
REPLACEMENT
CHECK_BOM
VIRUS_SCAN_PROFILE
NO_AUTH_CHECK
FILELENGTH
HEADER
DATA_TAB
Exceptions
FILE_OPEN_ERROR
FILE_READ_ERROR
NO_BATCH
GUI_REFUSE_FILETRANSFER
INVALID_TYPE
NO_AUTHORITY
UNKNOWN_ERROR
BAD_DATA_FORMAT
HEADER_NOT_ALLOWED
SEPARATOR_NOT_ALLOWED
HEADER_TOO_LONG
UNKNOWN_DP_ERROR
ACCESS_DENIED
DP_OUT_OF_MEMORY
DISK_FULL
DP_TIMEOUT
Function Group
SFES
FU GUI_DOWNLOAD
Short Text
Download an Internal Table to the PC
Functionality
Data transfer of an internal table form the server to a file on the PC. The Gui_Download module replaces the obsolete modules Ws_Download and Download. The file dialog of the download module is available in the class Cl_Gui_Frontend_Services.
Further information
TYPE-POOLS: ABAP.
Binary download table
DATA: BEGIN OF line_bin,
data(1024) TYPE X,
END OF line_bin.
DATA: data_tab_bin LIKE STANDARD TABLE OF line_bin.
Ascii download table
DATA: BEGIN OF line_asc,
text(1024) TYPE C,
END OF line_asc.
DATA: data_tab_asc LIKE STANDARD TABLE OF line_asc.
DAT download table
DATA: BEGIN OF line_dat,
Packed TYPE P,
Text(10) TYPE C,
Number TYPE I,
Date TYPE D,
Time TYPE T,
Float TYPE F,
Hex(3) TYPE X,
String TYPE String,
END OF line_dat.
DATA: data_tab_dat LIKE STANDARD TABLE OF line_dat.
Get filename
DATA: fullpath TYPE String,
filename TYPE String,
path TYPE String,
user_action TYPE I,
encoding TYPE ABAP_ENCODING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
EXPORTING
WINDOW_TITLE = 'Gui_Download Demo'
WITH_ENCODING = 'X'
INITIAL_DIRECTORY = 'C:\'
CHANGING
FILENAME = filename
PATH = path
FULLPATH = fullpath
USER_ACTION = user_action
FILE_ENCODING = encoding
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
IF user_action <> CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
EXIT.
ENDIF.
Download variables
DATA: length TYPE I.
Binary download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = fullpath
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = length
TABLES
DATA_TAB = data_tab_bin
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
Ascii download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = fullpath
FILETYPE = 'ASC'
IMPORTING
FILELENGTH = length
TABLES
DATA_TAB = data_tab_asc
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
DAT download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = fullpath
FILETYPE = 'DAT'
IMPORTING
FILELENGTH = length
TABLES
DATA_TAB = data_tab_dat
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
Parameters
BIN_FILESIZE
FILENAME
FILETYPE
APPEND
WRITE_FIELD_SEPARATOR
HEADER
TRUNC_TRAILING_BLANKS
WRITE_LF
COL_SELECT
COL_SELECT_MASK
DAT_MODE
CONFIRM_OVERWRITE
NO_AUTH_CHECK
CODEPAGE
IGNORE_CERR
REPLACEMENT
WRITE_BOM
TRUNC_TRAILING_BLANKS_EOL
WK1_N_FORMAT
WK1_N_SIZE
WK1_T_FORMAT
WK1_T_SIZE
WRITE_EOL
FILELENGTH
DATA_TAB
FIELDNAMES
Exceptions
FILE_WRITE_ERROR
NO_BATCH
GUI_REFUSE_FILETRANSFER
INVALID_TYPE
NO_AUTHORITY
UNKNOWN_ERROR
HEADER_NOT_ALLOWED
SEPARATOR_NOT_ALLOWED
FILESIZE_NOT_ALLOWED
HEADER_TOO_LONG
DP_ERROR_CREATE
DP_ERROR_SEND
DP_ERROR_WRITE
UNKNOWN_DP_ERROR
ACCESS_DENIED
DP_OUT_OF_MEMORY
DISK_FULL
DP_TIMEOUT
FILE_NOT_FOUND
DATAPROVIDER_EXCEPTION
CONTROL_FLUSH_ERROR
Function Group
SFES
Similar Messages
-
hi,
when i upload a file using gui upload Function module , the dot in the excel sheet gets converted into 'e' . is there any other Function module i can use to do that .
Thanks,
AmitHI,
You need to USe the FM <b>'ALSM_EXCEL_TO_INTERNAL_TABLE'</b>
*& Report UPLOAD_EXCEL *
*& Upload and excel file into an internal table using the following *
*& function module: ALSM_EXCEL_TO_INTERNAL_TABLE *
REPORT UPLOAD_EXCEL no standard page heading.
*Data Declaration
data: itab like alsmex_tabline occurs 0 with header line.
* Has the following format:
* Row number | Colum Number | Value
* i.e. 1 1 Name1
* 2 1 Joe
TYPES: Begin of t_record,
name1 like itab-value,
name2 like itab-value,
age like itab-value,
End of t_record.
DATA: it_record type standard table of t_record initial size 0,
wa_record type t_record.
DATA: gd_currentrow type i.
*Selection Screen Declaration
PARAMETER p_infile like rlgrap-filename.
*START OF SELECTION
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = p_infile
i_begin_col = '1'
i_begin_row = '2' "Do not require headings
i_end_col = '14'
i_end_row = '31'
tables
intern = itab
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
if sy-subrc <> 0.
message e010(zz) with text-001. "Problem uploading Excel Spreadsheet
endif.
* Sort table by rows and colums
sort itab by row col.
* Get first row retrieved
read table itab index 1.
* Set first row retrieved to current row
gd_currentrow = itab-row.
loop at itab.
* Reset values for next row
if itab-row ne gd_currentrow.
append wa_record to it_record.
clear wa_record.
gd_currentrow = itab-row.
endif.
case itab-col.
when '0001'. "First name
wa_record-name1 = itab-value.
when '0002'. "Surname
wa_record-name2 = itab-value.
when '0003'. "Age
wa_record-age = itab-value.
endcase.
endloop.
append wa_record to it_record.
*!! Excel data is now contained within the internal table IT_RECORD
* Display report data for illustration purposes
loop at it_record into wa_record.
write:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
endloop.
See the Below wxamples to uploa the excel file
http://www.sapdevelopment.co.uk/file/file_upexcel.htm
http://www.sap-img.com/abap/upload-material-master-finish-goods.htm -
Need help on mapping of obsolete and new function module
Hi Expert,
We are working on a upgradation tool in which i have to repace the obsolete function module "HELP_VALUES_GET_WITH_CHECKTAB
" by "F4IF_FIELD_VALUE_REQUEST
". I am not sure about the functionalities of these function modules as i have never used it. Can anyone please help me by providing some information abt these FMs. Also i need to do the mapping of parameters of old and new function module. So please provide the details of mapping also. Any pointers on this will be highly appreciated.
Thanks & Regards,
P Sharma
Moderator message : Duplicate post locked. Continue with [Parameter mapping of FMs|Parameter mapping of FMs;.
Edited by: Vinod Kumar on Jul 8, 2011 9:40 AMHey Enivass,
you can ckeck the input field "Account Number" whether it is numeric or Alphabet using *"Conversions ->Fixvalues"*
Steps:
1. Extract first character of input using *" Text -> substring"* -- start position 0 , char count 1
2. In Fix Value table you have to give following values:
Dafault value : Alphabet
key----
value
0----
Number
1----
Number
2----
Number
9----
Number
3. Write logic IF "number" than "Arithmatic -> FormatNumber (0000000000) -
// for leading zeros
ELSE
concat with extra space -
Thanks -
How to download and upload a module pool program ?
hi i am a sudent.can anyone suggest me how to download and upload a module pool program?
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on May 29, 2011 12:45 PMHi,
You cannot just download and upload module pool programs .
There are 2 different ways.
1. Copy all the includes and and create the same in the target system. You can download and upload the the Screen.
But GUI status you have to manually create.
2. If you have completely saved the module-pool program in one Workbench request(including Z tables u have used) in the original system ,just release the workbench request and copy the data file and co file and upload to the target system ( use CG3Y & CG3Z).
If the workbench is a Local Request save it in a Transport of copies and then move.
Regards
Aromal R -
Functioning of Enqueue and dequeue function modules
Hi to all
Please tell me what is the actual functioning of HR_EMPLOYEE_ENQUEUE and HR_EMPLOYEE_DEQUEUE function modules.
My requirement is that if any one working on same employee no. or other tcode is processing same emp no then no one able to work on thet and an error message should be displayed.
How to do it.
Please advice.
Regards
Anubhav GuptaHi,
Use the following.
BAPI_EMPLOYEE_ENQUEUE
BAPI_EMPLOYEE_DEQUEUE.
Pass pernr to it.
Regards,
Nishant Gupta -
Start conditions and check function modules
Hi,
When we apply start conditions to any particular even linkage you will find check function module as SWB_2_CHECK_FB_START_COND_EVAL. However, what if i want to implement both a custom check function module AND start conditions ?
My requirement is to implement both start conditions and check function module.
Is this possible ?
Thank you,
Nikhil.Hi,
You can use both of the things, however its advisable to check all start conditions if you are using check FM.
This is interface for custom check FM,once you have the key value, you can put all the checks here
*"*"Local Interface:
*" IMPORTING
*" VALUE(OBJTYPE) TYPE SWETYPECOU-OBJTYPE
*" VALUE(OBJKEY) TYPE SWEINSTCOU-OBJKEY
*" VALUE(EVENT) TYPE SWETYPECOU-EVENT
*" VALUE(RECTYPE) TYPE SWETYPECOU-RECTYPE
*" EXPORTING
*" REFERENCE(REFERENCE) TYPE C
*" TABLES
*" EVENT_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOT_TRIGGERD
Hope this helps.
Regards,
Sangvir Singh -
No entries in Define conversion group and external function module setting.
Hi all,
After active bussiness function SAP Oil & Gas, my system have a problem in SPRO.
SPRO --> IMG --> Industry solution Oil & Gas (Downstream) --> HPM --> QCI configuration --> Define conversion group and external function module setting.
Problem appear: Has no entries in there!
Please, help me! Thank you so much!
Tks & best regards,
DatHTDat,
There are few entries normally delivered by SAP and which are good for a regular implementation. It is possible that those are not copied over from the reference client. Second option is to check the BC set (if) available for this activity and pull those in. Check the SAP reference client first, most likely that has entries which you can copy over to your regular client.
Regards, -
Encrypt and Decrypt function modules
Hi
Please tell the function module names to Encrypt the code with key and Decrypt code with key.
i know these function module names
'FIEB_PASSWORD_ENCRYPT' and 'FIEB_PASSWORD_DECRYPT'
but its not working.
Is there any other function modules?
if it is not there please tell the documentation of the to create encrypt function module and decrypt function module.
Thanks.
Edited by: Craig Cmehil on Jul 18, 2008 10:01 AMtry this it will do little bit closer to encription and decription
DATA:
g_key TYPE i VALUE 26101957,
g_slen TYPE i,
g_pwd type string VALUE 'Pass1234',
g_pwd1 type xstring ,
obj type ref to cl_http_utility.
CREATE OBJECT obj.
CALL METHOD obj->if_http_utility~encode_utf8
EXPORTING
unencoded = g_pwd
receiving
encoded = g_pwd1
EXCEPTIONS
conversion_failed = 1
others = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD obj->if_http_utility~decode_utf8
EXPORTING
encoded = g_pwd1
receiving
unencoded = g_pwd
EXCEPTIONS
conversion_failed = 1
others = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write:/ g_pwd. -
Pricing and Rebates Function Module
Hi,
I need function module for uploading the prices in the following transaction
VK11 : Creation of condition type
VK12 : Change of condition type and
VB01 : Creation of Rebate Agreements
VB01 : Change of Rebate Agreements
Please, Let me the function module.
Regards,
M.SaravananHi,
check the FM BAPI_PRICES_CONDITIONS for Pricing conditions .
Because this is FM which is INBOUND FM for Cond_A02 idoc type for posting Pricing Routines,
<REMOVED BY MODERATOR>
Raj
Edited by: Raj D on Jun 13, 2008 5:11 PM
Edited by: Alvaro Tejada Galindo on Jun 13, 2008 11:12 AM -
MySAP replacements for Excel upload function modules?
I am doing some development in SRM 4.0 (WAS 640) and I notice that a few of my favorite function modules are no longer available. Specifically, I'm missing these the most:
KCD_EXCEL_OLE_TO_INT_CONVERT
ALSM_EXCEL_TO_INTERNAL_TABLE
Are there new equivalents? I know how to access XLS files by writing my own OLE calls, but sometimes it's just easier to use the standard function modules instead.
Yes, I've done a function module search, but I've found nothing that looks to the the same as my old friends.Hi Chris,
I can't give you an alternative function module per say. Obviously, the downside of using SAP functions, that were probably never released for customer consumption anyway is that they can easily disappear. The suggestion I have is to use the features offered by DOI (desktop office integration). There in lies a set of classes and methods for generically accessing various documents (e.g. ms word, excel etc.) There is some examples in the re-use library (tcode se83). So here you don't need to be worried about the OLE either. Possibly in WAS there might also be some other classes that might access Excel sheets. Downside of finding a new function is that it might disappear in the next version you go to, whereas DOI is unlikey to disappear in a hurry. Best of luck.
p.s. there are a few other postings in the forum, maybe one will give you an answer, if you haven't search already.
Message was edited by: Michael Bennett -
PO download and Upload functionality in SRM 5.0
Dear experts,
Is there really in SRM 5.0 Extended Classic scenario a functionality to download and Upload PO's to Excel?
I have seen some people speaking about it in this forum but it is not documented in any SAP document
Thanks
RDYeap, sure!
You can do this, if you go into the PO, you'll see these buttons.
Check that.
Rgs,
Pedro Marques
Edited by: Mr. Pedro Marques on Jun 30, 2008 5:35 PM -
SRM 7 ECS : SC and PO Function Modules
Hi Gurus,
Has anybody some documentation about function modules which are triggered in extended classic regarding SC and PO.
Many thanks in advance.What are the FM involved in PO replication to the backend?
Thanks -
Hanlding Unit Pack and Unpack Function module
Hi All,
Can any one know the functiona modules for PACK Handling Unit and UNPACK Handling Unit? If so please reply me.
Thanks,
PranavHi,
Please check this FM.
PACK_HANDLING_UNIT
UNPACK_HANDLING_UNIT
Hope this will help.
Regards,
Ferry Lianto -
I have an importing parameter in function module interface, type BEGDA (type DATUM), default value SY-DATUM.
When I execute test function module via SE37 and F8, the default value gets value "02....20.3" instead of 03.02.2012 as set up in SU01 for my user.
What can be wrong?At the risk of also incurring your scorn, let me add that I cannot make this fail, using exactly what you have in the original post. Obviously, something unusual is happening this client/instance, or in code that is manipulating the incoming date value.... my dd.mm.yyyy input defaulted to sy-datum shows 20120306 in begda duringe execution (in debug). Without being able to debug the mentioned FM at every step, it would be hard to pinpoint a specific problem.
-
Delete and rename function module
Hi,
I have created a function module, but wanted to rename it afterwards.
that was not possible, because I have got the message, that it´s locked in any transport requests.
So I have copied the function and want to delete the old one now. But the same problem...
I have removed the object entry on "function modules" in the request, but I still get the message, that
it´s locked in the request.
What can I do to delete and rename the functions?
Thank you!hi ,
GO to se03.
in that you can see , search for objects in request /tasks.
click that ,
in the object selection screen
in R3TR / FUGR - 'Give that function group name'.
you can get all the request , where that function group exists.
Note down the requests.
Then, go back in se03 itself.
There u can see 'unlock objects'.
give the transport numbers in that. It will unlock the function module.
Hope , it vil solve it.
Regards,
sabari
Maybe you are looking for
-
I just set up my new Magic Mouse and I really like it so far. Seems pretty smooth and no more track ball cleaning! One question. Since the side buttons that were on the mighty mouse were not put on the magic mouse, Im assuming the function they perfo
-
External Hard Drive is not responding
I started to notice this in the last couple days that my external hard drive is not responding to my imac. I could browse the hard drive, but I would not be able to open any file. And, any application that tries to open file from the drive would fail
-
Hello needing help re installing adobe creative suite back on to my macbook pro, just had to replace the hard drive in the computer
-
The ipod is messed up how can i go about fixing it, and or sending it in to get a new one.
-
[SOLVED] linux-firmware upgrade
is it safe to delete the file /usr/lib/firmware/carl9170-1.fw or force the upgrade of this package? pacman says it exist in filesystem, and complains on conflicting files. ezik Last edited by shulamy (2013-05-04 14:25:30)