‎2008 Oct 19 2:00 PM
Hi,
I am using a global class in my function module which I have to make a Remote enabled, how should I declare the class in the Function Module, it is throwing me error when I declare my object name and type ref to class .
Thanks,
V
‎2008 Oct 19 3:01 PM
Hi,
Please refer to this link:
http://help.sap.com/saphelp_nw04/helpdata/en/d1/801f1c454211d189710000e8322d00/content.htm
You should be able to do declare the object of a Global Class(SE24) in your function module.
Can you please share the code which is giving Short Dump.....
‎2008 Oct 19 3:51 PM
are you using the class in the interface(importing/exporting) if so it is not possible incase of RFC function. you can only use LIKE or TYPE. for referring the class we have to use TYPE REF TO , so it is not allowed for RFC function.
‎2008 Oct 20 5:57 AM
Hi, yes, I am trying to declare the class in import parameters and refering it as Type Ref to it is throwing me an error, is there any way so that I can use global class for RFC.
Thanks,
V
‎2008 Oct 20 10:37 AM
I don't think you can do that for RFC function. It is not possible to send the class objects remotely. forget about that. just think of normal function call it inside a remote enabled function.
‎2008 Oct 20 10:45 AM
‎2008 Oct 20 10:48 AM
it is not possible to send the class objects remotely. so instead of that if you want to do any thing do it in RFC function itself. Normal function allows to specify the Class as interface parameter of the function module
‎2008 Oct 20 6:35 AM
Hi,
I would recommend to use the Pattern button you find in the toolbar (CTRL+F6), and select ABAP Objects pattern.
It will help you code the actual call to the method.
For instance, to call the GUI_DOWNLOAD method you will proceed by :
1) Enter CL_GUI_FRONTEND_SERVICES as the class/interface
2) Enter GUI_DOWNLOAD as the method.
You can use the match code once the class is entered to view the list of available methods.
Here is the result (as Rich mentionned it) :
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
BIN_FILESIZE =
filename =
FILETYPE = 'ASC'
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'
WK1_N_FORMAT = SPACE
WK1_N_SIZE = SPACE
WK1_T_FORMAT = SPACE
WK1_T_SIZE = SPACE
IMPORTING
FILELENGTH =
changing
data_tab =
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.
*******************************************************************************
If it is a static class with static methods, you can call them like this.
CALL METHOD <b>CL_GUI_FRONTEND_SERVICES=></b>Gui_Dowload
EXPORTING......
IF they are instance methods, you must first create an object of the class.
data: gui_object type ref to cl_gui_frontend_services.
create object gui_object.
CALL METHOD <b>GUI_Object-></b>Gui_Dowload
EXPORTING......
Best regards,
Satish
‎2008 Oct 20 6:43 AM
I am sorry, i think you got me wrong, I have to create a Function Module which is Remote enabled and in that I have to use class which is global one, yes I have tried creating a object in import of the Function Module but it is throwing me an error that we cannot use class(global) for RFC. Any inputs?
Best Regards,
V.
‎2008 Oct 23 6:37 AM