Function Module GUI_DOWNLOAD: Type String Issue
I am working in 4.6C. I have used this Function Module many times in the past without issue, but not at this site. It abends and gives me the error message:
The call to the function module "GUI_DOWNLOAD" is incorrect:
The function module interface allows you to specify only fields
of a particular type under "FILENAME". The field "FNAME" specified here
has a different field type.
Here is the field declaration in the code:
PARAMETER: fname type rlgrap-filename DEFAULT 'C:/New_PO_Format.xls'.
The import parameter in GUI_DOWNLOAD for FILENAME is type STRING. When I double click on STRING in the FM I get "Unable to find a tool to process request". And, TYPE STRING does not exist in the system? I started making a Z version of GUI_DOWNLOAD, but it started giving me headaches because I had to start copying other SAP function modules.
Am I missing something? Or, is there a new and improved version of GUI_DOWNLOAD to use?
data : v_file type string.
PARAMETER: fname type rlgrap-filename DEFAULT 'C:/New_PO_Format.xls'.
start-of-selection.
v_file = fname.
use v_file in gui_download parameter.
Thanks
Seshu
Similar Messages
-
Function module to convert string to decimals?
HI,
is there any function module to convert string value in to decimals...string value contains exponent form...or any other way to convert if there is no funtion module..
please let me know...
Thanks
VenkateshLike this?
data: str type string.
data: f type f.
data: p type p decimals 3.
str = '1.2345678900000000E+08'.
f = str.
p = f.
write:/ p.
Regards,
RIch Heilman -
Question about exceptions in function module GUI_DOWNLOAD
To all,
I add the function module 'GUI_DOWNLOAD' in the ABAP report program. After the user download the data to excel, the program also displays a report on the screen for print output.
If the user keep the excel file open and tries to replace the file on download, the program gives an error message 'Access to file denied' and the program ends without displaying a report on the screen.
Is there any way not to end the program even if download is failed?
I would like the program displays a report after it gives an error message.
So I am trying to use exceptions. But if I code to give messages, the programs ends as above. And if I just make exit when it happens, no error message and the program displays a report but the user don't know if the excel file was updated or not.
Could anybody kindly let me know how to code exceptions and messages if it is possible the program works I hope.
Thank you very much in advance.
Best regards,
Miki KomatsuI figured out how to do that.
Thanks.
Best regards,
Miki -
RFC function module - not considering string type parameters
Hi,
i am calling one RFC, this rfc function module is enhanced to have one more import parameter and the type of this parameter is of type "string".
i am passing this value from while calling rfc fm but i can see this value is not being considered here in the target system, i mean the passed value from source system is not seen in the target system.
i read some thing related to rfc restrictions on code pages, is it something to do with that or string type is not allowed??
Please suggest!!!Hi all,
I faced the same problem and solved it ,
You have defined a reference parameter for a remotely called
function module. However, only value parameters are allowed
for this type of module.
Procedure
Change the reference parameter to a value parameter.
Guys pls .don't leave the thread un-asnwered when you solved problem , post the solution it might be useful for others also.
Regards
Krishna Acharya -
Function Module GUI_DOWNLOAD in SAP 4.6c
Hi All,
I have uploaded a JPG file to a database table and when using the below function modules in the SAP 4.7 server its not opening the file.
The Below code is written for the double click event. The same code works for the ECC 6.0 version
please help.
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code. (Your orioginal post included code that was commented out.)
Thanks in Advance.
Regards
Ninan
Edited by: NINAN on Jan 27, 2010 7:50 AM
Edited by: NINAN on Jan 27, 2010 10:07 AM
Edited by: NINAN on Jan 27, 2010 11:12 AM
Edited by: Rob Burbank on Jan 27, 2010 9:20 AMThis is the code NINAN is talking about
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
* BIN_FILESIZE = FILENAME = FNAM FILETYPE = 'BIN'
* APPEND = SPACE
* WRITE_FIELD_SEPARATOR = SPACE
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = SPACE
* WRITE_LF = 'X' * COL_SELECT = SPACE * COL_SELECT_MASK = SPACE
* DAT_MODE = SPACE
* CONFIRM_OVERWRITE = SPACE
* NO_AUTH_CHECK = SPACE
* CODEPAGE = SPACE
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = SPACE
* TRUNC_TRAILING_BLANKS_EOL = 'X'
IMPORTING
FILELENGTH = FILE_LENGTH
CHANGING
DATA_TAB = IT_PIC_TAB_DOWN
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
NOT_SUPPORTED_BY_GUI = 22
ERROR_NO_GUI = 23
OTHERS = 24 .
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 CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
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 CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
DOCUMENT = FNAM
* APPLICATION =
* PARAMETER =
* DEFAULT_DIRECTORY =
* MAXIMIZED =
* MINIMIZED =
* SYNCHRONOUS = operation = 'OPEN'
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
BAD_PARAMETER = 3
FILE_NOT_FOUND = 4
PATH_NOT_FOUND = 5
FILE_EXTENSION_UNKNOWN = 6
ERROR_EXECUTE_FAILED = 7
SYNCHRONOUS_FAILED = 8
NOT_SUPPORTED_BY_GUI = 9
OTHERS = 10 .
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Regarding function module GUI_DOWNLOAD
Hi all,
I need to add a header to the file which i am going to download.
So can any body say me how can i add header to a table which i am passing to the FM GUI_UPLOAD.
Tell me ASAP.
Regards,
Sagar.Hi,
pls check this program yaar
TYPES:
BEGIN OF t_emp_dat,
pernr TYPE pa0001-pernr,
persg TYPE pa0001-persg,
persk TYPE pa0001-persk,
plans TYPE pa0001-plans,
stell TYPE pa0001-stell,
END OF t_emp_dat,
t_attachment TYPE solisti1.
DATA:
w_emp_data TYPE t_emp_dat,
w_attachment TYPE t_attachment.
DATA:
i_emp_data TYPE STANDARD TABLE OF t_emp_dat,
i_attachment TYPE STANDARD TABLE OF t_attachment.
PARAMETERS: p_file TYPE string DEFAULT 'c:\tmp\test.xls'.
"Start-of-selection.
START-OF-SELECTION.
PERFORM get_data.
PERFORM build_xls_data_and_download.
"Form get_data from PA0001
FORM get_data.
SELECT pernr
persg
persk
plans
stell
FROM pa0001
INTO CORRESPONDING FIELDS OF TABLE i_emp_data
UP TO 4 ROWS.
ENDFORM. " get_data
"Form build_xls_data_and_download
FORM build_xls_data_and_download.
"If you have Unicode check active in program attributes then
"you will need to declare constants as follows.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS:
con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
DATA :l_lines TYPE char10.
DESCRIBE TABLE i_emp_data LINES l_lines.
CONCATENATE 'Total no of records:' l_lines
INTO w_attachment
SEPARATED BY con_tab.
CONCATENATE con_cret
w_attachment
INTO w_attachment.
APPEND w_attachment TO i_attachment.
CLEAR w_attachment.
CONCATENATE 'PERNR' 'PERSG' 'PERSK' 'PLANS' 'STELL'
INTO w_attachment
SEPARATED BY con_tab.
CONCATENATE con_cret
w_attachment
INTO w_attachment.
APPEND w_attachment TO i_attachment.
CLEAR w_attachment.
LOOP AT i_emp_data INTO w_emp_data.
CONCATENATE w_emp_data-pernr
w_emp_data-persg
w_emp_data-persk
w_emp_data-plans
w_emp_data-stell
INTO w_attachment
SEPARATED BY con_tab.
CONCATENATE con_cret w_attachment
INTO w_attachment.
APPEND w_attachment TO i_attachment.
CLEAR w_attachment.
ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
write_field_separator = con_tab
TABLES
data_tab = i_attachment.
IF sy-subrc = 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
reward if helpful
raam -
Function Module GUI_DOWNLOAD Problem in Japanese language.
HI All,
I am Using GUI_Download funtion module for downloading data from internal table to flat file.
But one of the field having the value 'OLOA®5624'.
In User login to Japanese Langualge:-
After downloading data the value 'OLOA#5624' is apper insted of 'OLOA®5624'. (i.e the '®' - the symbol is replaced by # in the download ).
If any one know please let me as early as possible.Hi,
Once you download the data, you have to convert the data.
Please check the below link for more help.
http://help.sap.com/saphelp_nw2004s/helpdata/en/79/c554afb3dc11d5993800508b6b8b11/frameset.htm
Thanks,
Ramakrishna -
Demantra - Create New Series - Mdp_matrix - Data Type String Issue
I created a new series (MDP_matrix) that has the data type as String. The display format is BLANK.
I was able to load the data into mdp_matrix table for the series i created.
However, when i look at the series in a worksheet, it does not display the string value. It display zero. for some reason, it considers the series as numeric and not string. Any idea why that would be happening?
This is on version 7.2 using SQL server/tomcatHi
1. Have you tried giving display format i.e ###?
2. Is your server expression something like max (mdp_matrix. column_name)?
Tks
MJ -
Function module to split strings
Hi,
I have a string value ' DBTABLE-FIELDNAME'. I need to split this into 2 strings - The first one is the database table name and the second one is the fieldname. So, the character '-' is the point where the split needs to be done. How can this be achieved. Any FM that I could use?
Thanks for your help!
Regards,
Divyaman Singh RawatUse FM 'STRING_SPLIT'
REPORT ZEXAMPLE.
DATA: V_HEAD(10), V_TAIL(10).
PARAMETERS: P_STR(20),
P_DEM.
CALL FUNCTION 'STRING_SPLIT'
EXPORTING
DELIMITER = P_DEM
STRING = P_STR
IMPORTING
HEAD = V_HEAD
TAIL = V_TAIL
EXCEPTIONS
NOT_FOUND = 1
NOT_VALID = 2
TOO_LONG = 3
TOO_SMALL = 4
OTHERS = 5.
IF SY-SUBRC EQ 0.
WRITE:/ 'HEAD:', V_HEAD,
/ 'TAIL:', V_TAIL.
ELSE.
WRITE:/ 'ERROR SPLITTING STRING'.
ENDIF.
Regards,
Joy. -
CONTROL_FLUSH_ERROR when using 'GUI_DOWNLOAD' Function Module in foreground
Hi,
I am using function module 'GUI_DOWNLOAD' in foreground mode with APPEND = 'X' ( I need to add infomration to file ).
In most of the cases it works good but in some cases ( which I cannot isolate ) - I am getting CONTROL_FLUSH_ERROR exception. Do you have any ideas where can be the problem?
Thanks in advance,
AnnaYou will get "CONTROL_FLUSH_ERROR " error when there is some problem with SAP GUI. Check your Gui installation and if possible uninstall the exixting GUI and reinstall the new GUI from fresh.
or you can use the below code
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING bin_filesize = l_xml_size
filename = 'c:tempflights.xml'
filetype = 'BIN'
CHANGING data_tab = l_xml_table
EXCEPTIONS OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. -
Function modules for Goods Movement Types 501 and 502
Hi,
Is there any function modules to do Goods issues and Goods receipts without PO (501 & 052).
Thanks in Advance.
EswarHi,
Check BAPI_GOODSMVT_CREATE
Thanks & Regards,
Navneeth K. -
Function module to check if a given file/folder path is valid or not?
Hi,
I am using function modules GUI_DOWNLOAD and GUI_UPLOAD.
Is there any function module to check if a given file/folder path is valid or not?
Thanks.Hi Kumar ,
REPORT zdir_test.
TYPE-POOLS: abap.
DATA: v_dir TYPE string.
DATA: v_bol TYPE abap_bool.
v_dir = 'c:\sap\'.
CALL METHOD cl_gui_frontend_services=>directory_exist
EXPORTING
directory = v_dir
RECEIVING
result = v_bol
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
OTHERS = 5.IF NOT v_bol IS INITIAL.
WRITE:/ 'Directory exists.'.
ELSE.
WRITE:/ 'Directory does not exist.'.
ENDIF.
Regards,
Sachin M M -
Use of function module 'FTP connect'
when we use the function module 'FTP connect', and 'FTP_R3_TO_SERVER'
Hi,
The Function module GUI_DOWNLOAD is used to download the data into presentation server and Dataset concepts to download the data into Application server. Sometimes we may require to download the data from other system (3rd Party System) to SAP and Vice Versa. In such scenarios, the concept of FTP commands comes into picture.
the various FTP commands are:
HTTP_SCRAMBLE, FTP_CONNECT, FTP_R3_TO_SERVER, FTP_DISCONNECT, RFC_CONNECTION_CLOSE function modules.
FTP_CONNECT : This is used to connect to other system from SAP with the help of Userid & amp; scrambled password & Host string & destination (default 'SAPFTP').
FTP_R3_TO_SERVERThis is used to transfer the internal table data as a file to other system in the character mode.
for more details refer to link:
Transferring Data from SAP to Other Systems
Thanks
Rajesh Kumar -
Dynamic Internal Table in Function Module
Hi,
I am developing a function module which is similar to GUI_DOWNLOAD. So , In My function module I would like to pass the internal table dynamically.I saw the paramter DATA_TAB in the function module GUI_DOWNLOAD. But there is no type associated with that. Could anyone help Me out for achieving thsi fucntionality.
Regards
Elini.PHi Elini,
When the tables parameter of the function module has got no line type specified, it will acquire the same type as the parameter that is passed to it during the call. In other words, the table is of generic type. you can pass any table to that parameter.
However, in case your function module is Remote Enabled, you will not be able to define the tables parameter as generic. IOt must be given some line type.
Regards,
Anand Mandalika. -
How to find the names of Function Module used in the program
Hi all,
can you people help me with this issue.I want to the names of all the Function Module used in the program along with their parameters into an internal table.It will be helpful for your suggestions.
Kind Regards,
Edited by: Prasenjit Sengupta on Nov 20, 2008 7:39 AMTake structure of internal table as
TYPES : BEGIN OF TY_FM,
FUNCNAME TYPE RS38L_FNAM, "Name of Function Module
PARAMETER TYPE RS38L_PAR_, "Parameter name
PARAMTYPE TYPE RS38L_KIND, " Parameter type
R3STATE TYPE R3STATE, "ABAP: Program Status (Active, Saved, Transported...)
STRUCTURE TYPE RS38L_TYP, "Associated Type of an Interface Parameter
DEFAULTVAL TYPE RS38L_DEFO,"Default value for import parameter
REFERENCE TYPE RS38L_REFE, "Call by reference
OPTIONAL TYPE RS38L_OPTI, "Optional parameters
TYPE TYPE RS38L_TYPE, "Reference Structure is an ABAP/4 Type
END OF TY_FM.
DATA : IT_FM TYPE TABLE OF TY_FM WITH HEADER LINE.
Maybe you are looking for
-
Problem with LONG column in 8.1.7
Hello All, Our db version is 8.1.7.0.0. ( Unix OS ). We have a table with a LONG column, which stores BINARY data(Billing Details). Is there any way to manipulate it, other than converting it to LOB column? I dont know where to start.Any help or hint
-
Photoshop Album Starter Edition 3.0 .... I register, get the email with the lock out code, enter it and it just kicks me out of the program. The first couple of times it let me in, but the next time I went back into it, the registration screen came b
-
In T code CV02N to add work station application MS Power point
Hello, I want to add MS power point presentation work station application in T code CV02N. I have configured data carrier type and trying to configur workstation application in network but don't know what to put for below fields 1.Path with program n
-
Query for applying constraints?
Requirement To search for the products whose SKU's start date is less than today and end date is greater than today. Pre-Condition • In our Project indexing is at product level • Start Date and End Date is at Child SKU level. Problem In XHTML
-
Iphone not recognizing 5Ghz network
my iphone 4s does not See my Airport Extreme 5Ghz network.Any suggestions or reccomendations would be greatl appreciated.